Profiling the cutout pre-pass on real round-part jobs put ~97% of its time in
the frame-wall NestLayoutCheck.Clears inside CutoutCirclePacker.Fill. Ear-clipped
round frames make every perimeter/insert triangle pair overlap, so a clear pair
runs hole subtraction for every pair. The same question repeats for every frame
angle and repeated frame instance, because Automatic inserts get identical
frame-local poses.
- CutoutMemo, one per Prepare, replays geometry reads, circle items and Clears
answers. Keys hold geometry by reference, pose bit patterns, argument order
and spacing. It is threaded through CutoutCirclePacker.Fill and the router's
round-only path.
- TriangulatedRegion.SubtractAllHoles measures each piece's bounds once, skips
holes and hole triangles that no piece reaches, and ping-pongs the remainder
between scratch buffers instead of copying it into pooled ones. Clip
arithmetic and order are unchanged.
Bundles are byte-identical on 14 real and 10 synthetic ring jobs. Pre-pass time
over the real set drops from 99.6 s to 10.1 s (N0414-02 35.8 s -> 0.6 s).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>