OCCTSwift documentation
A comprehensive Swift wrapper for OpenCASCADE Technology (OCCT 8.0.1), B-Rep solid modeling, CAD data exchange, meshing and geometry for macOS and iOS. visionOS and tvOS are declared and buildable but untested, and need a local kernel rebuild (#978). Three-layer architecture: Swift public API → Objective-C++ bridge → OCCT C++. 4,365 wrapped operations.
import OCCTSwift
guard let box = Shape.box(width: 10, height: 10, depth: 10),
let cyl = Shape.cylinder(at: SIMD3(0, 0, -8), direction: SIMD3(0, 0, 1),
radius: 3, height: 16) else { return }
let drilled = box.subtracting(cyl) // a box with a through-hole
try drilled?.writeSTEP(to: outputURL) // exact B-Rep, ready for CAD/CAM
Cookbook
Task-oriented, example-rich guides, each a short bit of prose plus runnable Swift and a rendered figure (interactive 3D where it helps). The Cookbook index lists all areas:
Booleans · Threads · Helices & Springs · Lofting & Sweeps · Helical Sweeps · Healing & Validity · Meshing & Export · XCAF Assemblies · BRep Graph · Gordon Surfaces · Surfaces from Points · Working with Meshes
Reference
- API Reference: the detailed, per-type function reference: signatures, parameters, the OCCT class each method wraps, and runnable examples. Built progressively (Wire, Edge, Face, Mesh, Exporter, ThreadFeatures so far).
- API Map (Swift ↔ OCCT), the compact operation-to-OCCT-class mapping table.
- Changelog, release-by-release history.
Guides & concepts
- OCCT Concepts, B-Rep topology, handles, shapes primer.
- Consuming the package, what your own target has to set, and the two requirements on any file of yours that includes an OCCT header (#967).
- Architecture, the three-layer design and memory model.
- Adding Features, bridge header → impl → Swift → test.
- Building OCCT, rebuild the
OCCT.xcframeworkfrom source. - Sharing the xcframework, one shared local copy across repos + the
Package.resolvedpin footgun (#260). - Thread Safety · Bridge Diagnostics · Naming Conventions · Versioning (SemVer) · Ecosystem
- v4.0.0 Release Plan, scope, order, and beta/RC criteria for the in-flight major.
- v2.0.0 Release Plan, scope, clusters, and the census-once rule the previous major shipped under.
Project
- Source & issues: github.com/gsdali/OCCTSwift
- Install via Swift Package Manager, pin
from: "3.0.0"(SemVer-stable since v1.0.0;from: "1.0.0"resolves to the 1.x line and never reaches 3.x).