Skip to content

Bin editor features#2

Merged
SkyeRangerDelta merged 6 commits into
mainfrom
bin-editor-features
Jun 16, 2026
Merged

Bin editor features#2
SkyeRangerDelta merged 6 commits into
mainfrom
bin-editor-features

Conversation

@SkyeRangerDelta

Copy link
Copy Markdown
Owner

This pull request introduces support for multi-level (variable-depth) tool pockets, per-tool spacing overrides, and improved geometry handling for tool placement and bin generation. The changes add new schema fields, update API endpoints, and refactor geometry transformation logic to enable more flexible and precise tool pocket modeling.

Multi-level tool pocket support:

  • Added new models and serialization for multi-level tool pockets: ToolLevel, ToolLevelPart, and associated fields in Tool and ScaledPolygon. Tools can now define variable-depth pockets, and these are transformed appropriately when placed in bins. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

  • The STL generator now hashes and processes tool levels to ensure cache invalidation when pocket depths change, and passes level geometry to the STL generation pipeline. [1] [2] [3]

Per-tool spacing override and bin spacing:

  • Added spacing_override to the Tool model and related request/response schemas, allowing individual tools to specify custom keep-out spacing. [1] [2] [3] [4] [5]
  • Added a tool_spacing field to BinParams with validation, enabling bins to specify a default spacing between tool cutouts. [1] [2]
  • Added resolve_spacing function to prefer per-tool spacing over bin default when arranging tools.

Geometry transformation and placement refactor:

  • Refactored geometry transformation logic for placed tools and multi-level pockets by introducing _placement_transform and placed_levels functions, ensuring consistent and reusable mapping from library tool space to bin space. [1] [2] [3]
  • Updated sync_placed_tools to use the new transformation logic for points, finger holes, and interior rings.

API and schema updates:

  • Updated tool creation and update endpoints to handle new levels and spacing fields, and to propagate these through the tool lifecycle. [1] [2] [3] [4]
  • Updated tool list responses to include new fields.

Polygon scaling and clearance:

  • Refactored PolygonScaler to support multi-level pockets and improved clearance handling, including a new _buffer_rings helper for geometry buffering.

These changes lay the groundwork for advanced pocket modeling and more flexible bin layouts, improving both the user experience and the robustness of geometry processing.

SkyeRangerDelta and others added 6 commits June 12, 2026 15:45
Adds a keep-out air gap concept for tools that overhang their cutout
(e.g. C7 bulbs with a 15mm base and 21.5mm flare). Spacing is resolved
like clearance (tool override wins over the bin default) but never
changes pocket geometry -- the frontend arranger consumes it.

ToolSummary now exposes clearance_override and spacing_override so the
bin page can resolve per-tool padding.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The packer now pads each tool individually with clearance + spacing +
web/2 (per side), so tools that overhang their cutout get room. The
bin canvas draws a dashed keep-out halo around placements whose
resolved spacing is non-zero, and the bin configurator gains a Tool
Spacing slider. The shape designer exposes the per-tool spacing
override next to the clearance override.

Adds the first packing.ts test suite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Each add-shape in a parametric tool may carry a depth (mm from the bin
top). compile_shapes groups adds by depth, carves every subtract out of
every level, and materializes Tool.levels alongside the unchanged
footprint. At generate time the levels are transformed into bin space
with the same centroid+rotation math sync_placed_tools uses (placements
stay level-free), clearance/simplify apply per level part, and the
generator cuts one top-opening prism per part -- a stepped pocket with
no overhangs by construction.

An explicit level depth is absolute; the default-depth group still
honours the placement depth override. The chamfer clamp now uses the
shallowest resolved level, generate re-syncs placements before cutting,
and the STL cache hash includes tool levels so depth-only edits
invalidate it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add-shapes gain a nullable Depth input (placeholder = bin default) and
a depth badge in the shape list; depth is cleared when a shape stops
being a solid. The canvas overlays each depth shape with a darkness
proportional to its depth (masked by the boolean preview so holes stay
unpainted) plus an Nmm label.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tool selection now holds a list: shift/ctrl-click toggles tools in and
out, dragging on empty canvas rubber-band selects everything the
marquee touches, and dragging any selected tool moves the whole group
(snap and axis-lock anchor on the grabbed tool, relative layout
preserved). Multi-selections render a dashed bbox per tool and the
toolbar shows a count with a group Remove; rotate, depth, and smooth
controls remain single-selection.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@SkyeRangerDelta SkyeRangerDelta merged commit 7cd0a52 into main Jun 16, 2026
3 checks passed
@SkyeRangerDelta SkyeRangerDelta deleted the bin-editor-features branch June 16, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant