Add bulk UV sampler, TKHelix and MakeSphere (8.0.1.2)

- n3xd_ocp.sample.face_grid: a face's UV grid of points and outward
  normals in one GIL-free call, sampling exactly where np.linspace does
  so a caller's fitted surface does not move.
- n3xd_ocp.helix: OCCT 8.0's TKHelix, which upstream does not bind at
  all. Takes Python lists rather than NCollection_Array1. Two things the
  header does not say, both found by probing: SetParameters wants N+1
  diameters for N segments (one per boundary, so a taper interpolates),
  and the builder is right-hand only -- a negative pitch is error status
  12, not a mirrored helix.
- Bind BRepPrimAPI_MakeSphere and give inventory.py an EXTRA_SYMBOLS
  addendum for symbols no app source imports. assay's gen_flow_fixtures
  has been unrunnable since the 10C cutover for want of it; the gap was
  wider than --check, since sigdiff is inventory-driven too.

Gates: 105 tests, 139/139 symbols, sigdiff clean, ASAN clean, wheel
self-contained with no libGL/libX11 DT_NEEDED.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HbTQ2HYWQwdtGmGJwypt6Z
This commit is contained in:
2026-08-11 16:26:20 +02:00
parent 8175b8aff3
commit 9f86845c25
13 changed files with 573 additions and 8 deletions

View File

@@ -162,9 +162,28 @@ would put a bare module in `sys.modules`, and a later `import n3xd_ocp`
would then skip its `__init__.py`.
Shipped today: `bintools` (shape ↔ `bytes`, byte-identical to
`OCP.BinTools`), `measure` (batched per-face area and centroid) and `tess`
(triangulated meshes and edge polylines) — see their `.pyi` stubs for full
signatures, or the [usage examples](../README.md#usage) for a quick start.
`OCP.BinTools`), `measure` (batched per-face area and centroid), `tess`
(triangulated meshes and edge polylines), `sample` (a face's UV grid of
points and normals) and `helix` (OCCT 8.0's TKHelix builder) — see their
`.pyi` stubs for full signatures, or the
[usage examples](../README.md#usage) for a quick start.
The array extractors all reproduce the Python loop they replace exactly,
including its quirks, because their callers key on them: `tess` keeps the id
gap left by an untriangulated face, and `sample` samples the way
`numpy.linspace` does — endpoint forced onto the bound rather than
`start + (n-1)*step` — so the surface a caller fits does not move.
`helix` is the one module with no upstream counterpart to match: TKHelix is
new in OCCT 8.0 and `cadquery-ocp` is still on 7.9.3, so a 1:1 surface would
be invented rather than reproduced. It takes Python lists and builds the
`NCollection_Array1` internally, which also avoids binding that template for
one caller. Its parameter shape is not in the OCCT header and cost a probe to
find: for **N segments** `SetParameters` wants N pitches, N turn counts and
**N+1 diameters**, one per segment *boundary*, so consecutive diameters that
differ taper across that segment. Anything else is a
`Standard_ConstructionError` reading only "wrong array dimension", so the
binding checks the shape first and says what it wanted.
## Matching upstream, and how that's checked