Is it possible to do polyline with multiple offsets for clippers? #589
Replies: 6 comments
-
|
Yes it is possible but it hasn't been documented yet. C#: C++: |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, but it seems to me that this is a polygon offset ( whereby the offset is done on both sides of the line and thus the end result forms a closed polygon), not a polyline offset ( where the offset is done on one side but not both, and the offset outcome is just an open polyline instead of a closed polygon), which something that CavalierContour is doing. Is there anyway to do a polyline variable offset? |
Beta Was this translation helpful? Give feedback.
-
You'd have to modify the source code which shouldn't be too hard.
|
Beta Was this translation helpful? Give feedback.
-
|
Not too sure if your procedure works, because it seems to me that the
outcome of the above operation is still a polygon, but not a polyline (
which is what I want).
…On Wed, Jul 19, 2023 at 11:47 AM Angus Johnson ***@***.***> wrote:
Is there anyway to do a *polyline* variable offset?
You'd have to modify the source code which shouldn't be too hard.
1. offset one side not two
2. temporarily append the original line segments.
3. Union clip the result (to clean-up)
4. remove the appended original line segments.
—
Reply to this email directly, view it on GitHub
<#589 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADENIZTILQFZQOTZHXK5QMTXQ5KD5ANCNFSM6AAAAAA2PIZPTI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Step 4 above converts the polygon back to an open path. |
Beta Was this translation helpful? Give feedback.
-
|
Angus, I have another idea, I want to run it here and gain feedback:
1. Extend the original (poly)line so that it cuts through the buffered
polygon at two points.
2. Traverse the two cut points, from the start to the end, and we can
already form the offset polyline that is at only one side
What do you think?
…On Wed, Jul 19, 2023 at 1:23 PM Angus Johnson ***@***.***> wrote:
Step 4 above converts the polygon back to an open path.
—
Reply to this email directly, view it on GitHub
<#589 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADENIZVLXZNZ55L2LMQRDHDXQ5VONANCNFSM6AAAAAA2PIZPTI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The question is this: Is there any plan to support variable offsets for polyline? Something like NetTopologySuite VariableBuffer. But NetTopologySuite is only applicable to polygon if I'm not mistaken.
Currently it seems that for clippers library, only uniform offset can be done throughout all the vertexes on the polylines.
Beta Was this translation helpful? Give feedback.
All reactions