tomasf/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.
Example
<img src="https://github.com/user-attachments/assets/c8ae2128-621a-4d26-8f9a-1c277e525633" width="23%" align="right">
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.
Related Projects
- Cadova Viewer - A native macOS 3MF viewer application
- Helical - A Cadova library providing customizable threads, screws, bolts, nuts and related parts.
Cadova uses Manifold-Swift, Apus 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.1
import PackageDescription
let package = Package(
name: "<#name#>",
platforms: [.macOS(.v14)],
dependencies: [
.package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.6.0")),
],
targets: [
.executableTarget(
name: "<#name#>",
dependencies: ["Cadova"],
swiftSettings: [.interoperabilityMode(.Cxx)]
),
]
)Package Metadata
Repository: tomasf/cadova
Default branch: main
README: README.md