Repository navigation
Conversation
A sheet with hundreds of cut-outs was refused by the flat budget: every cut-out went through one boolean with the material, the material union ran as one boolean of every region, and faces() compared every edge pair. A tray with 96 logos of 32 edges cut through its flat was refused. A cut-out whose box meets no other cut-out and no material edge, and whose outline is a plain closed loop, now becomes a hole directly. The material union clusters regions by box overlap (a sweep over sorted boxes) and unions each cluster on its own. faces() finds corners and shared edges through a grid and an edge-start hash instead of scanning all pairs. The cut's work for reading its regions is charged per tool, not per face of the tools: a sketch of hundreds of logos is one tool with a face per edge. Every step still charges the flat budget, so hostile inputs stay bounded. Measured on a 1200x600 tray with four folds (release build): 96 logos of 32 edges cut in the flat now build in 2.8 s and 216 in 10.6 s; both were refused before. 200 round holes build as before (3.2 s), with the same faces, edges and volume. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NOWN-DEV
added a commit
to NOWN-DEV/solidcraft
that referenced
this pull request
Oct 30, 2026
NOWN-DEV
added a commit
to NOWN-DEV/solidcraft
that referenced
this pull request
Oct 31, 2026
Contributor
Author
|
Superseded by #10356: the same change, plus the shortcut for a flat cut's tool clear of the panel outline with its engine test, and checks that keep degenerate cut-outs on the booleans. Closing this one in its favour. |
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.
Change
Cutting many shapes through an unfolded sheet was refused with "sheet metal flat geometry exceeds the bounded processing budget". A 1200 × 600 tray with 96 logos of 32 edges cut through its flat was refused. The flat spent its budget in three places:
faces()compared every edge pair.Now (
crates/doc/src/sheet.rs):faces()finds corners and shared edges through a grid and an edge-start hash instead of scanning every pair.Every step still charges the flat work budget, so hostile input stays bounded.
box_slackis the box growth thatloop_boxalready used inline, now shared.In
eval_more.rs(sheet_prism_cut), the work charged for reading a cut's regions is now counted per tool and text item instead of per face of the tools. A sketch of hundreds of logos is one tool with a face per edge, so the old count refused it before anything was cut.Changes a default: no
Validation
New tests in
sheet.rs:cut_outs_apart_skip_the_booleanssorts cut-outs into free ones and the rest.a_sheet_of_thousands_of_cut_outs_stays_within_its_budgetputs 1,600 squares (6,400 edges) on a 1000 × 500 plate with a flange. The case was refused before. Now the flat loses exactly their area, has 1,600 holes, and has a wall face for every edge.Timing, from a generic repro made with public commands (
repro_gen.pybelow):inspect.measureruns.python3 repro_gen.py NX NY NSEG out.json, thensolidcraft-cli run out.json --results --quiet. Releasesolidcraft-clifrommainae47ed3 and the same with this change, Linux x86_64 with 4 cores, load 1.7–3.2, wall time:main20 10 0), 3 alternated runs8 12 32), 3 alternated runs12 18 32)The 200-hole tray, which
mainbuilds, comes out the same. It has the same 246 faces, 500 edges and 456 vertices, and the same volume and area, which differ only in the 14th digit. A render of it frommainand from this branch is the same pixel for pixel. On the logo trays, the measured volume is the plate's minus exactly n × the logo area × 1.5 mm. The faces are 46 + 32 per logo (3,118 and 6,958).What this PR does not lift: round holes count by their chords in the flat budget, so 800 round holes (
40 20 0) are still refused with or without this change. Lifting that touches the planar boolean's check incrates/kernel, which waits for the kernel decision.Checks on the head c6a9fa7:
cargo fmt --all --check: clean.cargo clippy -p solidcraft-doc -p solidcraft-engine --all-targets -- -D warnings: clean.cargo test -p solidcraft-doc --lib: 485 passed, 1 ignored.cargo test -p solidcraft-engine --lib -- cmd::sheet: 210 passed, 1 ignored.cargo test -p solidcraft-engine --lib naming: 53 passed.repro_gen.py
Screenshots of the behavior (when observable)
The 96-logo tray (
8 12 32) built with this change. Onmain, the cut is refused (step 104 (solid.extrude): sheet metal flat geometry exceeds the bounded processing budget) and there is no tray to show.Integration status
One commit, c6a9fa7, on
mainae47ed3 (checked 2026-10-29 06:18 UTC). There are no conflicts, and no open PR changes these flat functions; I looked at #8397, #8346 and #8326, the open sheet-metal PRs.Generated by Claude Code