Skip to content

Kernel interface: swept volume of a body (Modelling::swept_volume), with its solidcore adapter - #25956

Merged
tangency-repo-manager[bot] merged 1 commit into
mainfrom
kernel-api-swept-volume
Dec 3, 2026
Merged

tangency-repo-manager[bot] merged 1 commit into
mainfrom
kernel-api-swept-volume

Conversation

@bherbruck

@bherbruck bherbruck commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Change

The app reaches solidcore's new swept volume operation (#25942 slides and turns, #25948 screws; design: tangency-labs/solidcore#3532) through the kernel interface. This PR adds one general entry for it.

  • kernel-api: Modelling::swept_volume(body, motion), with SolidMotion (Slide, Turn, Screw) placed in the sweep module beside the other sweep inputs.
  • crates/kernel, the adapter for solidcore (new swept_volume.rs):
    • hands the motion to solidcore_ops::swept_volume;
    • keeps solidcore's named refusals as KernelError::Invalid with the reason;
    • returns the result as the adapter's body.
  • Router: swept_volume runs solidcore's, the only kernel that builds it. No OpKind is added and nothing is routed. The OCCT backend refuses it ("a swept volume").
  • docs/design/kernel-layer.md: one line under "Later operations". Nothing else in the design changes.

This is stacked on #25948, which is stacked on #25942. It will be rebased onto main once those land.

The SolidCraft UI is the next step and is not in this PR: a "Solid" profile option in Sweep, with cut, join or new body as the result. It needs Nate's UI review.

Changes a default: no

Validation

  • cargo test -p solidcraft-kernel --lib swept_volume: 2 new tests pass:
    • brep-bench swept/box-slid-aslant through the interface, 812 to 1e-6 (bmander/brep-bench, MIT OR Apache-2.0);
    • a whole turn refused by name, with the reason kept.
  • cargo clippy -p solidcraft-kernel-api -p solidcraft-kernel --all-targets -- -D warnings: clean.
  • fmt: clean.
  • The existing interface and its callers are unchanged. The new trait method is implemented by both of the trait's implementors (solidcore, OCCT).

JYVIKO-FIRST, merge-tree against each of jyviko's open PRs:

The #25258 plan has nothing against a new general entry, and this one doesn't touch the feature crates.

Screenshots of the behavior (when observable)

Nothing to show in the app yet: no command uses the entry until the UI step.

Summary by CodeRabbit

  • New Features
    • Added swept-volume modeling for bodies moved by a straight slide, partial turn, or screw motion.
    • The Solidcore backend can generate swept bodies; unsupported backends report that the operation is unavailable.
  • Bug Fixes
    • Improved error reporting when a requested motion cannot produce a swept body.

One general entry in the kernel interface for solidcore's swept volume
(tangency-labs/solidcore#3532): `Modelling::swept_volume(body, motion)`
with `SolidMotion` (a slide, a turn or a screw) beside the other sweep
inputs in kernel-api's `sweep` module.

The adapter (crates/kernel) implements it for solidcore: the motion
handed to solidcore-ops' swept_volume, its named refusals kept as
KernelError::Invalid. The OCCT backend refuses it ("a swept volume").
The router's `swept_volume` runs solidcore's, the only kernel that
builds it, so no OpKind is added and nothing is routed yet;
docs/design/kernel-layer.md lists it among the later operations.

Tests: brep-bench swept/box-slid-aslant through the interface (812),
and a whole turn refused by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds a SolidMotion API and swept-volume construction through the Solidcore backend. It exposes a public routing function and returns an unsupported error for the OCCT backend. The design note describes swept volume as not yet routed.

Changes: Swept Volume

Layer / File(s) Summary
Motion and modelling contract
crates/kernel-api/src/sweep.rs, crates/kernel-api/src/modelling.rs
Adds SolidMotion variants for slide, turn, and screw motions. Adds Modelling::swept_volume with a body and motion input.
Swept-volume construction
crates/kernel/src/swept_volume.rs, crates/kernel/src/backend/modelling.rs
Converts motion inputs for Solidcore, maps unsupported errors to KernelError::Invalid and other build or conversion errors to KernelError::Failed, and returns the swept body. Tests check a slid box volume and whole-turn rejection.
Public routing and backend support
crates/kernel/src/route/modelling.rs, crates/kernel/src/lib.rs, crates/kernel/src/backend/occt.rs, docs/design/kernel-layer.md
Adds and exports a routing function. The OCCT implementation returns Unsupported("a swept volume"). The design note says swept volume is not yet routed.

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

Merge Risk: Minimal · up to c9524

This adds a swept-volume entry point to the kernel interface, backed by solidcore, and refuses it cleanly on OCCT. Existing behavior is unchanged and no merge-blocking risk was found.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the main change: a new kernel interface method, Modelling::swept_volume, with its solidcore adapter. The raw summary and objectives confirm this is the primary change across kernel-api…
Description check Passed The description follows the template. It has a Change section that explains the swept volume entry in plain terms, with a 'Changes a default: no' line. It has a Validation section with commands, resul…
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 passes because the PR makes no changes to any UX default. Its changes are additive. Evidence from the reviewed range (refs/coderabbit/pre-merge-check/base..head): - Changed files: kernel-api…
Full details: Title check

Explanation

The title names the main change: a new kernel interface method, Modelling::swept_volume, with its solidcore adapter. The raw summary and objectives confirm this is the primary change across kernel-api, the kernel adapter, the router, and the OCCT refusal. The title is specific and does not use vague terms.

Full details: Description check

Explanation

The description follows the template. It has a Change section that explains the swept volume entry in plain terms, with a 'Changes a default: no' line. It has a Validation section with commands, results, and test details. It has a Screenshots section that explains why no UI screenshot exists yet. The Integration status section from the template is missing. The description also has no 'Test change' line. The template requires that line only when existing kernel tests or golden expectations change, and the description says the existing interface is unchanged, so the line is not needed. The description does not name the tool or project for a reader new to the project. It refers to solidcore and SolidCraft without a short explanation. The description also links to an issue and refers to other PRs, which helps reviewers.

Full details: Existing Defaults Unchanged

Explanation

The check passes because the PR makes no changes to any UX default. Its changes are additive. Evidence from the reviewed range (refs/coderabbit/pre-merge-check/base..head): - Changed files: kernel-api modelling.rs and sweep.rs, kernel backend/modelling.rs, backend/occt.rs, lib.rs, route/modelling.rs, docs/design/kernel-layer.md, plus the new swept_volume.rs. - The only removed line is a use crate::sweep::{...} import that is expanded in place. It is not a behaviour change. - The router function swept_volume only forwards to Solidcore.swept_volume. The PR adds no OpKind and routes no existing command. - The design doc gets one new bullet under "Later operations". It is documentation, not a UX default. - The PR adds no setting, preference, shortcut, layout, or command default. Existing kernel results are unchanged, and the new kernel path is reached only through the new entry. The PR description states Changes a default: no, and the code agrees. The UI work is explicitly deferred to a follow-up PR.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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 3f84e79 and c952468.

Files selected for processing: 8

  • crates/kernel-api/src/modelling.rs
  • crates/kernel-api/src/sweep.rs
  • crates/kernel/src/backend/modelling.rs
  • crates/kernel/src/backend/occt.rs
  • crates/kernel/src/lib.rs
  • crates/kernel/src/route/modelling.rs
  • crates/kernel/src/swept_volume.rs
  • docs/design/kernel-layer.md

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 bherbruck added area:kernel B-rep kernel, booleans, blends, STEP/IGES approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Dec 3, 2026
Base automatically changed from solidcore-swept-volume-screw to main December 3, 2026 18:23
@bherbruck bherbruck added the ready to merge reviewed, every ask addressed; merge once CI is green label Dec 3, 2026
@tangency-repo-manager
tangency-repo-manager Bot merged commit 8093b35 into main Dec 3, 2026
106 of 136 checks passed
@tangency-repo-manager
tangency-repo-manager Bot deleted the kernel-api-swept-volume branch December 3, 2026 19:23
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: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.

1 participant