Issues like this arise, and can be dangerous in a milling context. Ideally, overhangs would be ignored in this context. The issue is finding a performant way to test what is an overhang vs what is not.
Potential solution: raytrace from "suspect" verts up to the stock.max.z. Count the number of intersections, if > 0 this vert is contributing to an overhung feature.
Once we have collected all of the invalid verts, then we need to safely remove them from the clipping process.
Potential solutions:
remove and re-mesh (e.g. delaunay)
store the line start/end when intersecting with a plane, compare these results to the known "bad" verts and ignore if present
Issues like this arise, and can be dangerous in a milling context. Ideally, overhangs would be ignored in this context. The issue is finding a performant way to test what is an overhang vs what is not.
Potential solution: raytrace from "suspect" verts up to the stock.max.z. Count the number of intersections, if > 0 this vert is contributing to an overhung feature.
Once we have collected all of the invalid verts, then we need to safely remove them from the clipping process.
Potential solutions:
where the geometry looks like: