v1.2.0 — TopologyGraph attribute store + Codable snapshot
v1.2.0 — TopologyGraph attribute store + Codable snapshot (closes #168)
MINOR — additive new public API. No breaking changes; safe to take blindly within the v1 line.
TopologyGraph nodes were bare (kind, index) pairs with no payload, and the type had no
serialization (it wraps an opaque C++ handle). This adds a pure Swift-side sidecar so callers can
attach arbitrary typed metadata to any NodeRef and round-trip a whole session. No C++ bridge
change — the store never touches the C++ graph.
extension TopologyGraph {
public var attributes: NodeAttributeStore
public func attribute(_ key: String, for: NodeRef) -> AttrValue?
public func setAttribute(_ key: String, _ value: AttrValue, for: NodeRef)
public func snapshot() throws -> GraphSnapshot
public convenience init(snapshot: GraphSnapshot) throws
}AttrValue— closed Codable enum:bool/int/double/string/ints/doubles
(intsfor mesh-region index sets,doublesfor fitted-surface params).NodeAttributeStore— Codable, keyed byNodeRef; encodes as sorted arrays for
deterministic element order. Pair withGraphSnapshot.canonicalEncoder()(.sortedKeys) for
byte-stable, diffable output.GraphSnapshot— Codable round-trip. The graph structure is re-derived by rebuilding from
the source shape's BREP (captured at construction); rebuild pinsparallel: false. A determinism
test verifiesNodeRefindexing is stable across rebuilds.NodeKind/NodeRefgainCodable.
Foundation for the OCCTReconstruct mesh-to-solid
pipeline (per-node fit residual / confidence / provenance + session persistence) and OCCTMCP's
planned reconstruct_* graph read/write tools (OCCTMCP #33).
xcframework unchanged — pure Swift addition. 7 new tests; all 124 TopologyGraph tests pass.