You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Insert is not trimmed when its pocket is clipped at the bin wall #267
Since #120 (the fix for #118), _make_polygon_cutouts in backend/app/services/stl_generator_manifold.py clips each tool outline to the bin interior (_interior_clip_rect) before cutting its pocket. generate_insert builds the insert from the same outlines without that clip and only shrinks them by Insert Fit, so when an outline runs past the interior the insert is larger than its pocket and will not drop in. Auto-size grid re-centres outlines and sizes the grid to fit them, so this needs it off.
Reproduction
Make a 2×1 bin, Height 3, stacking lip on, Clearance 1 mm, Auto-size grid off, Contrast Insert on with Insert Height 1 mm and Insert Fit 0.2 mm.
Place a 20 mm wide outline as below, generate, and measure the pocket and the insert STL.
Outline
Pocket
Insert
Insert area outside the pocket
60 × 20 mm, inside the bin
62.00 × 22.00 mm
61.60 × 21.60 mm
0
100 × 20 mm, both ends past the bin
78.30 × 22.00 mm
101.60 × 21.60 mm
503 mm²
60 × 20 mm, one end 6 mm past the grid edge
52.15 × 22.00 mm
61.60 × 21.60 mm
208 mm²
Expected
The insert follows the clipped pocket: the pocket less Insert Fit on every side.
Notes
Clipping the outlines in generate_insert with _clip_to_interior and _interior_clip_rect(config) before _shrink_rings gives 77.90 × 21.60 mm and 51.75 × 21.60 mm inserts for the last two rows, with nothing outside the pocket (tested by patching in memory). The clip has to sit outside the if fit_clearance > 0 branch, because Insert Fit 0 skips _shrink_rings.
Draft Shell Mode #215 adds this clip to generate_insert, with test_generate_insert_clipped_to_bin_interior.
Activity