Parallel line using Clipper library

六月ゝ 毕业季﹏ 提交于 2019-12-10 13:35:12

问题


I'm using CLIPPER library to offset line and trying to make parallel line.

ClipperOffset co = new ClipperOffset();

co.AddPath (s, JoinType.jtRound, EndType.etOpenRound);

co.Execute (ref solution, 15);

Result is right image in attachment. I need parallel lines instead of offset line "around" main line.

Does anyone know is it possible in Clipper or maybe anyone have any idea how to filter result points to remove unnecessary?


回答1:


Using Endtype.etOpenButt while adding the path will help you:

https://sourceforge.net/p/jsclipper/wiki/documentation/#clipperlibendtype

You will also need to cut few points at the very beginning and in the middle of the resulting polygon maybe, well to extract your two "parallel" lines.



来源:https://stackoverflow.com/questions/36456727/parallel-line-using-clipper-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!