mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-29 00:11:06 -04:00
A direct CutOff.Regenerate(plate, settings) call with no perimeter cache argument trusted Part.BoundingBox plus a sub-epsilon roundoff allowance. A legitimately larger arc refit (ConvertProgram fitting an imported arc's center to its chord) can protrude past that cached box by more than the roundoff, so an uncached manual cutoff could emit a segment crossing the part's true converted material. Every production call site (Plate.RegenerateCutOffs, AutomaticCutOffPlanner, the desktop cutoff tools) already builds and passes a Plate.BuildPerimeterCache dictionary, so this only affects a direct/uncached caller. Extract the per-part conversion out of BuildPerimeterCache into Plate.BuildPartPerimeter and use it as a lazy, on-the-fly fallback in CutOff.ComputeSegments whenever no cache dictionary is supplied at all, so the uncached path gets the same conservative envelope as the cached one instead of silently trusting the bare bounding box. Cached behavior (including a cache's own explicit null entries from a failed conversion) is unchanged. OpenNest PM 13f7a685-0564-4cbf-8f46-a7805a0288a0.