mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-06 18:32:11 -04:00
Every lead was checked against every placed part's material and every rapid against every completed contour, so each check cost O(parts) and planning a plate cost O(parts^2). Lead checks were 88% of planning time on a 144-part grid. LeadMaterialSnapshot and each completed contour now keep a conservative extent (an arc counts as its whole supporting circle). A lead or rapid skips material or a contour only when the extents are farther apart than 1e-6 x (1 + coordinate size), far above the contact tolerance, so results are unchanged: anything touching or closer still gets the full native check. The rapid filter also applies to pre-post verification, which shares ReleasedContourState. New tests cover the cases just inside the skip: an arc lead and a completed arc whose bulge reaches past their endpoints, and a lead and a rapid that only touch another part's extent.