You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
STEP import: a spline edge ending on a closed spline face's seam gets the pcurve between its ends, so its loop still closes after healing - #19590
When a STEP file's spline edge ends on the seam of a closed spline face (a cylinder's or cone's NURBS form), the reader now gives it the pcurve between its two ends. Before, it could take a straight (u, v) segment whose ends miss the edge's ends by up to half the file's tolerance, and the imported body then failed SmTrimmingTools test 0 ("Edge/Edge Gap") once healing set its edge tolerances.
Found on an imported part that cannot be attached.
Change
solidcore/crates/solidcore/src/eval/pcurve.rs, On::along: the closed form of an edge on a spline face. It tries straight segments in (u, v) in order, and takes the first that lifts onto the edge within half the record's tolerance:
the segment between the projections of the edge's two ends;
two segments with u or v fixed at the middle's value;
"pace" segments through the middle's parameters, moving at the pace measured between the quarter and three-quarter points. Their ends are extrapolated from the middle, so they do not land on the edge's ends unless the edge really is such a line.
Defect. On a closed form, a point on the seam has two parameters, one at each end of the period. The ends were projected each on its own. An edge ending on the seam could get its end on the far side of the period from the rest of it. Segment 1 then runs the wrong way round the surface and misses. A pace segment was taken instead. For an edge that is not exactly a line in (u, v), such a segment can come within the tolerance and still have its ends off the edge's ends.
The record passes its check: every tolerance is the file's. Healing (Fix_TolSizes) then sets each edge's tolerance from the gaps of its 3D curve. The pcurve does not enter those gaps. Test 0 compares the face's surface at one pcurve's end and the next pcurve's start with the sum of the two edges' tolerances, and refuses the loop. So check_solid fails with PointersInvalid and AssertValid is skipped.
Fix. Each end's parameters are taken on the sheet of the edge's middle (uv::unwrap in each periodic direction), as the pace segments' own sample points already are. Segment 1 is then the one tried first and taken. Its ends are the edge's ends by construction. Nothing changes for an edge whose end projections were already on its middle's sheet: the parameters are the same bits, and the same candidate is taken.
Not changed. Which candidates exist, the order they are tried in, and the tolerance a candidate is checked at. A segment taken within half the record's tolerance may still lie up to that far from the edge between its ends, as before. No check measures a pcurve against its edge between its ends (docs/validity-and-tolerances.md §5.2).
Set aside.
Relaxing test 0 where the 3D curves meet. The gap is real in (u, v): the face's trimmed boundary does not close.
Raising the edge's tolerance to cover its pcurve. That covers a wrong pcurve instead of making the right one.
Refusing every segment that does not run through the edge's nearest points on the surface to rounding, so the kernel's trims make those pcurves (tried). It refuses a NURBS meridian whose ends lie 1e-8 beside a sphere's poles at a tolerance of 1e-7 (a_seam_from_pole_to_pole_encloses_the_whole_sphere). On imported parts it sent more uses of a face to the kernel's trims together, whose ends then failed test 0 against the closed forms left beside them.
Related: #12457 reports imports failing this same test. This is one cause of it, on the current reader. Whether the files in that issue have this cause is not shown, so this pull request does not close it. #19295 (proved bounds for kept trims on read) and #16284 (certified pcurves in pcurves_within) touch the same area: #16284 edits pcurve.rs elsewhere, not along, and neither changes which segment along takes.
Changes a default: no
Validation
New test a_spline_edge_ending_on_a_closed_forms_seam_gets_the_segment_between_its_ends (solidcore/crates/solidcore/src/eval/pcurve_tests.rs). A cubic Bézier on the NURBS form of a cylinder of radius 20: 0.05 rad round the axis, its angle quadratic in its parameter (5e-4 rad of it from the quadratic term), rising 0.35. It runs once ending on the form's seam (θ = 2π) and once ending at θ = 3. The segment between its ends and the pace segment each come within 5.0e-3 of it, under half of a tolerance of 0.02. The test asks that the pcurve's ends lift onto the edge's ends within 1e-9, and that the pcurve lifts within 0.01.
Without the fix, the case ending on the seam fails: the pcurve's start lifts 5.0e-3 from the edge's start.
With it, both cases pass.
On main at e35bc3930, compared with a run of the same commit without the change:
The new test fails without the change and passes with it (above).
cargo test --release --no-fail-fast, the six kernel packages: solidcore 7,348 passed / 0 failed / 55 ignored (without the change 7,347 / 0 / 55: the new test), solidcore-ops 913 / 0 / 12, solidcore-step 142 / 0 / 2, solidcore-convert 58 / 0 / 0, solidcore-tess 113 / 0 / 2, solidcore-record 113 / 0 / 4 (each the same without the change).
Goldens with upstream's test files (SOLIDCORE_REQUIRE_UPSTREAM=1): --all --goldens gives 283 units, 283 passed, 0 failed, 0 cases changed, added, removed or broken. --all --digest-dir --digest-debug: all 283 .debug files are byte-identical to those of the same commit without the change. No golden moves.
The STEP import of the part this was found on: before, check_solid fails with this test 0 line at every check level. After, the line is gone and the edge's pcurve ends on its vertices. The same user's other STEP files give byte-identical check output before and after.
Screenshots of the behavior (when observable)
None. The part this was found on cannot be attached. The new test builds the same situation in code: an edge on a closed form's seam whose pcurve's ends miss its vertices.
Integration status
Rebased onto main at 7a34819 (no conflicts). On the rebased head:
cargo test --release --no-fail-fast -p solidcore: 7,517 passed, 0 failed, 55 ignored (514 binaries), the new test among them; -p solidcore-step: 160 passed, 0 failed;
cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, the wasm check and the panic-site check: clean;
Goldens were compared digest by digest on e35bc3930 (above), not again on the rebased head.
#19531 (draft) changes close() in the same file, a different function; whichever merges second may need a textual rebase of pcurve_tests.rs, where both add a test.
Summary by CodeRabbit
Bug Fixes
Improved curve mapping across periodic boundaries, reducing inaccuracies when an edge crosses a surface seam.
Preserved exact endpoint alignment and improved mapping accuracy along the edge.
… the pcurve between its ends, so its loop still closes after healing
On a spline face (a NURBS form of a cylinder or cone), `On::along` gives an edge the first
straight (u, v) segment that lifts onto it within half the record's tolerance: the segment
between its ends' projections, then ones with u or v fixed at the middle's, then segments
through the middle at the middle's pace, whose ends are extrapolated from the middle.
The ends were projected each on its own. A point on a closed form's seam has two parameters,
and an edge ending there could get its end a period away from the rest of it. The segment
between the ends then ran the wrong way round and missed, and a pace segment was taken: for an
edge that is not exactly a line in (u, v), within the tolerance of it but with its ends off the
edge's ends. The record passes its check at the file's tolerances; after healing sets the edge
tolerances from the edges' 3D gaps, `SmTrimmingTools` test 0 (Edge/Edge Gap) refuses the loop.
Each end is now taken on the sheet of the edge's middle, as the pace segments' sample points
already are, so the segment between the ends is the one tried first and taken, ending on the
edge's ends. An edge whose ends were already on its middle's sheet gets the same bits.
Test: a_spline_edge_ending_on_a_closed_forms_seam_gets_the_segment_between_its_ends.
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.
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
On::along now aligns projected endpoints to the edge midpoint’s periodic parameter sheet before constructing p-curve candidates. A regression test checks endpoint lifting and sampled lift error for a spline edge on a cylinder.
Changes: Periodic p-curve endpoint alignment
Layer / File(s)
Summary
Align p-curve candidates and test seam endpoints solidcore/crates/solidcore/src/eval/pcurve.rs, solidcore/crates/solidcore/src/eval/pcurve_tests.rs
On::along uses midpoint-aligned endpoint projections for its candidates. The new test checks exact endpoint lifting and sampled lift error for a spline edge with an endpoint on the cylinder seam.
The change addresses seam-ending spline edges and adds focused regression coverage. No concrete merge-blocking defect was established; merge after normal checks pass.
Pre-merge checks: 4 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Existing Defaults Unchanged
Pull request inputs changed after this check was assessed; its verdict is no longer current.
Re-run the check against the current pull request inputs.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title names the change: a STEP-imported spline edge ending on a closed spline face's seam now gets the pcurve between its ends, so its loop closes after healing. This matches the raw summary (On::…
Description check
The description covers the problem, the defect, the fix in On::along, what is not changed, validation (new test, golden comparisons, lint/fmt/clippy, wasm check), and integration status. It follows th…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the change: a STEP-imported spline edge ending on a closed spline face's seam now gets the pcurve between its ends, so its loop closes after healing. This matches the raw summary (On::along unwraps endpoints to the midpoint's periodic sheet) and the PR objectives. It is specific, though long at 137 characters and 25 words, and it is a single sentence.
Full details: Description check
Explanation
The description covers the problem, the defect, the fix in On::along, what is not changed, validation (new test, golden comparisons, lint/fmt/clippy, wasm check), and integration status. It follows the template's Change, Validation, and Integration status sections and includes the required 'Changes a default: no' line. The screenshots section is present and explains why none is provided. A 'Test change:' line is not needed because the PR adds a test and does not modify existing expectations. The description is long and dense, but it is substantively complete.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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
approved-for-ciReviewed: run the full PR CI (build, tests, goldens, Clippy)area:kernelB-rep kernel, booleans, blends, STEP/IGESready to mergereviewed, every ask addressed; merge once CI is green
2 participants
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.
When a STEP file's spline edge ends on the seam of a closed spline face (a cylinder's or cone's NURBS form), the reader now gives it the pcurve between its two ends. Before, it could take a straight (u, v) segment whose ends miss the edge's ends by up to half the file's tolerance, and the imported body then failed
SmTrimmingToolstest 0 ("Edge/Edge Gap") once healing set its edge tolerances.Found on an imported part that cannot be attached.
Change
solidcore/crates/solidcore/src/eval/pcurve.rs,On::along: the closed form of an edge on a spline face. It tries straight segments in (u, v) in order, and takes the first that lifts onto the edge within half the record's tolerance:Defect. On a closed form, a point on the seam has two parameters, one at each end of the period. The ends were projected each on its own. An edge ending on the seam could get its end on the far side of the period from the rest of it. Segment 1 then runs the wrong way round the surface and misses. A pace segment was taken instead. For an edge that is not exactly a line in (u, v), such a segment can come within the tolerance and still have its ends off the edge's ends.
The record passes its check: every tolerance is the file's. Healing (
Fix_TolSizes) then sets each edge's tolerance from the gaps of its 3D curve. The pcurve does not enter those gaps. Test 0 compares the face's surface at one pcurve's end and the next pcurve's start with the sum of the two edges' tolerances, and refuses the loop. Socheck_solidfails withPointersInvalidandAssertValidis skipped.Fix. Each end's parameters are taken on the sheet of the edge's middle (
uv::unwrapin each periodic direction), as the pace segments' own sample points already are. Segment 1 is then the one tried first and taken. Its ends are the edge's ends by construction. Nothing changes for an edge whose end projections were already on its middle's sheet: the parameters are the same bits, and the same candidate is taken.Not changed. Which candidates exist, the order they are tried in, and the tolerance a candidate is checked at. A segment taken within half the record's tolerance may still lie up to that far from the edge between its ends, as before. No check measures a pcurve against its edge between its ends (
docs/validity-and-tolerances.md§5.2).Set aside.
a_seam_from_pole_to_pole_encloses_the_whole_sphere). On imported parts it sent more uses of a face to the kernel's trims together, whose ends then failed test 0 against the closed forms left beside them.Related: #12457 reports imports failing this same test. This is one cause of it, on the current reader. Whether the files in that issue have this cause is not shown, so this pull request does not close it. #19295 (proved bounds for kept trims on read) and #16284 (certified pcurves in
pcurves_within) touch the same area: #16284 editspcurve.rselsewhere, notalong, and neither changes which segmentalongtakes.Changes a default: no
Validation
New test
a_spline_edge_ending_on_a_closed_forms_seam_gets_the_segment_between_its_ends(solidcore/crates/solidcore/src/eval/pcurve_tests.rs). A cubic Bézier on the NURBS form of a cylinder of radius 20: 0.05 rad round the axis, its angle quadratic in its parameter (5e-4 rad of it from the quadratic term), rising 0.35. It runs once ending on the form's seam (θ = 2π) and once ending at θ = 3. The segment between its ends and the pace segment each come within 5.0e-3 of it, under half of a tolerance of 0.02. The test asks that the pcurve's ends lift onto the edge's ends within 1e-9, and that the pcurve lifts within 0.01.On
mainate35bc3930, compared with a run of the same commit without the change:cargo test --release --no-fail-fast, the six kernel packages:solidcore7,348 passed / 0 failed / 55 ignored (without the change 7,347 / 0 / 55: the new test),solidcore-ops913 / 0 / 12,solidcore-step142 / 0 / 2,solidcore-convert58 / 0 / 0,solidcore-tess113 / 0 / 2,solidcore-record113 / 0 / 4 (each the same without the change).SOLIDCORE_REQUIRE_UPSTREAM=1):--all --goldensgives 283 units, 283 passed, 0 failed, 0 cases changed, added, removed or broken.--all --digest-dir --digest-debug: all 283.debugfiles are byte-identical to those of the same commit without the change. No golden moves.cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo check -p solidcore --target wasm32-unknown-unknown,python3 scripts/ci/check_panic_sites.py --base upstream/main: clean.check_solidfails with this test 0 line at every check level. After, the line is gone and the edge's pcurve ends on its vertices. The same user's other STEP files give byte-identical check output before and after.Screenshots of the behavior (when observable)
None. The part this was found on cannot be attached. The new test builds the same situation in code: an edge on a closed form's seam whose pcurve's ends miss its vertices.
Integration status
Rebased onto
mainat 7a34819 (no conflicts). On the rebased head:cargo test --release --no-fail-fast -p solidcore: 7,517 passed, 0 failed, 55 ignored (514 binaries), the new test among them;-p solidcore-step: 160 passed, 0 failed;cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings, the wasm check and the panic-site check: clean;main(which has solidcore: the healer gives an edge whose gap is under the check's limit a tolerance under it #19445 and solidcore: hold every kept UV trim to its edge by a proved bound on read #19295): without the change,check_solidfails on this test 0 line alone; with it, the body passescheck_solid, with no failure at any check level.Goldens were compared digest by digest on
e35bc3930(above), not again on the rebased head.#19531 (draft) changes
close()in the same file, a different function; whichever merges second may need a textual rebase ofpcurve_tests.rs, where both add a test.Summary by CodeRabbit