Skip to content

Frames: move turn_to_parallel and tapered_flange_ends across solidcore layers (#21397) - #21525

Merged
tangency-repo-manager[bot] merged 3 commits into
tangency-labs:mainfrom
brixtonpham:refactor/frames-solidcore-layers
Nov 25, 2026
Merged

tangency-repo-manager[bot] merged 3 commits into
tangency-labs:mainfrom
brixtonpham:refactor/frames-solidcore-layers

Conversation

@brixtonpham

@brixtonpham brixtonpham commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Change

Moves structural-frame-specific naming out of solidcore / solidcore-ops into SolidCraft's own frames profile module, and renames the general turn query to match the existing geometry query layer. Closes #21397 (part of #21392).

  • Moved solidcore::query::member_turn::{SquareTurnMeasure, measure_square_turn} into solidcore::query::edge_turn::{SquareTurnMeasure, turn_to_parallel} with domain-neutral docs and error op (query::edge_turn), and deleted solidcore/crates/solidcore/src/query/member_turn.rs.
  • Moved solidcore_ops::member_turn::{ParallelTurnError, parallel_turn} (and its unit test) into solidcore_ops::measure::{ParallelTurnError, turn_to_parallel}, deleted solidcore/crates/solidcore-ops/src/member_turn.rs, and re-exported turn_to_parallel / ParallelTurnError from crates/kernel/src/lib.rs for crates/engine/src/cmd/frame_rotate_member.rs.
  • Moved tapered_flange_ends out of solidcore::prism::profile (and its solidcore_ops::prism re-export) into crates/doc/src/frame.rs, and moved its unit test into crates/doc/src/frame_tests.rs.
  • Rotate Member produces the exact same turns through turn_to_parallel, and no kernel or ops name mentions a frame member or a flange.

Changes a default: no

Test change: moved a_tapered_flange_changes_by_half_its_length_times_the_slope_tangent from solidcore::prism::tests into crates/doc/src/frame_tests.rs alongside tapered_flange_ends (and moved parallel_turn_cases from solidcore_ops::member_turn::tests into solidcore_ops::measure::tests::turn_to_parallel_cases) per #21397; assertions and tolerance checks are unchanged.

Validation

  • cargo fmt --check (root workspace and solidcore/) — clean
  • (cd solidcore && cargo test -p solidcore -- edge_turn) — 2 passed, 0 failed
  • (cd solidcore && cargo test -p solidcore-ops -- turn_to_parallel) — 1 passed (measure::tests::turn_to_parallel_cases), 0 failed
  • (cd solidcore && cargo clippy -p solidcore -p solidcore-ops -- -D warnings -A clippy::needless_bool) — clean (the needless_bool allow only suppresses 11 pre-existing Rust 1.100 lints in untouched files)
  • cargo test --profile ci -p solidcraft-doc -- tapered_flange — 1 passed (frame::tests::a_tapered_flange_changes_by_half_its_length_times_the_slope_tangent), 0 failed
  • cargo test --profile ci -p solidcraft-engine -- rotate_member — 7 passed, 0 failed
  • cargo xtask layers — OK: 41 crates, no layering or solidcore seam violations.
  • cargo xtask app-geometry — no new ones

Screenshots of the behavior (when observable)

Internal API/layer refactor with no UI or observable geometry change; screenshots omitted.

Integration status

Summary by CodeRabbit

  • Bug Fixes
    • Improved member alignment calculations, including handling of geometry that cannot be aligned reliably.
    • Corrected tapered flange end-thickness calculations so the toe and root thicknesses reflect the specified slope and average thickness.
    • Added coverage for representative taper and alignment cases, including invalid inputs.

@brixtonpham
brixtonpham requested a review from a team as a code owner November 24, 2026 07:19
@brixtonpham
brixtonpham requested review from jyviko and removed request for a team November 24, 2026 07:19
@github-actions github-actions Bot added area:doc timeline, components, parameters, naming area:kernel B-rep kernel, booleans, blends, STEP/IGES labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The turn calculation moves from the member-turn modules to the edge-turn and measure APIs, and Rotate Member uses the new API. The tapered-flange calculation moves from Solidcore to a private helper in the frame documentation crate.

Changes: Parallel turn measurement

Layer / File(s) Summary
Edge-turn measurement
solidcore/crates/solidcore/src/query/edge_turn.rs, solidcore/crates/solidcore/src/query/member_turn.rs, solidcore/crates/solidcore/src/query.rs
edge_turn adds SquareTurnMeasure and turn_to_parallel. The member_turn query module is removed.
Measure API and validation
solidcore/crates/solidcore-ops/src/measure.rs, solidcore/crates/solidcore-ops/src/member_turn.rs, solidcore/crates/solidcore-ops/src/lib.rs
The measure module adds ParallelTurnError, turn_to_parallel, and tests for turn results and error cases. The member_turn ops module is removed.
Rotate Member API wiring
crates/kernel/src/lib.rs, crates/engine/src/cmd/frame_rotate_member.rs
The kernel re-exports the measure API. parallel_angle calls turn_to_parallel with the existing error mapping.

Frame tapered-flange calculation

Layer / File(s) Summary
Frame-local tapered-flange calculation
crates/doc/src/frame.rs, crates/doc/src/frame_tests.rs, solidcore/crates/solidcore/src/prism/profile.rs, solidcore/crates/solidcore-ops/src/prism.rs, solidcore/crates/solidcore/src/prism/tests.rs
The frame crate adds a private tapered-flange helper and a test. Solidcore removes the public helper, its re-export, and its former test.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: Minimal · previous review a5438

This is a refactor that moves frame-specific naming and a helper out of the kernel layers without changing behavior. No user-visible change or concrete merge risk was found.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names two real changes in the diff, the move of turn_to_parallel and the move of tapered_flange_ends across solidcore layers. It omits the rename of the member_turn query to edge_turn and th…
Description check Passed The description follows the template. It has a Change section that explains the move and the problem, a Changes a default line set to no, a Test change line with a reason, a Validation section with co…
Linked Issues check Passed Issue #21397 requires three things. (1) The turn query moves to query::edge_turn::turn_to_parallel. At head, solidcore/crates/solidcore/src/query/edge_turn.rs defines SquareTurnMeasure and `turn…
Out of Scope Changes check Passed Every changed file serves issue #21397. The kernel and ops files are renames, moves, and re-exports of the turn API, with the single call-site update in frame_rotate_member.rs. The crates/doc chan…
Existing Defaults Unchanged Passed The check asks whether the PR changes a user-facing UX default (settings, preferences, command behaviour in normal use, UI layout, shortcuts). Kernel or geometry changes under solidcore/ do not count.…
Full details: Title check

Explanation

The title names two real changes in the diff, the move of turn_to_parallel and the move of tapered_flange_ends across solidcore layers. It omits the rename of the member_turn query to edge_turn and the Rotate Member re-export, but it is specific and related to the main change.

Full details: Description check

Explanation

The description follows the template. It has a Change section that explains the move and the problem, a Changes a default line set to no, a Test change line with a reason, a Validation section with commands and results, a screenshots section that explains why they are omitted, and an Integration status section. The Change section names the issue and the moved APIs, but it does not explain in plain words who the tool is for. The Integration status section gives the base commit and diff stats, but it does not record the upstream PR status or the merge of main, which the template asks for.

Full details: Linked Issues check

Explanation

Issue #21397 requires three things. (1) The turn query moves to query::edge_turn::turn_to_parallel. At head, solidcore/crates/solidcore/src/query/edge_turn.rs defines SquareTurnMeasure and turn_to_parallel with domain-neutral docs and the query::edge_turn error op. Its logic matches the deleted query/member_turn.rs at merge base: the same finiteness check, unitization, normal_along_axis, line_off_axis folding, the 1e-9 and 1.0 - 1e-9 zero cases, and Vec3::square_turn. (2) Ops exposes solidcore_ops::measure::turn_to_parallel and ParallelTurnError. The kernel re-exports them in crates/kernel/src/lib.rs, and member_turn.rs is deleted (per the summary). I did not read the full ops function body, which the read truncated. Its equivalence to the old parallel_turn rests on the PR description, the summary, and the matching line counts. (3) tapered_flange_ends moves out of solidcore::prism::profile and solidcore_ops::prism into crates/doc/src/frame.rs, with its test in frame_tests.rs. The summary shows no remaining flange name in kernel or ops. Rotate Member (frame_rotate_member.rs) now calls turn_to_parallel. Tests for the moved code keep their assertions per the PR description and summary. The 'Done when' criterion is met by the reviewed code.

Full details: Out of Scope Changes check

Explanation

Every changed file serves issue #21397. The kernel and ops files are renames, moves, and re-exports of the turn API, with the single call-site update in frame_rotate_member.rs. The crates/doc changes move the tapered-flange helper and its test into the frames module, as the issue requires. The prism and query module edits only remove the moved items and their declarations. The moved tests keep their assertions, so no unrelated behavior change appears. The PR description and summary report no other changes.

Full details: Existing Defaults Unchanged

Explanation

The check asks whether the PR changes a user-facing UX default (settings, preferences, command behaviour in normal use, UI layout, shortcuts). Kernel or geometry changes under solidcore/ do not count. Evidence from the reviewed range (git diff --name-status over 13 files): - All changes are Rust refactors: renaming and moving member_turn::parallel_turn to measure::turn_to_parallel, moving query::member_turn to query::edge_turn, moving tapered_flange_ends into crates/doc/src/frame.rs, and updating the re-exports in crates/kernel/src/lib.rs. - crates/engine/src/cmd/frame_rotate_member.rs changes only the function it calls (parallel_turn to turn_to_parallel). Its error mapping and inputs are unchanged. - A search of the added lines for default, preference, shortcut, keybinding, config, or setting found no matches. - The PR description says Changes a default: no, and the code diff does not contradict it. No UX default is changed, and the PR is internal API refactoring. 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 fb8ef15 and a5438fa.

Files selected for processing: 13

  • crates/doc/src/frame.rs
  • crates/doc/src/frame_tests.rs
  • crates/engine/src/cmd/frame_rotate_member.rs
  • crates/kernel/src/lib.rs
  • solidcore/crates/solidcore-ops/src/lib.rs
  • solidcore/crates/solidcore-ops/src/measure.rs
  • solidcore/crates/solidcore-ops/src/member_turn.rs
  • solidcore/crates/solidcore-ops/src/prism.rs
  • solidcore/crates/solidcore/src/prism/profile.rs
  • solidcore/crates/solidcore/src/prism/tests.rs
  • solidcore/crates/solidcore/src/query.rs
  • solidcore/crates/solidcore/src/query/edge_turn.rs
  • solidcore/crates/solidcore/src/query/member_turn.rs
Files with no reviewable changes: 5

  • solidcore/crates/solidcore-ops/src/lib.rs
  • solidcore/crates/solidcore-ops/src/member_turn.rs
  • solidcore/crates/solidcore/src/prism/profile.rs
  • solidcore/crates/solidcore/src/query.rs
  • solidcore/crates/solidcore/src/query/member_turn.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.

@bherbruck

Copy link
Copy Markdown
Collaborator

This conflicts with main in crates/doc/src/frame.rs only: #5312 (weldment trim and extend) and #18895 changed it since. Keep main's changes and re-apply yours on top.

git fetch https://github.com/tangency-labs/solidcraft.git main
git merge FETCH_HEAD
# resolve, then
git add -A && git commit --no-edit && git push

…to refactor/frames-solidcore-layers

# Conflicts:
#	crates/doc/src/frame.rs
#	crates/kernel/src/lib.rs
#	solidcore/crates/solidcore-ops/src/lib.rs
@brixtonpham

Copy link
Copy Markdown
Contributor Author

Merged main (6627970e4), resolved the conflicts in crates/doc/src/frame.rs, crates/kernel/src/lib.rs, and solidcore/crates/solidcore-ops/src/lib.rs, and re-verified cargo fmt --check, solidcore/solidcore-ops/solidcraft-doc tests, cargo xtask layers, and cargo xtask app-geometry.

@tangency-repo-manager tangency-repo-manager Bot added the approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) label Nov 25, 2026
…core-layers

# Conflicts:
#	crates/kernel/src/lib.rs
@bherbruck bherbruck added the ready to merge reviewed, every ask addressed; merge once CI is green label Nov 25, 2026
tangency-repo-manager Bot added a commit that referenced this pull request Nov 25, 2026
@tangency-repo-manager
tangency-repo-manager Bot merged commit 8c4d079 into tangency-labs:main Nov 25, 2026
104 checks passed
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) area:doc timeline, components, parameters, naming area:kernel B-rep kernel, booleans, blends, STEP/IGES 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.

Frames: general names in solidcore, frame code in SolidCraft

2 participants