Skip to content

feat(geom): make lofts through closed splines exact solids - #2342

Merged
subydoo-ci[bot] merged 1 commit into
mainfrom
feat/closed-spline-loft-exact
Nov 15, 2026
Merged

subydoo-ci[bot] merged 1 commit into
mainfrom
feat/closed-spline-loft-exact

Conversation

@subydoo-ci

@subydoo-ci subydoo-ci Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Integrators: slicerx_geom_loft 1.15.0 (from 1.14.0). The answer's fields are unchanged. A new body lofted through profiles that are each one closed spline is made as an exact solid and answers exact: true, where it was made as a mesh with a note.

For users (against main)

A loft whose profiles are each drawn as one closed spline was made as a mesh, and the step said "Profile 1 is a closed spline, which has no corners to match its pieces between." The part had no exact faces, so every step after it ran on the mesh. Now the loft is an exact solid with three faces: the side and the two ends.

A recorded design (a 9-profile closed-spline loft, a second loft joined onto it, then 13 more steps) was replayed through the app's design host on the native engine, 3 runs each, with the machine's 1-minute load between 7.8 and 12.0. Times are wall times in seconds.

main this change
The 9-profile loft 4.2, 4.4, 4.5 (mesh) 11.4, 15.6, 15.9 (exact)
The whole build, 16 tool calls 66.6, 79.5, 79.7 46.5, 49.3, 52.7
An edit to the loft (one station 32 to 35 mm tall), which replays every later step 62.3, 65.6, 71.6 52.4, 53.6, 54.2

The exact loft takes longer on its own: it is skinned on 145 rails after its rails are doubled twice to hold every drawn section within 0.01 mm. The joined second loft is made on the mesh, as every join is, so from there on the part is a mesh and the later cuts run on the mesh, as on main. That mesh comes from the exact body's own triangles (37,804 of them against 145,286 for the mesh loft), so each later step takes about half as long.

Beside a profile whose splines meet at corners, a closed spline is cut where those corners land on it, and each piece is made spline to spline. Beside lines, arcs or a circle it is still made as a mesh, since a spline matches only a spline, and the note now says "A spline is matched only to a spline, and profile 2 has none where profile 1 has one."

What

The exact loft matched closed splines nowhere: a profile drawn as one closed spline was refused before matching. Now it is one piece all the way around, as a whole circle or ellipse is. Places along it go by its length, by the same measure the other spline pieces use, taken across its start too. The first profile's rail starts at its first drawn point. Each later profile starts where it twists least from the profile before, found from samples about each profile's center, so a profile drawn the other way around or from another point still lines up. The side is skinned across every rail and back onto the first.

The mesh loft is unchanged. It still matches closed splines by count, so every mesh reply stays the same to the byte.

Expectations changed

Three tests expected the old note for a circle beside a closed spline. That loft is still refused as exact, for the new reason:

  • exact_loft.rs, what_cannot_be_made_exact_is_refused_and_nothing_is_kept: "loft: a spline is matched only to a spline, and profile 1 has none where profile 2 has one".
  • exact_loft.rs, a_loft_that_cannot_be_exact_answers_as_before_and_says_why: "A spline is matched only to a spline, and profile 1 has none where profile 2 has one."
  • loft_rails.rs, profiles_that_cannot_be_matched_say_why: "a spline is matched only to a spline, and profile 1 has none where profile 2 has one".

No recorded engine reply moved.

How it was tested

New cases in packages/geom/tests/exact_loft_curved.rs, on the exact kernel:

  • A 9-profile closed-spline loft, smooth, as an app sends it: three faces on 145 rails after two doublings, every drawn spline within 0.0034 mm of the body, the body closed, and its volume 628281.82 mm³ against the mesh loft's 627736.02 mm³ (+0.087 percent, inside the 0.2 percent every exact loft is held to).
  • Three closed splines of different shapes, one drawn the other way around from another point: three faces on 72 rails after one doubling, within 0.00087 mm, volume +0.097 percent. The first rail moves at most 3.4 degrees from one ring to the next (at most 5.2 on the nine profiles).
  • Both answer the mesh loft's own reply plus the body and its three face keys, and the mesh replies are the bytes main gives.
  • A closed spline beside two splines meeting at two corners: two pieces, each spline to spline, cut at those corners, volume +0.058 percent. Beside a square it is made as a mesh and says why.

On main, the new cases fail with "profile 1 is a closed spline, which has no corners to match its pieces between". Every loft in the geom test fixtures was asked exact and saved on main's engine and on this one: every exact body and every mesh reply is the same to the byte, but for the new closed-spline case.

All runs are against an sx-geom built with the exact kernel (brep.count answers {"bodies":0}) and an sx built from the same commit:

  • geom: cargo fmt --check and cargo clippy --all-targets -D warnings, with and without --features brep, are clean. All 31 test binaries, the library tests and the doc tests pass both ways.
  • mcp: live 320 files passed and 4 skipped, 2352 tests passed and 42 skipped. Replay (SX_GEOM_REPLAY=1) gives the same counts. No run printed "has no exact kernel".
  • app: live 730 files passed and 7 skipped, 6056 tests passed and 59 skipped. Replay 719 files passed and 18 skipped, 5962 tests passed and 153 skipped. native-provider passed against the served engine (33 passed, 1 skipped).
  • viewport: 82 files, 731 tests passed.
  • Typecheck across the workspace, tools-doc --check, fold-changes --check, dashes and brand strings all pass.
  • Web build and bundle size: shell JS 185.9 KB gzip against the 188 KB budget.

A loft through profiles that are each drawn as one closed spline was made as a mesh, with the note "Profile 1 is a closed spline, which has no corners to match its pieces between". The body had no face table, and every later step on it ran on the mesh.

A closed spline is now matched as one piece all the way around, as a whole circle is. Places along it go by its length, measured the way the other spline pieces are and taken across its start as well. The first profile starts at its first drawn point. Each later profile starts where it twists least from the one before, found from samples about each profile's center, so a profile drawn the other way around or from another point still lines up. The side is skinned across every rail and back onto the first, and held within 0.01 mm of each drawn spline, with the rails doubled up to twice as on every skinned loft.

Beside a profile whose splines meet at corners, a closed spline is cut where those corners land on it, and each piece is matched spline to spline. Beside lines, arcs or a circle it stays a mesh loft, since a spline matches only a spline, and the note now gives that reason. The mesh loft is unchanged and still matches closed splines by count.

A 9-profile closed-spline loft is now an exact body of three faces (one skinned side and two flat ends) on 145 rails. It comes within 0.0034 mm of every drawn section, and its volume is 628281.82 mm3 against the mesh loft's 627736.02 mm3, 0.087 percent more. Every loft that was exact before gives the same reply to the byte, and so does every mesh loft.

Three tests that expected the old note for a circle beside a closed spline now expect the new one.

Signed-off-by: subydoo-ci[bot] <343861189+subydoo-ci[bot]@users.noreply.github.com>
@subydoo-ci subydoo-ci Bot added user-facing People using SlicerX will notice this; it goes in the release notes roadmap:cad Roadmap feature: cad integrators Changes what editions and integrations build against; the PR has an Integrators: line labels Nov 15, 2026
@subydoo-ci
subydoo-ci Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 188ca46 Nov 15, 2026
131 checks passed
@subydoo-ci
subydoo-ci Bot deleted the feat/closed-spline-loft-exact branch November 15, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrators Changes what editions and integrations build against; the PR has an Integrators: line roadmap:cad Roadmap feature: cad user-facing People using SlicerX will notice this; it goes in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants