Skip to content

Cutline Holes / mono Polygon in Clipper2 #759

Closed Answered by philstopford
MCVenor asked this question in Q&A
Discussion options

You must be logged in to vote

No - you'll need to write your own keyholing code. I have done this in my personal stuff (https://github.com/philstopford/DesignLibs_GPL/). It can be quite complicated.

In general, I work with floating point coordinates, so in the case of the keyholing I scale up the geometry to where scaling back down again will shrink the injected keyhole to a zero-impact edge. Having scaled up the input geometry:

  • Iterate across each hole, casting rays outwards based on the normal.
  • I tag the rays with their originating 'hole' number using the Z coordinate.
  • Cut the rays using all other geometry (outer and other holes), and here I use the Z callback. Here, you need to carefully set and later check the Z …

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by MCVenor
Comment options

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

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants