Skip to content

Insert is not trimmed when its pocket is clipped at the bin wall #267

Open

Description

@jasonmadigan

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

  1. 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.
  2. 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.
  • The insert follows the same boundary as the pockets, _interior_clip_rect, which Cutouts cut into the stacking lip and through the bin wall #265 extends to cutouts and chamfers.

Seen on main at a73e0e6 (0.11.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingscope:in-scopeFits the product constitution; eligible for prioritisation, not promised

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions