Skip to content

v1.0.2 — per-input boolean history (issue #165 Tier 1)

Choose a tag to compare

@gsdali gsdali released this 09 May 02:32
· 113 commits to main since this release

v1.0.2 — per-input boolean history (issue #165 Tier 1)

Additive feature

Adds a per-input-subshape history lookup surface to the four BRepAlgoAPI boolean ops, addressing OCCTMCP's remap_selection need to walk selection IDs across boolean / split mutations exactly (instead of the centroid-distance heuristic that loses on splits / merges / deletions).

extension Shape {
    func unionWithFullHistory(_ other: Shape) -> (result: Shape, history: ShapeHistoryRef)?
    func subtractedWithFullHistory(_ tool: Shape) -> (result: Shape, history: ShapeHistoryRef)?
    func intersectionWithFullHistory(_ other: Shape) -> (result: Shape, history: ShapeHistoryRef)?
    func splitWithFullHistory(by tool: Shape) -> (pieces: [Shape], history: ShapeHistoryRef)?
}

public final class ShapeHistoryRef: @unchecked Sendable {
    public func record(of inputSubShape: Shape) -> ShapeHistoryRecord  // .modified / .generated / .isDeleted
}

public struct ShapeHistoryRecord: Sendable {
    public let modified: [Shape]   // 1:1 or 1:N replacements (e.g. a face split into 2)
    public let generated: [Shape]  // generated FROM the input (e.g. fillet faces from an edge)
    public let isDeleted: Bool
}

ShapeHistoryRef retains the OCCT builder so Modified / Generated / IsDeleted stay queryable after the operation. Existing BooleanResult / BooleanHistoryResult callers are unchanged — pure additive surface.

Bug fix folded in

The new probe-then-fill helpers originally returned 0 when called with maxCount=0 (or outRefs=null), breaking the Swift-side count-then-allocate idiom. Fixed: bridge functions now always return the full count and only stop writing when count >= maxCount. Existing callers unaffected.

Binary

xcframework unchanged from v1.0.0. SPM consumers using the remote URL continue resolving against the v1.0.0 asset; SPM picks up the Swift-side additions directly from this tag.

Looking ahead

Issue #165 Tiers 2 and 3 (filleted/chamfered/shelled/defeatured with history; FeatureReconstructor.BuildResult.history) are out of scope for this patch — separate follow-ups.

🤖 Generated with Claude Code