Profile
Back to NewsBack
GitHub Trending 2 min
Reader Mode
tomasf/Cadova: Swift DSL for parametric 3D modeling

tomasf/Cadova: Swift DSL for parametric 3D modeling

Cadova

Cadova is a Swift library for creating 3D models through code, with a focus on 3D printing. It offers a programmable alternative to traditional CAD tools, combining precise geometry with the expressiveness and elegance of Swift.

Cadova models are written entirely in Swift, making them easy to version, reuse, and extend. The result is a flexible and maintainable approach to modeling, especially for those already comfortable with code.

Cadova runs on macOS, Windows, and Linux. To get started, read the Getting Started guide.

Full documentation, including What is Cadova?, is available at cadova.org/docs. See the wiki for related projects: the viewer app, libraries, and example models built with Cadova.

Swift</a> !Platforms

Example

await Model("Hex key holder") {
    let height = 20.0
    let spacing = 8.0
    Stack(.x, spacing: spacing) {
        for size in stride(from: 1.5, through: 5.0, by: 0.5) {
            RegularPolygon(sideCount: 6, widthAcrossFlats: size)
        }
    }.measuringBounds { holes, bounds in
        Stadium(bounds.size + spacing * 2)
            .extruded(height: height)
            .subtracting {
                holes.aligned(at: .centerX)
                    .extruded(height: height)
                    .translated(z: 2)
            }
    }
}
For more code examples, see Examples.

To preview your models, check out Cadova Viewer, a native macOS 3MF viewer that reloads automatically as your model regenerates.

Cadova uses Manifold-Swift, Apus, Pelagos, Nodal and ThreeMF.

Versioning and Stability

Cadova is currently in pre-release, with a version number below 1.0. The API is still evolving, but stability is maintained within each minor version — so upToNextMinor(from:) is recommended for your dependency. You're very welcome to start using Cadova today, and feedback is appreciated!

Contributions

Contributions are welcome! If you have ideas, suggestions, or improvements, feel free to open an issue or submit a pull request. You’re also welcome to browse the open GitHub issues and pick one to work on — especially those marked as good first issues or help wanted.

License

This project is licensed under the MIT license. See the LICENSE file for details.

Manifest template

// swift-tools-version: 6.3
import PackageDescription

let package = Package( name: "<#name#>", platforms: [.macOS(.v14)], dependencies: [ .package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.9.0")), ], targets: [ .executableTarget( name: "<#name#>", dependencies: ["Cadova"], swiftSettings: [.interoperabilityMode(.Cxx)] ), ] )

Our Related Projects
Farm Fresh Kikapu

An e-commerce platform for farm-fresh produce - an online st...

View Project
Chat with me