Repository navigation
Flat arrays: a Ball patch goes through as itself, its sphere kept (the shell of a fully rounded box builds again) - #121
Merged
Conversation
…at the front, in process and through the flat arrays (failing) The shell of the rounded box held in process builds (the rounds and balls collapse, the cavity the sharp box 36 x 28 x 56): a regression guard in the shell block. Through the flat arrays first, as SolidCraft keeps a body between commands, the corner faces come back without their spheres and the shell fails with status 1034: listed as a Ball case known to fail, with its reason. Refs #102 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT
…d, its sphere as its definition, and refuse one its net is not on (failing) smlib.h gains the kind SMLIB_FLAT_SURFACE_BALL_PATCH (6) and the arrays a surface's definition rides in beside its net: FACE_DEFINITION_REAL_COUNT (int64, id 36, per face whose kind has one) and FACE_DEFINITION_REALS (double, id 166; a ball patch's center and radius). The round-trip case now checks them: eight ball patches, each with its corner's center and radius 1.5, and an import whose radius is 1e-9 off its net refused. Export writes none yet: still listed as failing. flat_roundtrip's id ranges take the two new ids (int64 1..36, double 101..166; 37 and 167 now the first that name no array). Refs #102 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT
… kept, and the shell of a box rounded all round builds again Export writes an SmBallPatch face as SMLIB_FLAT_SURFACE_BALL_PATCH: its net as a NURBS face's block (range and trims in its parameters), its sphere's center and radius as its definition. Import takes it back as that patch only when SmBallPatch::IsOnSphere certifies the net: over each Bezier piece (interior knots raised to the degree) every Bernstein coefficient of |X - C W|^2 - R^2 W^2 is zero to 1e-12 of ((R + |C|) max W)^2, rounding at the part's scale, decided on the net, not at sample points; otherwise the B-rep is refused (1007). Before, the patch came back a bare SmBSplineSurface: its offset 2 in did not collapse (SmBSplineSurface has no OffsetCollapses), the rounds' beside it did, and the shell left 23 edges unbridged (status 1034). Before the Ball the corners were SmSphere, which the arrays keep, and the shell built. The round-trip case now passes: eight ball patches with their corners' spheres, a radius 1e-9 off refused, a net cut by inserted knots still certified and not on a sphere 1e-9 larger, and the shell's volume 15305.435784173 against 15305.435766881 (1.1e-9). Refs #102 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT
…ADME); the blend page's status as SMLib construction ends - CHANGELOG.md: an Unreleased section, with the flat arrays' new surface kind 6 and definition arrays 36 and 166, the import certificate, and what a reader that doesn't know kind 6 must do. - capi/README.md: the flat arrays' definitions, and an entry under the changes from upstream. - docs/generic-blend.md section 6: step 4's merged pieces (#79, #104, #110, #113) and those landing (#81, #86, #82); step 7 with #102; the open-work table says where each item continues (SMLib, or its solidcore issue) now that SMLib construction has ended (owner, 2026-11-02). Refs #102 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT
jyviko
force-pushed
the
fix102-flat-ball-patch
branch
from
November 2, 2026 08:06
4e8e471 to
9bb0459
Compare
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.
Closes tangency-labs/solidcore#102 (its flat part; USD is a follow-up in tangency-labs/solidcraft#13826).
The defect. SMLib's Ball corner is an
SmBallPatch, a rational patch that carries its sphere (centre and radius) as its definition, so its offset is exact. The C API's flat arrays wrote it as plain NURBS and read it back as anSmBSplineSurface, which lost the sphere. A box rounded all round and then shelled through the flat arrays therefore failed with status 1034: the corners no longer collapsed exactly under the offset. SolidCraft keeps bodies in the flat arrays between commands, so its develop went red on exactly this case.The fix.
SMLIB_FLAT_SURFACE_BALL_PATCH = 6. It carries its NURBS block as a NURBS face does, plus a per-face definition record:SMLIB_FLAT_FACE_DEFINITION_REAL_COUNT = 36: 4 for a ball patch;SMLIB_FLAT_FACE_DEFINITION_REALS = 166: cx, cy, cz, R.SmBallPatchonly afterIsOnSpherecertifies its net. That is an exact Bernstein identity per Bézier piece, to 1e-12 of ((R + |C|)·maxW)². A net that fails is refused (1007).Tests (failing first):
Docs: the CHANGELOG,
capi/README.md(the flat definitions), anddocs/generic-blend.md§6 (status).Gate (aarch64 box, against a fresh dda881f reference): ctest 22/22, default 0, all 8 known-failing lists exit 0. The only moved lines are the new cases' own.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ