Skip to content

Legal self-intersecting input for offset operation #738

Answered by AngusJohnson
olologin asked this question in Q&A
Discussion options

You must be logged in to vote

Positive offset of open polylines should not suffer from self-intersections.

With regard to the documentation here that states "offsetting should not be performed on self-intersecting polygons as doing so will almost always produce unexpected results", this advice does not pertain to open paths (polylines). It's quite OK to offset polylines that self-intersect, though doing so will flatten the resulting polygon generated by the offset.

The following example offsets an open path that self-intersects and demonstrates flattening of the overlap region:

  PathsD subject = PathsD{ MakePathD({10,10, 100,200, 10,200, 100,10}) };
  PathsD solution = InflatePaths(subject, 10, JoinType::Round, End…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@olologin
Comment options

Answer selected by olologin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants