Skip to content

v0.5.0 — Source-shape vertex convention (closes #10)

Choose a tag to compare

@gsdali gsdali released this 03 May 07:37
· 18 commits to main since this release
8dd65b1

Pre-1.0 behaviour change. Closes #10.

Converges ViewportBody.vertices / vertexIndices / CADBodyMetadata.vertices on the source-shape convention so AIS' Selection.vertices (and any other consumer) can round-trip a picked primitiveIndex back to a TopoDS_Vertex via shape.vertex(at: primitiveIndex). v0.4.1's polyline-endpoint convention rendered the same number of points for typical solids but in a different order, breaking that round-trip.

What changed at runtime

  • body.vertices is now shape.vertices() Float-converted (was: deduplicated polyline endpoints).
  • body.vertexIndices is now the explicit identity array [0, 1, …, n-1] (was: empty, treated as identity by the renderer). Belt-and-braces against future renderer changes that drop the empty-as-identity interpretation.
  • CADBodyMetadata.vertices aligned to the same source — single source of truth.

No public API signature changes. The init shapes are unchanged; what's different is what populates them.

AIS coordination

No breakage window. AIS v0.6.1 currently overrides body.vertices and body.vertexIndices itself in InteractiveContext.display(_:) to fix the round-trip. Once consumers upgrade to OCCTSwiftTools v0.5.0, AIS can drop that override — both sides will be writing identical data, so the transition is non-breaking.

Internal cleanup

Dropped the private deduplicateVertices(from:) helper (dead code post-convergence).

Dependencies (unchanged)

  • OCCTSwift0.168.0
  • OCCTSwiftViewport0.55.0

Test invocation

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

35 tests across 8 suites, all green.

Installation

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