Skip to content

fix: sm_FixUVTrimCurves moves only the trim end points (#570) - #703

Merged
bherbruck merged 2 commits into
tangency-labs:mainfrom
denelson1-dot:fix/570-uv-trim-stretch
Oct 24, 2026
Merged

bherbruck merged 2 commits into
tangency-labs:mainfrom
denelson1-dot:fix/570-uv-trim-stretch

Conversation

@denelson1-dot

Copy link
Copy Markdown
Contributor

Fixes #570. Ports jyviko's fork fix tangency-labs/smlib@5af7070 into the Rust sm_FixUVTrimCurves (topology::face::p2::fix_uv_trim_curves). This is a documented deviation from upstream. Standalone on main (no other PR stacked).

What was wrong

Closing a corner's UV gap, upstream drops the vertex's UV point onto each of the two trims, Trims the trim there and EditParameterizations it back over its old interval, and only then moves the end point (SmFace.cpp:7609–7687 at c9c5979). The stretch slides every interior parameter of the trim off its edge's by the trimmed length. Any point classification builds the trim cache that runs this. On SolidCraft's 06-threads/004, a 1.15e-6 corner gap left a thread-flank trim 5.05e-5 off its edge, against a tolerance of 1e-5 (details in the issue).

Change

  • fix_uv_trim_curves no longer calls DropPoint, Trim or EditParameterization. Only the two end control points move onto the vertex's UV point, by the UV gap, as in the fork. The early returns, the end-weight handling and the rational/non-rational EditEndPoint are unchanged.
  • Module header: a new Deviations bullet. The "statuses ignored" bullet no longer lists DropPoint.
  • plan/upstream-issues.md: WR-255. plan/findings.md: a section for issue SMLib's tolerances don't cover its own approximations: trims and intersection curves lie outside the edge tolerance recorded for them #570.
  • New test fix_uv_trim_curves_keeps_interior_parameters. It builds a box with create_box and gives one face's trim three spans and a 1e-3 overshoot past its vertex. It then checks that the knots and interior control points are unchanged and the vertex end lands on the vertex. On the old code path it fails: interior knots move from 3.3333 to 3.3324.

Difftest: nothing moves, and why

No difftest case reaches the removed branch. The topology.face_p2 FixUv cases call the function on the fixture B-reps' own trims, whose ends already lie on their vertices' UV points; the cases pass a nominal uv_dist_between. The drop point is therefore the trim's end, so upstream's SM_ARE_SAME(dTCurr, dTCurrNew) skips the trim. The same holds for its callers, CreateUVTrimCurves and CheckAndFixUVTrimCurves. As a result there are no known-mismatch entries, and the unit test above is the only coverage of the changed behaviour. A difftest op that moves a trim's end would make the deviation visible against the C++; I left that out to keep this PR small.

Per-case outcomes match main's CI reports (run 40048046902, 20bef40d1) for all 260 units. The one difference before merging main was sweep.trans_sweep_geometry, from #692 landing after my base; it is identical after the merge.

--green (base 9bc152f6d + fix): difftest: 260 unit(s), 206 passed, 54 partial, 0 failed
after merging main (a0e9147fe):
PASS sweep.trans_sweep_geometry cases=788 passed=780 failed=0 deferred=0 max_rel_err=0e0 rejected=8
PARTIAL topology.face_p2 cases=2692 passed=2596 failed=0 deferred=96 max_rel_err=0e0
PARTIAL topology.face_p3 cases=1781 passed=1604 failed=0 deferred=177 max_rel_err=0e0
PARTIAL topology.face_p4 cases=5506 passed=5484 failed=0 deferred=22 max_rel_err=0e0
PARTIAL topology.brep_p2 cases=1709 passed=1673 failed=0 deferred=36 max_rel_err=0e0
PARTIAL topology.brep_p7 cases=348 passed=289 failed=0 deferred=59 max_rel_err=0e0

Preserved invariants

No tolerance loosened, no case dropped, no generator, shim, FFI or runner changed, no unit status changed, no stub added.

Verified on head a0e9147: fmt, clippy -D warnings (plain + difftest/cpp), cargo test -p solidcore (2080 + integration), wasm32 check, units.py check, difftest above (x86-64 Linux).

🤖 Generated with Claude Code

denelson1-dot and others added 2 commits October 23, 2026 21:32
…#570)

Closing a corner's UV gap, upstream drops the vertex's UV point onto each
trim, trims it there and stretches it back over its interval
(Trim + EditParameterization). The stretch slides every interior
parameter of the trim off its edge's by the trimmed length. Follow
tangency-labs/smlib@5af7070: only the end control points move, by the
UV gap. Documented deviation (WR-255); regression test
fix_uv_trim_curves_keeps_interior_parameters. No difftest case reaches
the removed branch, so every unit's results are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bherbruck
bherbruck added this pull request to the merge queue Oct 24, 2026
Merged via the queue into tangency-labs:main with commit 0ffc493 Oct 24, 2026
7 checks passed
denelson1-dot added a commit to denelson1-dot/solidcore that referenced this pull request Oct 24, 2026
…on main)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SMLib's tolerances don't cover its own approximations: trims and intersection curves lie outside the edge tolerance recorded for them

2 participants