mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-05 18:52:11 -04:00
CutoutLatticeFill fills one closed cutout of a frame part with copies of one part, the first piece of the cutouts-first pass. It runs Default Fill over the cutout's bounds plus one part step on every side, shifts the lattice over a (2n+1)^2 grid of offsets up to half a step each way, and at each offset keeps the copies whose reference point lies in the part's inner-fit region of the inscribed cutout (part circumscribed and grown by the spacing). The offset keeping the most copies wins; every returned pose is then certified with NestLayoutCheck.Clears against the frame and the other copies. 20" ring, 10" round cutout, 1" squares, 0.25" spacing: 37 copies, against 25 for a block sized to the inscribed rectangle and 32 for the unshifted lattice. Not wired into any engine or pipeline: parts inside cutouts wait on containment-aware cutting order. Fill can still return different, equally scored lattices between calls for some parts, so identical results are not yet claimed.