Skip to content

v0.4.0 — Swift port: AIS-shaped tools (45 tools)

Choose a tag to compare

@gsdali gsdali released this 03 May 10:34
· 295 commits to main since this release
257863a

What's new

The first release where the Swift port goes beyond Node-side parity. Eight net-new tools surface OCCTSwiftAIS's high-level scene-management primitives to the LLM — selection-from-topology with stable IDs, scene-level dimensions, scene primitives (Trihedron / WorkPlane / Axis / PointCloud), and three composition tools that stitch the foundation together.

Tool Notes
select_topology Pick faces / edges / vertices / whole-bodies by criteria. Returns server-tracked sel:<bodyId>#<kind>[<idx>] IDs + an anchor snapshot
remap_selection Walk selectionIds across a scene mutation via closest-centroid heuristic. Returns `fate: preserved
add_dimension Linear / angular / radial dimensions computed from selectionIds, persisted to <output_dir>/annotations.json
add_scene_primitive Trihedron / WorkPlane / Axis / PointCloud as scene-graph annotations
remove_scene_annotation Clean up by id
show_bounding_box Wraps Shape.bounds, registers as a boundingBox primitive
diff_overlay Tinted markers at affected body bboxes after a recent mutation (added=green, removed=red, changed=yellow)
select_by_feature Composes recognize_features + SelectionRegistry — every detected hole / pocket becomes a face-level selectionId

Architecture additions

SelectionRegistry (actor)

Sources/OCCTMCPCore/SelectionRegistry.swift — server-side store of named topology picks. selectionId format sel:<bodyId>#<kind>[<idx>] is self-describing and parseable; the registry caches resolved anchor metadata (centroid, normal, area / length, surface / curve type) so subsequent tools don't need to re-load the BREP.

<output_dir>/annotations.json sidecar

Sources/OCCTMCPCore/Annotations.swift — manifest schema is left untouched. Carries dimensions[] and primitives[]; AnyCodable lets per-kind primitive params land without per-kind concrete structs. OCCTSwiftViewport could opt-in to read it later.

Counts

  • 45 tools registered (was 37 in v0.3)
  • 18 swift-testing cases — per-tool tests for the v0.4 surface land alongside the v0.5 render integration

Deferred to v0.5

  • Render-overlay integration — render_preview doesn't yet draw the sidecar. The geometry generation belongs in OCCTSwiftViewport's OffscreenRenderer rather than per-call OCCT primitive synthesis here.
  • OCCT history-based remap — the position-matching heuristic in remap_selection is good for transforms but loses single→N mappings (fillet edge splits, boolean face splits). v0.5 could opt-in per-mutation history capture matching AIS's TopologyGraph.findDerived approach.

Install

Swift

swift build -c release

.mcp.json:

{ "mcpServers": { "occtmcp": { "command": "/path/to/OCCTMCP/.build/release/occtmcp-server" } } }

Node (still ships every tool)

npm install && npm run build
{ "mcpServers": { "occtmcp": { "command": "node", "args": ["/path/to/OCCTMCP/dist/index.js"] } } }

Hold-points before SPI submission

Unchanged from v0.3:

  1. OCCT 8.0.0 GA (scheduled 2026-05-07) and OCCTSwift 1.0
  2. OCCTSwiftScripts v0.9 tag — Package.swift still uses branch("main") for that dep