Commit Graph

5 Commits

Author SHA1 Message Date
Brett Lawson e0a1c10904 surface: keep a plane's or extrusion's made NURB on the surface, as GetOrCreateGwNurbPointer
BSplineSurface stores its NURB in a NurbSlot (a OnceLock) that read-only
queries can fill once from &self, as upstream's GetOrCreateGwNurbPointer
keeps a NURB made through a const_cast. Plane::base_with_nurb and
SurfOfExtrusion::base_with_nurb now make a missing NURB and keep it, so
IntersectWithPlane's has-NURB test, ToggleSwapUVBit, operator== and copies
see it. Plane::copy makes the source's NURB first and the source keeps it,
as the SmBSplineSurface copy constructor. Surface::kind_with_nurb fills the
extrusion's slot instead of the side memo; cone, sphere, torus and
revolution keep the whole-kind memo (their MakeNurb also rebuilds the polar
converter).

surface.plane_p1 drops its workarounds: the shim asks const queries of the
plane itself instead of a side-free copy, the state records whether the
plane holds its NURB, and ToggleSwapUVBit / operator== are generated
anywhere in a program.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtgaA54W2nr8dK1EYp
2026-10-27 11:34:21 +01:00
Alex Lytvynenko 2e0e38baa4 Serialize native shim calls around the shared API context
Guard common and handwritten entrypoints through native cleanup and callback restoration. Add exclusion, recursive forwarding and exception-unwind probes; p2 adds its concurrent cross-wrapper regression with the port.

Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
2026-10-17 20:33:34 +02:00
jijinbei 875291c4d9 shim: share identical C++ helpers through sc_sm.h, sc_nlib.h, sc_gw.h
125 shims carried private copies of the same small helpers (put_vec, st,
nl_status, Rd, dump_crv, read_nurb, ...). Move the most common, byte-identical
form of each into three headers grouped by the upstream API they need, and have
those shims pull them in with `using sc::<name>;`. Shims with a different
variant keep their own copy; files touched by open PRs are left alone.
`the_context()` stays per shim (its function-local SmContext must not be shared).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBLgPenT24P1dunqnZR1Dj
2026-10-17 06:43:03 +09:00
bherbruck b27857a3c3 surface.plane_p1 harness: guard upstream UB, exact copies, extend op, adversarial fixtures
Shim: Reverse/Rebuild report SM_ERR when no NURB can be made (upstream
dereferences NULL); side_free_copy keeps a degenerate placement exactly.
ffi: reject |n|^2 < 1e-24 normals (uninitialised axes upstream) and
non-positive extension distances (endless loop upstream). New Extend op
(both CreateExtendedSurface overloads), generated and in extend.json; the
reviewer's adversarial cases in zz_adv.json minus the zero normal and the
lazy-NURB sequences.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8ohWGLCzFPoZriCeSSero
2026-10-13 15:50:15 -04:00
bherbruck 5e87f54fff port: surface.plane_p1 (SmPlane part 1, partial)
Plane kind of Surface with constructors, evaluation, projection, MakeNurb,
DropPointFast, GlobalLineIntersect, TrimPlaneLineToPlaneDomain,
CreateIsoParametricCurve, DropCurve, CoincidenceCheck, Reparameterize,
ToggleSwapUVBit, RebuildSTEPFromNURBParameters and the re-dispatched
SmBSplineSurface methods; C++ shim, ffi binding, difftest runner and
fixtures. Wires the UNPORTED(surface.plane_p1) stubs in
nurbs.b_spline_surface_p1/p2.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8ohWGLCzFPoZriCeSSero
2026-10-13 14:48:19 -04:00