Skip to content

fix: tangent curve tracer breaks a crease round (#2089) - #2101

Merged
bherbruck merged 6 commits into
tangency-labs:mainfrom
brett19:fix/2089-tangent-tracer-crease
Nov 1, 2026
Merged

bherbruck merged 6 commits into
tangency-labs:mainfrom
brett19:fix/2089-tangent-tracer-crease

Conversation

@brett19

@brett19 brett19 commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #2089

With the opt-in ssi_tangent_curve_tracer (WR-75) on, the #2089 crease round failed with fillet code 3 ("Fillet Corner Error: Corner Edge Computation Failure"). That round is an r 1 round of a block's top edge plus the crease up from it, after an r 2 round of the block/cylinder arc, and SolidCraft hit it once the r 2 round is a B-spline surface (its flat round trip). Without the tracer it built. Tested head 82ac4af.

Cause. The FilletXSideFace corner edge intersects the r 1 round with the cylinder (sm_SrfSrfIntersection). Past the crease's upper end the two surfaces run on almost tangent: angles up to about 1e-3 rad over 0.15, with contact points along the way. FindTangentCurves found 6 nodes there and traced a crossing branch through them. That branch ran past the end where the marcher's crossing curve stops (z 17.15 against 17.0). The marcher's curve didn't cover it, so the branch replaced it. The corner vertex then lay 0.15 off the r 2 round's rail, and the next corner edge (OnExtendEdge, cylinder / r 2 round, through that vertex) found no curve.

Fix (inside the tracer, so only with the flag on). A crossing branch is dropped, and the marcher's curve kept, when the marcher's curve covers every sample of it except samples inside the band where the surfaces are within tolerance of each other. That band is the one the same pass's replacement test caps at 0.02 * size (20 tol / sin(angle) >= 0.02 size). At least one sample outside the band must be covered. The fork has the same FindTangentCurves at 26cc451 and 7ac037e (no tracer change after 1693c9d except the ported d37ca80 and 8d95600), so this isn't from the fork. The record is the addendum plan/upstream-issues/WR-75--addendum-2026-10-31-crossing-branch-tolerance-band.md.

Regression test. crates/solidcore/tests/issue_2089_tangent_tracer_crease_round.rs uses the issue's solidcore-only chain, reduced from the 230-flag preset to fillet_through_extended_rail_end + fillet_torus_span_from_start_section (ddmin). It covers the round's face as built, as its turn_to_nurbs surface, and the whole body under turn_to_nurbs. With the tracer on, every form now builds. Its volume matches SMLib's 13992.23942188 (1e-9 relative for as-built and face-NURBS, 1e-6 for the all-NURBS body) and is bit-identical to the tracer-off body. I checked that both tests fail with code 3 when the change is disabled. The full 230-flag chain from the issue also gives code 0 in all six cells (tracer on and off): as-built 13992.23942438, face-NURBS 13992.23942069, all-NURBS 13992.23351409, the same with the tracer on and off.

Existing tracer tests still pass: wr75_ssi_tangent_curves, issue_395_tangential_contact_corpus, issue_394_ssi_tangent_contact_points, wr650_tabbed_plate_mitred_rounds, issue_2020_offset_mitred_below_depth, issue_1945_fork_1207_step4, issue_1060_offset_mitred_rounded_box_top.

Flag off: the default path is unchanged (the pass runs only with the flag on).

Completion evidence

Operation / symbols Implementation Native comparison Remaining gap
FindTangentCurves crossing-branch keep test (fork-only, opt-in) complete (covers_crossing) none: not in pinned SMLib; the default path is unchanged and difftest is identical SolidCraft's sweeps/2891 can't be run here; please re-run it on the rig

Local gate (gate.sh, head 82ac4af, behind origin/main 0): RESULT PASS

PASS intersect.surface_intersector_p5 cases=1731 passed=1731 failed=0 deferred=0 max_rel_err=0e0
PASS intersect.adv_surface_intersector cases=1949 passed=1949 failed=0 deferred=0 max_rel_err=0e0
PASS blend.fillet_corner_p1 cases=308 passed=308 failed=0 deferred=0 max_rel_err=0e0

🤖 Generated with Claude Code

https://claude.ai/code/session_01MNXLXj2sJf943y2dDF36Vy

@brett19

brett19 commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this claim draft. #2089 doesn't reproduce in solidcore from any rebuild or from the .smd: the failure needs SolidCraft's in-memory copy, and SolidCraft is checking whether its own BrepFromFlat rebuild produces the failing body (see #2089). Builds and measurements so far, covering the extruded recipe, overflow_first on and off, both copy kinds and the tracer on and off, all give V = 13992.23942438 against SMLib's 13992.23942188. The tracer never runs during the failing round. The scratch repro is kept locally. We'll reopen or start a new PR once there's a solidcore-only reproduction.


Written by Claude Code (Anthropic) on behalf of @brett19.

@brett19 brett19 closed this Oct 31, 2026
@brett19 brett19 reopened this Oct 31, 2026
brett19 and others added 3 commits October 31, 2026 22:38
…cy-labs#2089)

With ssi_tangent_curve_tracer on, FindTangentCurves traced a crossing
branch through the contact points along a near-tangency, past the end
where the marcher's crossing curve stops, and replaced that curve with
it. In the tangency-labs#2089 crease round the corner vertex then lay 0.15 off the
r 2 round's rail and the next corner edge found no curve (fillet code 3).
A crossing branch the marcher's curve covers except inside the band
where the surfaces are within tolerance of each other is now dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXj2sJf943y2dDF36Vy
@brett19
brett19 marked this pull request as ready for review October 31, 2026 22:27

@bherbruck bherbruck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by the automated first-pass review: CI green, mergeable, no CI/build/dependency file changes, no red-flag patterns in added code (process/network/env/unsafe outside FFI/blobs/hidden unicode), 0 known-mismatch entries added. Logic is gated by CI and the difftest merge queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXj2sJf943y2dDF36Vy
@bherbruck

Copy link
Copy Markdown
Collaborator

@brett19 this PR is green and approved, but your last comment (2026-10-31 21:26 UTC) says you were closing it because #2089 doesn't reproduce in solidcore. Since then you've merged main into it twice (22:07 and 06:48 UTC), so we're not sure which you intend. It's on our automerge hold list until you say. Should it merge as an opt-in fix for WR-75, or are you closing it? (Its "Fixes #2089" is fine either way, since you opened #2089.)

@jyviko

jyviko commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks, brett19. The tracer is touched by the #2243 port (the tangent end as an event), so please re-check this on top of it.

@brett19

brett19 commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@bherbruck Thanks for flagging this. The 2026-10-31 21:26 comment is out of date. After it, #2089 was reproduced in solidcore: the failing body is the r 2 round as a B-spline surface, which is SolidCraft's flat round trip. The PR was then reopened with that fix, tested at 82ac4af. The intent is to merge it as an opt-in fix under ssi_tangent_curve_tracer (WR-75), with the WR-75 addendum it carries. With the flag off, nothing changes. The regression test is crates/solidcore/tests/issue_2089_tangent_tracer_crease_round.rs.

@jyviko Noted. #2101 changes only FindTangentCurves' crossing-branch keep test (tangent_curves.rs). The #2243 port PRs I can see (#2245, #2246) don't have files pushed yet. Once the tracer part of #2243 is on main or on a pushed branch, I'll merge it into #2101, re-run the #2089 test and the flag-on cases, and post the result here. Whichever lands second gets the merge.


Written by Claude Code (Anthropic) on behalf of @brett19.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtwSrdwZxqTQp5MfnU
@brett19

brett19 commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@jyviko I re-checked this on top of the #2243 ports. #2245 and #2246 are merged, and I merged main into #2101 at 5543e83. Neither of them, nor draft #2248, touches tangent_curves.rs, so they don't overlap #2101's change. issue_2089_tangent_tracer_crease_round passes on the merge (2/2). CI is re-running. If #2248 picks up a tracer change, I'll re-check it then too.


Written by Claude Code (Anthropic) on behalf of @brett19.

@bherbruck
bherbruck added this pull request to the merge queue Nov 1, 2026
Merged via the queue into tangency-labs:main with commit 4072cf2 Nov 1, 2026
13 checks passed
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.

ssi_tangent_curve_tracer on: a crease round fails with code 3 and builds without it

3 participants