fix(#597): GeomFill_Sweep reports the achieved C1-conversion error, not the request - #757
Merged
gsdali merged 2 commits intoAug 7, 2026
Merged
Conversation
…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.
This was referenced Aug 7, 2026
Closed
Closed
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.
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::BuildAllmeasures the swept surface's real error atGeomFill_Sweep.cxx:286(
SError = Approx.MaxErrorOnSurf();). WhenForceApproxC1forces a re-approximation throughGeomConvert_ApproxSurface, the branch finishes at line 325 withSError = theTol;, overwritingthe measured error with the requested tolerance (a literal
1.e-4) instead of readingConvertApprox.MaxError(), which reports what the conversion actually achieved and sits two linesabove, unread.
MaxError()is the right quantity, not another GeomPlate_MakeApprox drives the #522 approximator directly, and no census counts it #571-style trap.GeomConvert_ApproxSurface'sSurfargument here ismySurface, the exact surface being replaced, unlikeGeomPlate_MakeApprox::ApproxError()(which measures an intermediate object and broke 6/6 real tests when gated on in PR investigate(#597): the two remaining bridge-side sites cannot be fixed by rejecting on error #751). Verified by reconstructing the identicalGeomConvert_ApproxSurfacecall from outside the kernel: its output matches the real forced build's degree/pole counts exactly, and independent geometric deviation measurements from the same baseline are bit-identical either way.0019(GeomConvert_ApproxSurface at GeomAbs_C0 returns a degree-1 collapse while reporting IsDone and a maxError five orders of magnitude too small #522) is what makes this possible; before it, every interior truncation error was structurally zero. MeasuredMaxError() = 2.54714against the pinned kernel, matching Did the sweep / offset / unify / convert consumers move when #522 made truncation errors real? #572's own independent measurement of the identical fixture (2.547) to the printed digit, 25000x the stock0.0001.BRepFill_PipeShell/GeomFill_Sweep, not just the externally-reconstructed prediction):ErrorOnSurface()goes from0.0001to2.54714. Every other value the harness prints (returned surface geometry, both independent deviations) is byte-identical before and after, confirming this is a diagnostic-only fix that changes no caller's returned shape.PipeShellBuilder.errorOnSurfaceis info-only, andOCCTGeomFillSweep's own error gate (PR fix(#725,#597,#689): reject rational Bezier joins, fix tolerance-blind sweep, fix networkSurface #741) never setsForceApproxC1so never reaches this branch.CError's four literal0.entries a few lines above are left untouched (no fabrication, per #726:no 2D curve error is available from
GeomConvert_ApproxSurfaceat this point).What's included
Scripts/patches/0025-GeomFill_Sweep-report-achieved-conversion-error-597.patch, one line, appliescleanly to both our
V8_0_1pin and upstreammaster(b8f597c6),clang-format-clean.Scripts/repro/597-geomfill-sweep-error-overwrite/— runnable probe, before/after transcripts, andthe fixture-derivation writeup (getting a repro to fire needs a spine with a C0 corner inside one
edge, not at a vertex, since
BRepFill_Sweepsplits at vertices).Scripts/patches/README.mdandCLAUDE.mdentries following the established pattern for priorcarried patches (
0019-0024).Scripts/repro/597-geomfill-sweep-error-overwrite/draft-pr.md: a drafted, unsent upstream PRbody, per
okf/policies/upstream-occt-style.md. No write of any kind was made toOpen-Cascade-SAS/OCCT.Patch
0025is override-link validated only (no full xcframework rebuild), same as0022-0024.As of this PR,
Package.swiftpinsv2.0.0-kernel.1(eleven patches);0022-0025are carried inthe tree but outside that binary. PR #754 (open) re-pins to
v2.0.0-kernel.2with all fourteen(
0010-0012,0014-0024); once that merges,0025becomes 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 asPipeShellBuilder.errorOnSurface) from a hardcoded constant to a measured one; no public Swift APIsignature 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).BRepFill_PipeShell/GeomFill_Sweepobject:ErrorOnSurface()moves from0.0001to2.54714; returned geometry and independentdeviation measurements byte-identical before/after.
git apply --check -p1) to the pinnedV8_0_1tag and upstreammaster(b8f597c6);clang-format --dry-run --Werrorclean.swift test/ kernel rebuild deferred to the next pin cycle (consistent with0022-0024;no Swift/bridge source was touched, so no regression is expected).
Closes #597