Skip to content

Revolve and other model-axis commands: an edge picked on a moved component is the edge at the pick (#20492) - #21886

Merged
tangency-repo-manager[bot] merged 3 commits into
tangency-labs:mainfrom
steffenl1:fix-20492
Nov 25, 2026
Merged

tangency-repo-manager[bot] merged 3 commits into
tangency-labs:mainfrom
steffenl1:fix-20492

Conversation

@steffenl1

@steffenl1 steffenl1 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steffen · project thread

Change

When Revolve, Surface Revolve, Circular Pattern, Plane at Angle or a Move's turn takes its axis as a model edge or round face picked by a point ({"edge": [x, y, z]} or {"face": …}), the axis is now the edge at that point, also on a component moved away from its definition.

Before this change, model_axis_param (crates/engine/src/cmd/construct.rs) named the pick in the unplaced model state (s.model.state()), then looked that name up in the world state. That's where the command finds the axis, and where evaluation finds it again for the root (construction_state). On a moved component, the unplaced and placed states disagree. Another body's unplaced edge can pass through the picked point while no placed one does, and the name then resolved to the first edge with that name, far from the pick. In the test below, the Revolve turned about B's placed edge 100 mm away instead of A's edge under the pick.

The pick is now named in the world state it is resolved in (geo_in with s.world_state()). Without components (no occurrences), the world state is the model state, so nothing changes there.

Relation to #18729 (merged 25 Nov): it fixed the same problem for Coil, with its own Coil branch in model_axis_param and the geo_in helper. This PR now uses that same geo_in with the world state for the other model-axis commands, and leaves the Coil branch as it is.

Changes a default: no

Validation

  • New test an_axis_picked_on_a_moved_component_is_the_edge_at_the_pick in crates/engine/src/cmd/model_axis_tests.rs: two components, A moved 50 along X and B (whose box starts 50 along X) moved 100, so B's unmoved box is where A's moved one is. A Revolve about the edge picked on A turns a 2 × 1 section 5 mm from it (volume 2π · 5 · 2), and a Circular Pattern about the same pick turns a cube onto the other side of A's edge. On main it fails: turned about A's edge at x = 50, not B's: 1193.8 (2π · 95 · 2, about B's edge). It passes with this change. All 11 model-axis tests pass.
  • cargo xtask fast --base upstream/main (Windows 11): rustfmt, lists, skills, layers, ui-containers, mesh-decisions and workspace clippy -D warnings pass. Its solidcraft-engine test run: 7493 passed and 12 failed. All 12 fail the same way on main d7a685d here (booleans, fillets, drawing dimensions, loft and face-area tests on this Windows machine), so none come from this change.

Integration status

Branched from upstream main d7a685d; main 76270f2 (with #18729) merged in, with the conflict in model_axis_param resolved as above. After the merge, the model-axis and Coil tests (38) pass, and cargo clippy -p solidcraft-engine --all-targets -- -D warnings and cargo fmt --check are clean.

Fixes #20492

🤖 Generated with Claude Code

https://claude.ai/code/session_01QNSyrJV6yS5nwdV6RpFx7W

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNSyrJV6yS5nwdV6RpFx7W
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Model-axis reference conversion and calculation now use the same world-state snapshot. A regression test checks revolve and circular-pattern behavior when moved components have coincident edges at the pick location.

Changes: Model axis pick resolution

Layer / File(s) Summary
Resolve picked axes against one snapshot
crates/engine/src/cmd/construct.rs, crates/engine/src/cmd/model_axis_tests.rs
model_axis_param uses one world-state snapshot to resolve the picked geometry and calculate the axis. The test checks that revolve and circular pattern use the edge at the picked location.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: Minimal · up to f1c4b

Model-axis commands now pick the edge at the clicked world point on moved components, and behavior without components is unchanged. The review found no remaining merge-blocking risk, and a regression test covers the change.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the change: model-axis commands (Revolve and others) now use the edge at the picked point when the pick is on a moved component. It is specific and matches the changeset (construct.rs …
Linked Issues check Passed Issue #20492 requires that a model-axis edge pick ({"edge": [x,y,z]} or {"face": …}) resolve to the edge at the picked world point, including on moved components. At head f1c4b4d, `model_axis_par…
Out of Scope Changes check Passed All changes are in crates/engine/src/cmd/construct.rs (the model_axis_param and geo/geo_in reference path) and crates/engine/src/cmd/model_axis_tests.rs (one new test). The helper change is …
Description check Passed The description covers the change clearly. It explains the bug in model_axis_param (naming the pick in the unplaced model state, then resolving it in the world state), the fix (naming the pick in the …
Existing Defaults Unchanged Passed The check fails only if the PR changes a UX default: a default setting or preference value, the usual-use behaviour of a command, the UI's default layout or behaviour, or a shortcut. It passes for ker…
Full details: Title check

Explanation

The title names the change: model-axis commands (Revolve and others) now use the edge at the picked point when the pick is on a moved component. It is specific and matches the changeset (construct.rs model_axis_param and geo_in, plus a regression test) and the linked issue #20492. It is a little long at 107 characters, but it is clear.

Full details: Linked Issues check

Explanation

Issue #20492 requires that a model-axis edge pick ({"edge": [x,y,z]} or {"face": …}) resolve to the edge at the picked world point, including on moved components. At head f1c4b4d, model_axis_param in crates/engine/src/cmd/construct.rs now takes one s.world_state() snapshot, names the pick in that state through the new geo_in helper, and resolves the axis in the same snapshot. This matches the issue's first accepted fix (name the pick in the resolving state). geo keeps s.model.state() for its other callers, so their behavior does not change. model_axis_param is the shared axis path for the listed model-axis commands. The regression test an_axis_picked_on_a_moved_component_is_the_edge_at_the_pick in crates/engine/src/cmd/model_axis_tests.rs covers the two-moved-component case the issue asks for, with a Revolve and a Circular Pattern. I did not run the test. Its pass/fail status rests on the author's report. Coil is not in this base, and the PR leaves #18729's Coil branch to that PR, as the issue scopes it.

Full details: Out of Scope Changes check

Explanation

All changes are in crates/engine/src/cmd/construct.rs (the model_axis_param and geo/geo_in reference path) and crates/engine/src/cmd/model_axis_tests.rs (one new test). The helper change is the fix for #20492. The test supports that fix. No unrelated code changed. The PR description notes expected merge overlap with #18729 in model_axis_param and geo, which is a integration concern and not a scope issue.

Full details: Description check

Explanation

The description covers the change clearly. It explains the bug in model_axis_param (naming the pick in the unplaced model state, then resolving it in the world state), the fix (naming the pick in the world state via geo_in), and the relation to #18729 and the Coil branch. It states the change does not alter defaults, and includes a Validation section with the new test, the failure on main, and the pass result, plus the fast-check run and the 12 pre-existing Windows failures. It links issue #20492. Gaps against the template: the Change section does not open with a plain-language statement of what the tool is or who it is for, the title is not a template item in the body, and there is no screenshot or video. The template says screenshots are needed for observable behavior, but this is a kernel axis-resolution fix that the test exercises, so the omission is reasonable. The Integration status section is present and records the upstream commit, the merged main commit, the conflict resolution, and post-merge validation. Overall the description is mostly complete.

Full details: Existing Defaults Unchanged

Explanation

The check fails only if the PR changes a UX default: a default setting or preference value, the usual-use behaviour of a command, the UI's default layout or behaviour, or a shortcut. It passes for kernel or geometry result changes. Evidence: - The PR changes model_axis_param and geo/geo_in in crates/engine/src/cmd/construct.rs (+12/-4, per the summary). model_axis_param now names an edge or face pick in the world state (s.world_state()) rather than the unplaced model state. geo still passes s.model.state(), so ordinary references are unchanged. I read the current code at those lines and found no settings, preferences, shortcuts, layout, or default-value edits. - The only user-visible effect is which edge a model-axis command (Revolve, Surface Revolve, Circular Pattern, Plane at Angle, Move turn) uses on a moved component. That is a geometry result (the axis line and resulting volume). Per the check, a changed kernel or geometry result is not a changed default. - The PR description states Changes a default: no. The code does not contradict this. Without components, the world state equals the model state, so behaviour is unchanged. - Coil is untouched by this change. The solid.coil branch is preserved. No UX default is changed, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0f7f239 and f1c4b4d.

Files selected for processing: 2

  • crates/engine/src/cmd/construct.rs
  • crates/engine/src/cmd/model_axis_tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

…onent is the edge at the pick (tangency-labs#20492)

A model-axis command (Revolve, Surface Revolve, Circular Pattern, Plane at
Angle, a Move's turn) named an `{edge|face: [x,y,z]}` pick in the unplaced
model state, then looked the name up in the world state, where it finds
the axis now and on each evaluation. On a component moved away from its
definition another edge can pass through the picked point before the move,
so the axis could be that edge, far from the pick. The pick is now named
in the world state it is resolved in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNSyrJV6yS5nwdV6RpFx7W
@steffenl1
steffenl1 marked this pull request as ready for review November 25, 2026 03:52
# Conflicts:
#	crates/engine/src/cmd/construct.rs
@bherbruck bherbruck added approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green labels Nov 25, 2026
tangency-repo-manager Bot added a commit that referenced this pull request Nov 25, 2026
…n a moved component is the edge at the pick (#20492)
@tangency-repo-manager
tangency-repo-manager Bot merged commit c006a8a into tangency-labs:main Nov 25, 2026
119 of 123 checks passed
@steffenl1
steffenl1 deleted the fix-20492 branch November 25, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Axis picked as an edge point on a moved component can resolve to a different edge

2 participants