Repository navigation
Weldments: end a post flat under two mitred rails in one corner (frame.corner, #4003) - #16756
khanahmad4527 wants to merge 14 commits into
Conversation
… onto main) The eleven commits of tangency-labs#5312 (head 015e7a5) squashed onto current main, so the frame corners can build on them. Karl's code is unchanged except where main moved underneath it: - doc/eval_frame.rs: main's `layout()` (tangency-labs#15726, `locate` and the profile origin) folded into tangency-labs#5312's `Layout`/`Laid`; `member_section` (End Cap, tangency-labs#8606) now reads the member from that layout, before any trim. - doc/eval.rs, doc/model_cache.rs: main's `construct` key and thread runs kept beside `frame_members`. - engine/schema/frame.rs: tangency-labs#5312's trim contract appended to main's frame contracts (tangency-labs#12500); its schema test joins main's test file. - engine/cmd/frame.rs, ui-egui dialogs, workspace, docs/frames.md: End Cap and Trim/Extend side by side. - `resolve_plane_in` takes the component; `Traced` has a `recipe`; `crate::i18n::{tr, format}` became `solidcraft_ui_text::{tr, format}`; the Trim/Extend icon master moved to crates/look/icons with main. Co-Authored-By: Łukasz Dłucik <lukasz.dlucik@abastran.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Sponsored-by: ABASTRAN (https://abastran.com)
frame.corner joins two frame members that meet at their ends: both are rebuilt from their line and profile with the end at the corner cut on the plane halfway between them, the cut faces `gap` apart. It builds on the Trim/Extend member records (find, build, and a replace helper now shared with frame.trim), so corners and trims see each member as it now is. Refused with the reason: not two members, one member twice, parallel members, middle lines that pass apart or cross away from a member's ends, an unknown kind, a gap outside 0..1 m, and members changed later. Tests from hand calculation: a 600 x 400 frame (45 deg cuts, volume from the section area, no overlap left, gap shortening by gap / sqrt 2), a 60 deg corner (60 deg cuts, outer edge 22.5 sqrt 3 past the corner, gap 4 moving each end by 4), width parameter edits, extension, undo/reopen and hostile parameters. Analytic reference case 97-frame-mitre. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Sponsored-by: ABASTRAN (https://abastran.com)
…labs#8452) frame.corner checked that the middle lines cross within the profile's diagonal of each member's end. A profile anchored off its middle moves that crossing by up to (|ob| + |cos θ|·|oa|) / sin θ, which grows as the angle closes: two 45 bars on their inner edges 30° apart meet 22.5 · cot 15° = 83.971 past their lines' ends, and were refused. The check now takes the anchors' move out first, using the exact crossing of the offset lines (derived in a comment at the check), and then requires each line's end within its profile's size of where the lines meet, so a T is still refused. All four end pairs are tried and the nearest taken, since at sharp angles the corner can lie nearer a member's far end. Tests from hand calculation: 15°, 30° and 60° corners of 200 long bars on bottom_left (cut 90° − θ/2 from square, outer edge 45 · cot(θ/2) past the corner, volume 2025 × (200 + 22.5 · cot(θ/2)) each), and an acute T still refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Sponsored-by: ABASTRAN (https://abastran.com)
Register frame_corner in main's feature-kind mappings (kind_key and the type-name lookup), as 9b9bb569c does for frame_trim, and keep BAR45 for the corner tests now that the trim tests that defined it became table driven engine tests in tangency-labs#5312. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Sponsored-by: ABASTRAN (https://abastran.com)
…ngency-labs#4003) frame.corner takes an optional third member. The first two are mitred to each other exactly as before; the third (a post, such as the leg under two rails) ends flat against them, on the plane parallel to the rails' plane at the far side of their sections from it, `gap` back. With rails of two sizes it stops at the deeper one, so it overlaps neither. Each end keeps one cut plane: the post is found, rebuilt and put back with find, build and replace, and MemberRecord does not change. Refused with the reason: a post in the rails' plane, a post whose line does not end at the corner (one standing on a rail, or running through), more than three members, and a member given twice. Tests from hand calculation, 45 x 45 bar: a post down from the corner ends at z = -22.5 (2025 x 177.5) and the three joined keep 1,169,437.5; a post up with gap 2 ends at z = 24.5 (2025 x 175.5) and each rail keeps 2025 x (200 - sqrt 2); a leg splayed 30 deg is cut 30 deg from square and keeps 2025 x (200 - 22.5 / cos 30), and 25.5 / cos 30 with gap 3. Analytic reference case 98-frame-table-corners: the 97 frame on four 700 legs.
Pre-merge checks:
|
|
@khanahmad4527, a heads-up: #16684 had a conflict with Old head e3260ca, new head 5f7609f. To move your branch: Frame tests (doc 42, engine 187, ui 146) and the reference cases 96-frame-tower and 97-frame-mitre pass on the new head. |
# Conflicts: # crates/doc/src/eval.rs # crates/doc/src/lib.rs # crates/doc/src/model_cache.rs # crates/engine/src/cmd/component.rs # crates/ui-egui/src/dialogs.rs
|
Merged
Re-run on |
The eleven commits of tangency-labs#5312 (head 015e7a5) squashed onto current main, so the frame corners can build on them. Karl's code is unchanged except where main moved underneath it: - doc/eval_frame.rs: main's `layout()` (tangency-labs#15726, `locate` and the profile origin) folded into tangency-labs#5312's `Layout`/`Laid`; `member_section` (End Cap, tangency-labs#8606) now reads the member from that layout, before any trim. - doc/eval.rs, doc/model_cache.rs: main's `construct` key and thread runs kept beside `frame_members`. - engine/schema/frame.rs: tangency-labs#5312's trim contract appended to main's frame contracts (tangency-labs#12500); its schema test joins main's test file. - engine/cmd/frame.rs, ui-egui dialogs, workspace, docs/frames.md: End Cap and Trim/Extend side by side. - `resolve_plane_in` takes the component; `Traced` has a `recipe`; `crate::i18n::{tr, format}` became `solidcraft_ui_text::{tr, format}`; the Trim/Extend icon master moved to crates/look/icons with main. Co-Authored-By: Łukasz Dłucik <lukasz.dlucik@abastran.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Sponsored-by: ABASTRAN (https://abastran.com) Signed-off-by: Karl Von Richter<karl@embeint.com>
End Cap (tangency-labs#8606) handles its picked faces in four places that Trim/Extend's face targets also need. Without these, a copied or pasted trim, or a trim whose target face's occurrence moves or whose body is renamed, keeps trimming to the old face: - clipboard.rs: a pasted trim's plane targets are checked and remapped. - component_clone.rs: a copied component's trim follows the copied face, and a notice names members and faces it keeps outside the copy. - browser.rs: renaming the target body renames the face anchor. - eval.rs: the placement digest reads a face target's occurrence, so moving it trims again. End Cap reads a trimmed member's length: `member_section` measures it between the member's ends as trims left them, along the middle of the section, not the length its line first laid out. An inward cap longer than the trimmed member is refused. Tests in the existing engine frame tests: an end cap on a trimmed end, an occurrence move against a rebuild from scratch, and a pasted trim. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Karl Von Richter<karl@embeint.com>
SolidCraft computes no geometry (skills/solidcraft-layers, solidcore docs/layers.md §1), so the trim maths moves out of crates/doc: - solidcore `prism::member` (kernel): a member's middle line and where its ends cross it, the extrusion range with its refusals (wrong way, too far, ends cross), a trim to a plane and a butt joint against a side of another member. It reuses the kernel's line/plane and closest-point helpers. Closed-form tests join prism/tests.rs. - solidcore-ops `frame_trim`: the workflow. It converts the record types, takes the targets in turn, keeps the end each one moves, and refuses two targets moving one end or none meeting the member. Each cut comes back as a point and a unit normal, so the document builds the saved end plane with `Plane::from_normal`, as before. - crates/doc `eval_frame.rs`: `Layout`/`Laid` hold the kernel's member; `Laid::axis` and `build` delegate to ops, and the refusals keep their wording and order. End Cap's `member_section` reads the length from the same axis. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Karl Von Richter<karl@embeint.com>
Reuse the cross-design wire and constraint placement code for same-design timeline pastes. Copied members now move with their copied trim targets, while the originals keep their geometry. Keep placed construction-plane targets as exact references when reopening the trim dialog. Cover placement preservation in the existing dialog test and handle the construction-plane field added on main. Signed-off-by: Karl Von Richter<karl@embeint.com>
Carry frame member records through ModelState::with_bodies and initialize the half-space trim tool without additional cap aliases, preserving its original face role. Complete the fields introduced by the main integration without changing trim geometry. Register the existing frame_trim tests in the consolidated ops integration harness so the trim cases and registration checker are selected by the scoped validation. Signed-off-by: Karl Von Richter<karl@embeint.com>
Exercise the integration of upstream Rotate Member with Trim/Extend on an off-centre 40 x 20 rectangular member. Check hand-derived retained bounds, end plane, profile-centre pivot and end cap both before and after reopening the document. This regression accompanies the conflict repair onto pinned main b44d58b. It is source-reviewed and remains unexecuted; no new-tree compilation or runtime validation is claimed. Signed-off-by: Karl Von Richter<karl@embeint.com>
…hree Karl rebased tangency-labs#5312 onto current main and moved the trim maths into solidcore (frame_trim). The corner code now reads the new layout API: each member's direction and length come from Laid.member, its middle line from laid.axis(&ends), and the line's start is kept on Laid so an off-centre or rotated section still finds its corner. The section box (lo, hi) stays on Layout for the corner and post sizes; MIN_CROSSING is a local constant again since the old trim helpers left this file.
|
Merged #5312's latest head into this branch (merge commit What changed to fit:
Checked on Linux:
|
|
Since #17855 (automatic frame corners) merged, {"commands": [
{"command": "sketch.create", "params": {"plane": "XY", "name": "Rails"}},
{"command": "sketch.line", "params": {"points": [[0, 0], [200, 0]]}},
{"command": "sketch.line", "params": {"points": [[0, 0], [0, 200]]}},
{"command": "sketch.finish", "params": {}},
{"command": "frame.member", "params": {"sketch": "Rails", "profile": {"kind": "bar", "width": 45, "height": 45}, "corner": "mitre", "body_name": "Rail"}},
{"command": "sketch.create", "params": {"plane": "XZ", "name": "Post"}},
{"command": "sketch.line", "params": {"points": [[0, 0], [0, 200]]}},
{"command": "sketch.finish", "params": {}},
{"command": "frame.member", "params": {"sketch": "Post", "profile": {"kind": "bar", "width": 45, "height": 45}, "corner": "mitre", "fit_ends": true, "body_name": "Post"}}
]}
(Headless render, So this PR no longer adds anything, and its |
|
Checked again on the 0.50.0 release ( Same 45 × 45 bar; two rails along +X and +Y, 200 long, Corner Type Mitre; the post as a second Frame Member with Fit Ends to Earlier Frames (one Frame Member over a 3D sketch of all three lines gives the same numbers).
(Headless render, |


Part of #4003. Draft: stacked on #16684, which is itself a draft.
Stacked on #16684 (two-member mitre corners), which carries #5312 (Trim/Extend) as its bottom commit. This branch includes those four commits unchanged until they land. This PR's own change is only the top commit (
3889bcf51). To review only that part, rungit diff e3260caac 3889bcf51. When #16684 is rebased or lands, this branch gets a plain rebase. The design was posted in #4003 before the code (#4003 (comment)).Changes a default: no
Change
Frame members (structural steel laid along sketch lines, #4003) overlap where they meet at a corner. #16684 adds
frame.corner, which mitres two members that meet at their ends. A common corner has three members: two rails and the post or leg under them, as at the top corner of a table frame. Until now the post still overlapped the rails there.frame.cornernow takes an optional third member, the post:{"command": "frame.corner", "params": {"members": ["Rail", "Rail (2)", "Leg"], "gap": "2 mm"}}gapback from that side. If the rails are different sizes, the post stops at the deeper rail, so it overlaps neither rail.{feature, line}, rebuilt with one end moved to a plane (build), and put back with the sharedreplacehelper. Each end still has one cut plane, soMemberRecorddoes not change.frame.trimfeatures. A three-way mitre, where each end is cut by two planes, would need two planes per end inMemberRecord. It can come later as its ownkind.CornerParamsschema (membersnow takes 2 to 3 items) and adocs/frames.mdsubsection. There is no dialog yet, as in Weldments: mitre two frame members at a corner (frame.corner, #4003) #16684.crates/doc/src/format/pending/frame-corner-posts.rs. No kernel files and no dependencies change.bad_corners_are_refused_with_the_reason, three members were a refusal and are now a valid corner, so that case now lists four members. Inschemas_cover_corner_parameters_and_results, three members move from the "refused" list to the "accepted" list, and four members are now the refused case.Validation
Every expected value is a hand calculation. No value is measured from a kernel or another program. All cases use 45 × 45 bar (area 2025 mm²) on lines through the bars' middles. Rails run along +X and +Y, 200 long from the origin.
timeline.redefinesets gap 3, the leg keeps 2025 × (200 − 25.5 / cos 30°).tests/oracle/98-frame-table-corners. It is the 600 × 400 frame of97-frame-mitreon four 700 legs, with each corner one three-member corner and a 2 mm gap. Each leg is a 675.5 box: V = 2025 (2000 − 8 √2) + 4 × 2025 × 675.5 = 9,498,639.74 mm³, 12 bodies. Expected values come fromtools/oracle-analytic/cases_frames.py.Run on this branch (
3889bcf51), macOS 26 (arm64):cargo test -p solidcraft-engine --lib -- frame schema: 874 passed, 0 failed, 1 ignored. Among them are the 4 new tests and all 10 corner tests from Weldments: mitre two frame members at a corner (frame.corner, #4003) #16684.cargo test -p solidcraft-doc --lib -- frame format feature_walk: 128 passed, 0 failed.cargo clippy -p solidcraft-doc -p solidcraft-engine --all-targets -- -D warnings: clean.solidcraft-cli oracle:98-frame-table-cornersPASS,97-frame-mitrePASS.cargo xtask fmt --check,cargo xtask lists,cargo xtask skillsandscripts/test-format-pending.sh: pass.cargo xtask cion this machine (a fanless laptop). The UI, wasm and full test steps are left to CI.Screenshots of the behavior
These are from
solidcraft-cli snapshot, with 40 × 40 × 3 tube rails and a post 300 long.Before: the post and both rails overlap at the corner.
After:
frame.cornerwithmembers: [Rail, Rail (2), Leg]and gap 2. The rails are mitred and the leg ends flat 2 below them.A leg splayed 30° from vertical, cut at a slant under the rails:
The reference case
98-frame-table-corners: four three-member corners.Integration status
Checked 2026-11-20: this branch now sits on #5312's head
9271de877(merged, no rebase), with #16684's corner commits on top. #16684 and #5312 are open.Test change: this PR is stacked on #5312 and #16684, so its diff against
mainincludes their kernel and test changes. The only existing line this branch itself changes incrates/engine/src/schema/frame_tests.rsis theuselist, which gainsCornerParamsfor the new corner tests; no expectation changed.