Skip to content

Offset Face: a face the move leaves alone no longer refuses the move - #26289

Merged
tangency-repo-manager[bot] merged 1 commit into
tangency-labs:mainfrom
kaievns:fix/offset-face-points-moved-faces
Dec 4, 2026
Merged

tangency-repo-manager[bot] merged 1 commit into
tangency-labs:mainfrom
kaievns:fix/offset-face-points-moved-faces

Conversation

@kaievns

@kaievns kaievns commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Change

A face move pushes chosen faces of a solid in or out. Offset Face, Shell and Draft use it, and so does a modelled thread setting a hole's wall to the thread's size. Since 58a51d3, merged with Offset Face, Shell and Draft take the picked wall of a thin ring for offset face is applied to wrong face, a face move asks SMLib for a point inside every face of the body, then keeps the points of the faces it moves. So one face SMLib finds no point inside refuses the move of any other face.

A modelled thread with a face each turn (continuous_flanks: false) leaves such a face. Through an 11 mm plate, a second M4x0.7 Thread feature beside the first is refused while it sets its own hole's wall to size. The face SMLib can't place a point in belongs to the first thread, which the move never touches.

How it works now: Brep::face_points_of (crates/smlib/src/trim.rs) asks SMLib for points inside the given faces alone, through the same solidcore call. The face move (face_points in crates/kernel/src/offset_backend.rs) uses it wherever the record numbers SMLib's faces. A body numbered apart from its record still finds its faces by the points of every face, as before. 58a51d3's title promises a point inside each chosen face; this makes the call ask for those alone.

A limit that stays: picking that thread face itself for a face move still fails in solidcore's point search.

Changes a default: no

Validation

Release solidcraft-cli, 14-core Mac, main at ae46216:

Case main This change
90 × 30 × 11 mm plate, 4 holes, one Thread feature each, a face each turn second feature refused all 4 build, 29,255.825 mm³, 33.9 s
The same with continuous flanks second feature refused all 4 build, 29,255.825 mm³, 23.6 s
One Thread feature on 3 holes of a 13 mm plate, a face each turn refused builds, 311,606.2994 mm³, 22.4 s
One Thread feature on 6 holes, continuous flanks 71.8 s 70.1 s, 311,212.5989 mm³

main's refusal in the first three rows: "a modelled thread sets its face to the thread's size first, and this 4 mm hole can't be set to 3.242228 mm, the M4 thread's minor diameter: the kernel could not move its face there (the operation failed: SMLib offset faces: a point inside each face: solidcore: smlib_brep_face_points: topology::face::p2: no line interval classifies into the face)".

The flat and continuous 4-hole plates match in volume to 3e-11 mm³ and in area to 1e-6 mm².

Tests:

  • thread_tests::flat_flank_threads_on_holes_beside_each_other_all_build (new, crates/engine/src/thread_tests.rs): the 4-hole plate, built with a face each turn and with continuous flanks. All features build, and the two volumes agree to 1e-6 of the volume. On main it fails with the error above.
  • face_points_of_chosen_faces_match_every_face_s (new, crates/smlib/src/core/trim_tests.rs): the points for chosen faces are the points the every-face call gives for them. The smlib entry-point lists cover face_points_of.
  • cargo test -p solidcraft-smlib --lib -- face_points every_entry_point: 4 of 4 pass. cargo test -p solidcraft-kernel --lib -- offset draft shell: 98 of 98 pass.
  • Linux (Rust 1.99), this change and the Thread one on main at ae46216: fmt, clippy -D warnings, xtask layers, lists, skills and mesh-decisions pass. Plain tests: 32,351 ran, 32,335 pass, and the 16 on tests/KNOWN_FAILING_TESTS fail as listed. Routed tests: 9,779 of 9,779 pass.

Screenshots of the behavior

The 4-hole plate, a face each turn, one Thread feature per hole, cut through the hole centres and seen from the front. main refuses the second feature with the error above. This branch builds all 4:

this branch: four M4 threads with a face each turn, one feature each, cut through their centres

Integration status

Summary by CodeRabbit

  • New Features
    • Geometry workflows can retrieve interior points for selected faces, with results returned in the requested order.
  • Bug Fixes
    • Face-point queries no longer fail because an unselected face lacks an interior point. Invalid face selections and selected faces without interior points return errors.
    • Plates with adjacent drilled holes and modeled M4×0.7 threads build with both flat- and continuous-flank configurations, with nearly equal resulting volumes.

…, not every face

Since 58a51d3 (tangency-labs#21763, for tangency-labs#21721), a face move (Offset Face, Shell,
Draft, and a modelled thread setting its face to size) asks SMLib for a
point inside every face of the body (`face_points`, solidcore's `face_internal_points`),
then keeps the points of the faces it moves. One face SMLib finds no point
inside refuses the move of any other face.

A modelled thread with a face each turn (`continuous_flanks: false`) leaves
such a face. Through an 11 mm plate, a second M4x0.7 Thread feature beside
the first is refused while setting its hole's wall to size:
"smlib_brep_face_points: topology::face::p2: no line interval classifies
into the face".

`Brep::face_points_of` asks SMLib for the given faces alone, through the
same solidcore call. The face move uses it wherever the record numbers
SMLib's faces. A body numbered apart from its record still finds its faces
by the points of every face.

Release command-line tool on a 14-core Mac, main ae46216:
- 4 holes in an 11 mm plate, one Thread feature each, a face each turn:
  main refuses the second; this change builds all 4 (33.9 s), to the
  volume continuous flanks give (23.6 s).
- One Thread feature on 3 holes of a 13 mm plate, a face each turn: main
  refuses it; this change builds it (22.4 s).
- One Thread feature on 6 holes, continuous: 71.8 s on main, 70.1 s here.

Tests: `flat_flank_threads_on_holes_beside_each_other_all_build` (engine
thread tests) threads 4 holes of an 11 mm plate, one feature each, with a
face each turn and with continuous flanks: all build, to the same volume.
On main it fails with the error above.
`face_points_of_chosen_faces_match_every_face_s` (smlib) and the
entry-point lists cover `face_points_of`. smlib face_points and entry-point
tests 4 of 4, kernel offset, draft and shell tests 98 of 98, the engine
test 1 of 1 pass.
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The SMLib face-point API now supports selected body-order faces. The kernel uses it when face ordering is available and matches returned points to requested faces when ordering is unavailable. A thread regression test checks adjacent threaded holes in both flank modes.

Changes: Selected face interior-point lookup

Layer / File(s) Summary
SMLib selected-face API
crates/smlib/src/trim.rs, crates/smlib/src/core/trim.rs, crates/smlib/src/core/trim_tests.rs, crates/smlib/src/tests.rs
Brep::face_points_of accepts body-order face indices. Core code queries selected faces and preserves the full-body query path. Tests cover requested order, empty selections, and invalid indices.
Kernel face mapping
crates/kernel/src/offset_backend.rs
The kernel queries selected faces when SMLib ordering is available. Otherwise, it matches returned points to requested faces and reports a face-specific error when a requested face has no match.
Adjacent threaded-hole regression
crates/engine/src/thread_tests.rs
A test builds four drilled holes with modeled M4×0.7 threads, checks both flank settings for model errors, and compares the resulting plate volumes.

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

Merge Risk: Minimal · up to d8383

Face moves such as Offset Face, Shell, Draft and modelled threads now request interior points only for the faces being moved. An untouched face without a findable point no longer blocks the operation. Falling back to the full-body query when face numbering is unavailable preserves the old behavior in that case. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the Offset Face move and the behavior change: a face the move leaves alone no longer blocks the move. The raw summary and objectives confirm the change is to face_points lookup so unto…
Description check Passed The description follows the template's main sections: Change, Validation, Screenshots, and Integration status. It explains the problem, the mechanism (Brep::face_points_of and the face-move path), the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Existing Defaults Unchanged Passed The check fails only if the PR changes a UX default: a default setting or preference, a command's usual-use behaviour, the UI's default layout or behaviour, or a shortcut. Geometry or kernel results, …
Full details: Title check

Explanation

The title names the Offset Face move and the behavior change: a face the move leaves alone no longer blocks the move. The raw summary and objectives confirm the change is to face_points lookup so untouched faces without an SMLib interior point no longer refuse the move. The title is specific and matches the main change, though it uses a colon-prefixed form and slightly awkward phrasing ('a face the move leaves alone').

Full details: Description check

Explanation

The description follows the template's main sections: Change, Validation, Screenshots, and Integration status. It explains the problem, the mechanism (Brep::face_points_of and the face-move path), the limitation that picking the thread face itself still fails, and that no default changes. Validation gives concrete before/after values and test commands. A screenshot is included. The template's 'Changes a default: no' line is present. The Test change line is not required because the PR adds tests rather than changing existing expectations. The title comment in the template is an HTML comment and is not filled as a separate title. 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, a command's usual-use behaviour, the UI's default layout or behaviour, or a shortcut. Geometry or kernel results, including anything under solidcore/, are explicitly excluded and pass. Evidence gathered: - The changed-file inventory covers six files: thread_tests.rs, kernel/src/offset_backend.rs, smlib/src/core/trim.rs, core/trim_tests.rs, smlib/src/tests.rs, and smlib/src/trim.rs. No settings, preferences, UI, or shortcut files are touched. - A keyword search of the added lines for default, preference, shortcut, keybind, hotkey, settings, config, toggle, and layout found only Rust Default constructors in a test and in a solidcore call argument. Neither is a user-facing default. - The offset_backend.rs and trim.rs diffs change internal face-point lookup. A selected face is queried via face_points_of. Unselected faces no longer refuse the operation. This changes which thread and face-move cases build. That is a geometry result, which the check excludes. - The PR description states Changes a default: no. The diff is consistent with that statement. Net effect: the only user-visible change is that some previously refused face moves now build. That is a changed kernel result, not a changed UX default. Provider-reported primary PR identity: tangency-labs/solidcraft PR #26289, author login kaievns, base main, head fix/offset-face-points-moved-faces.

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 30c5fc0 and d8383cb.

Files selected for processing: 6

  • crates/engine/src/thread_tests.rs
  • crates/kernel/src/offset_backend.rs
  • crates/smlib/src/core/trim.rs
  • crates/smlib/src/core/trim_tests.rs
  • crates/smlib/src/tests.rs
  • crates/smlib/src/trim.rs

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

@bherbruck bherbruck added the approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) label Dec 4, 2026
@bherbruck

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bherbruck bherbruck added the ready to merge reviewed, every ask addressed; merge once CI is green label Dec 4, 2026
@bherbruck

Copy link
Copy Markdown
Collaborator

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Full review finished.

@tangency-repo-manager
tangency-repo-manager Bot merged commit 41df8d6 into tangency-labs:main Dec 4, 2026
111 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) 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.

2 participants