Skip to content

fix(#597): GeomFill_Sweep reports the achieved C1-conversion error, not the request - #757

Merged
gsdali merged 2 commits into
refactor/381-pass1bfrom
fix/597-geomfill-sweep-error-overwrite
Aug 7, 2026
Merged

fix(#597): GeomFill_Sweep reports the achieved C1-conversion error, not the request#757
gsdali merged 2 commits into
refactor/381-pass1bfrom
fix/597-geomfill-sweep-error-overwrite

Conversation

@gsdali

@gsdali gsdali commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Kernel half of #597. The bridge half is closed out (PR #741 fixed OCCTGeomFillSweep's own gate;
PR #751 investigated the two remaining bridge sites and found both obvious fixes broke real tests).
This addresses the kernel defect the issue's own comments re-scoped it to.

GeomFill_Sweep::BuildAll measures the swept surface's real error at GeomFill_Sweep.cxx:286
(SError = Approx.MaxErrorOnSurf();). When ForceApproxC1 forces a re-approximation through
GeomConvert_ApproxSurface, the branch finishes at line 325 with SError = theTol;, overwriting
the measured error with the requested tolerance (a literal 1.e-4) instead of reading
ConvertApprox.MaxError(), which reports what the conversion actually achieved and sits two lines
above, unread.

CError's four literal 0. entries a few lines above are left untouched (no fabrication, per #726:
no 2D curve error is available from GeomConvert_ApproxSurface at this point).

What's included

  • Scripts/patches/0025-GeomFill_Sweep-report-achieved-conversion-error-597.patch, one line, applies
    cleanly to both our V8_0_1 pin and upstream master (b8f597c6), clang-format-clean.
  • Scripts/repro/597-geomfill-sweep-error-overwrite/ — runnable probe, before/after transcripts, and
    the fixture-derivation writeup (getting a repro to fire needs a spine with a C0 corner inside one
    edge, not at a vertex, since BRepFill_Sweep splits at vertices).
  • Scripts/patches/README.md and CLAUDE.md entries following the established pattern for prior
    carried patches (0019-0024).
  • Scripts/repro/597-geomfill-sweep-error-overwrite/draft-pr.md: a drafted, unsent upstream PR
    body, per okf/policies/upstream-occt-style.md. No write of any kind was made to
    Open-Cascade-SAS/OCCT.

Patch 0025 is override-link validated only (no full xcframework rebuild), same as 0022-0024.
As of this PR, Package.swift pins v2.0.0-kernel.1 (eleven patches); 0022-0025 are carried in
the tree but outside that binary. PR #754 (open) re-pins to v2.0.0-kernel.2 with all fourteen
(0010-0012, 0014-0024); once that merges, 0025 becomes the sole patch left outside the pin,
which docs/v2.0.0-plan.md's RESOLVED block already names by number ahead of time.

SemVer impact

None. This changes only a diagnostic value (GeomFill_Sweep::ErrorOnSurface(), surfaced as
PipeShellBuilder.errorOnSurface) from a hardcoded constant to a measured one; no public Swift API
signature changes, and no existing test asserts a specific numeric value for it.

Test plan

  • python3 Scripts/check-bridge-index.py / check-null-handle-guards.py /
    check-docs-defaults.py / derive-bridge-header-split.py --verify /
    count-operations.py: all clean (no Sources/Tests touched).
  • Override-link validation against the real BRepFill_PipeShell/GeomFill_Sweep object:
    ErrorOnSurface() moves from 0.0001 to 2.54714; returned geometry and independent
    deviation measurements byte-identical before/after.
  • Patch applies cleanly (git apply --check -p1) to the pinned V8_0_1 tag and upstream
    master (b8f597c6); clang-format --dry-run --Werror clean.
  • Full swift test / kernel rebuild deferred to the next pin cycle (consistent with 0022-0024;
    no Swift/bridge source was touched, so no regression is expected).

Closes #597

gsdali added 2 commits August 7, 2026 18:33
…ot the request

The bridge half of #597 is closed out (PR #741/#751); this is the kernel half the
issue's own comments re-scoped it to. GeomFill_Sweep::BuildAll measures the swept
surface's real error, but when ForceApproxC1 forces a re-approximation through
GeomConvert_ApproxSurface, it finishes with SError = theTol (the requested 1e-4)
instead of reading ConvertApprox.MaxError(), which reports what the conversion
actually achieved and sits two lines above, unread.

Confirmed MaxError() is the right quantity to report (its Surf argument IS the
surface being replaced, unlike the #571 trap where an intermediate object was
measured instead) and that it moves post-#522 (2.54714 measured vs the stock
0.0001, matching #572's independent measurement of the same fixture). Validated
via override-link against the real BRepFill_PipeShell/GeomFill_Sweep object:
ErrorOnSurface() goes from 0.0001 to 2.54714, every other value (returned
geometry, independent deviations) byte-identical, confirming this is a
diagnostic-only fix that changes no caller's returned shape. No bridge site
gates on this number today, so swift test is unaffected.

Patch 0025 is override-link validated only (no full xcframework rebuild), same
as 0022-0024. Upstream PR drafted, not sent, per okf/policies/upstream-occt-style.md.

Closes #597
…the writeup

No prose content change, just punctuation: replaced every "—" and " -- " used as
a sentence dash with a comma, colon, semicolon, or parentheses. Also regenerated
the harness transcripts after editing two printf strings.
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.

1 participant