Bin editor features#2
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inToolandScaledPolygon. 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:
spacing_overrideto theToolmodel and related request/response schemas, allowing individual tools to specify custom keep-out spacing. [1] [2] [3] [4] [5]tool_spacingfield toBinParamswith validation, enabling bins to specify a default spacing between tool cutouts. [1] [2]resolve_spacingfunction to prefer per-tool spacing over bin default when arranging tools.Geometry transformation and placement refactor:
_placement_transformandplaced_levelsfunctions, ensuring consistent and reusable mapping from library tool space to bin space. [1] [2] [3]sync_placed_toolsto use the new transformation logic for points, finger holes, and interior rings.API and schema updates:
Polygon scaling and clearance:
PolygonScalerto support multi-level pockets and improved clearance handling, including a new_buffer_ringshelper 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.