Repository navigation
feat(geom): make lofts through closed splines exact solids - #2342
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrators:
slicerx_geom_loft1.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 answersexact: 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.
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: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.countanswers{"bodies":0}) and an sx built from the same commit:cargo fmt --checkandcargo 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.SX_GEOM_REPLAY=1) gives the same counts. No run printed "has no exact kernel".native-providerpassed against the served engine (33 passed, 1 skipped).tools-doc --check,fold-changes --check, dashes and brand strings all pass.