Skip to content

v1.0.1 — TopologyGraph.rootNodes fix

Choose a tag to compare

@gsdali gsdali released this 08 May 11:44
· 116 commits to main since this release

v1.0.1 — TopologyGraph.rootNodes fix + test repair

Bug fix

TopologyGraph.NodeKind was missing the product = 10 and occurrence = 11 raw values from OCCT's BRepGraph_NodeId::Kind enum, so TopologyGraph.rootNodes silently returned [] even when products were present:

return (0..<count).compactMap { i in
    guard let kind = NodeKind(rawValue: kinds[i]) else { return nil }   // returns nil for raw 10/11
    return RootNode(kind: kind, index: Int(indices[i]))
}

After OCCT 8.0.0 beta1 reshaped root iteration to "Products only" (Kind = 10), every rootNodes consumer hit this and silently lost data. Fixed by extending NodeKind to cover the full BRepGraph_NodeId::Kind range:

Case Raw OCCT enum
solid 0 topology
shell 1 topology
face 2 topology
wire 3 topology
edge 4 topology
vertex 5 topology
compound 6 container
compSolid 7 container
coedge 8 face-context
product 10 (new) assembly
occurrence 11 (new) assembly

Slot 9 is reserved upstream for future topology extension.

Tests repaired alongside the fix

The four pre-existing failures shipped with v1.0.0 are now passing:

  • hasRoots / childExplorer wrap the box's solid in a Product via linkProductToTopology(shapeRootKind: 0, shapeRootIndex: 0) before querying rootNodes (matches OCCT 8.0 GA assembly semantics; a plain Shape.box() has no Product, so RootProductIds() is empty by design).
  • edgeVertexDistance switched from low-level BRepExtrema_DistanceSS (which deliberately skips edge-vertex pairs whose closest point falls at an edge's endpoint-vertex — it expects the caller to pair vertices-with-vertices separately) to the high-level Shape.distance(to:) API backed by BRepExtrema_DistShapeShape, which orchestrates all subshape combinations including endpoint cases.
  • edgeSelectorFeatureUnsupported deleted — it asserted Fillet.onFeature was unsupported, contradicting the newer filletOnFeature test that asserts the opposite. .onFeature is wired up in FeatureReconstructor since v0.143.

Binary

xcframework binary is unchanged from v1.0.0. SPM consumers using the remote URL continue resolving against the v1.0.0 asset (Package.swift URL/checksum unchanged). No need to re-download anything; SPM picks up the Swift-side fix directly from this tag.

🤖 Generated with Claude Code