Skip to content

v0.4.1 — AIS edge + vertex picking wired through

Choose a tag to compare

@gsdali gsdali released this 03 May 05:47
· 20 commits to main since this release
31fdb89

Wires AIS edge + vertex GPU picking through. OCCTSwiftViewport v0.55.0 added the renderer-side edge/vertex pick pipelines (viewport#24), but their body.edgeIndices / body.vertices gates meant our bodies showed up as face-pickable only. Closes #8.

What changed

CADFileLoader.shapeToBodyAndMetadata now populates the three new ViewportBody fields on every body it produces:

  • edgeIndices — flattened from metadata.edgePolylines via a new private flattenEdgeIndices(_:) helper. A polyline of N points contributes (N − 1) line segments, each tagged with the source edge's index — matching the renderer's flattened-line layout. Picked segment → TopoDS_Edge.
  • vertices — the deduplicated edge endpoints (same data as metadata.vertices).
  • vertexIndices — left empty. The renderer treats empty as identity (the pick result's primitiveIndex is the vertex index directly).

No public API surface change. Existing call sites get the new pick fields populated with no opt-in required.

Dependency floor

  • OCCTSwiftViewport0.55.0 (was 0.51.0) — required for the new edgeIndices / vertices / vertexIndices parameters on ViewportBody.init.
  • OCCTSwift0.168.0 — unchanged.

Test invocation

OCCT_SERIAL=1 swift test --parallel --num-workers 1

Suite: 33 → 35 across 8 suites (+2 new in CADFileLoaderTests: edge-index round-trip and vertex-pick wiring).

Installation

.package(url: "https://github.com/gsdali/OCCTSwiftTools.git", from: "0.4.1"),