Hi,
Today we are at a new level. Finally starting with the pocket algoritme.
Have made a offset.h file that can offset all types of curves.
At the moment it can offset : line, linestrip, polygon, arc, circle, ellipse, bezier curve, rectangular.
The pocket algoritme is quite a difficult algoritme to design.
Some of the reason's why a pocket algoritme is quite difficult is because it can form islands :
Another example of pockets with inside contours :
With some contour shapes, you need to place an extra arc, to reattach the contour again :
Before i start writing this procedure in c++, i write the workflow down on paper :
1. To keep it simple, we start at the yellow contours, they are up to date for a pocket operation.
2. We do a contour offset with a value of -2mm for the yellow ones.
3. We do a intersection loop trhough the contour objects.
4. We do a contour offset with a value of +2mm for eventually insides of contour 0.
5. Intersection loop again.
6. Check if offset paths are closed, if not, place arc's to close the contour.
7. Check if offset paths are closed, if yes, go on, if not, message the user to get a cup of coffee, user is trapped in a infinite while loop

6. Now we check if the offset path's are self intersecting and or intersecting with other offset paths. If yes : start at a free line (non intersecting line, arc or watherver) at the intersection point, go to the left at that point, reattach to intersected object, and select objects wich are done. (later on we delete all non selected).
7. We have to look when to stop the pocket offset loop.
This is how it would look like :
I am curious now how difficult it will be to get this right...
Last week i thought about the auto nesting algoritme for some time. I have good hope for that.