Skip to content

v0.6.1 — Renderer-backed per-triangle highlight overlay

Choose a tag to compare

@gsdali gsdali released this 03 May 06:56
· 19 commits to main since this release
b65be18

Adopts the renderer-backed per-triangle highlight overlay shipped in OCCTSwiftViewport v0.55.1 — closes #25. The v0.1 cheap-route normal-offset overlay is gone; InteractiveContext.updateSelectionVisuals now writes per-triangle TriangleStyle entries directly into the source body's triangleStyles array.

Behaviour changes (no public API change)

  • Face-level selection no longer spawns ais.overlay.sel.<UUID> overlay bodies. The renderer composites the highlight in a dedicated pass with depthCompareFunction = .lessEqual — no more silhouette flicker, no more body-count blow-up on multi-face selection.
  • ctx.bodies count after a face selection is now N (just source bodies), not 2N (source + overlay) as in v0.1 → v0.6. Consumers asserting body counts will see this drop.
  • setHighlightStyle rewrites triangleStyles in place.
  • display() no longer needs the "keep overlays trailing" pass.

Removed

  • InteractiveContext.makeFaceOverlay(...) and computeOverlayEpsilon(...) static helpers.
  • overlayBodyIDs: Set<String> private state.

Tools v0.4.1 coordination

OCCTSwiftTools v0.4.1 (between v0.6.0 and this release) populates body.vertices from polyline endpoints and leaves vertexIndices empty. AIS overrides both with shape.vertices() source-vertex positions so a vertex pick's primitiveIndex round-trips to a TopoDS_Vertex via Selection.vertices (shape.vertex(at: idx)). Tracked as OCCTSwiftTools#10 — once the conventions converge the AIS-side override drops.

Tests

HighlightOverlay suite renamed to FaceHighlight and rewritten in place. All assertions now check body.triangleStyles rather than overlay-body presence:

  • highlighted triangles match the selected face
  • no ais.overlay.* bodies spawn
  • multi-face / multi-body selections write styles on the right source bodies
  • clearSelection empties triangleStyles
  • setHighlightStyle updates colors live

Total: 146 across 12 suites (count unchanged; tests rewritten not added). Run with OCCT_SERIAL=1 swift test --parallel --num-workers 1.

Dependencies

Transitively pulls OCCTSwiftViewport ≥ 0.55.1 via OCCTSwiftTools ≥ 0.4.0; SPM resolves to the latest available.