Combine shapes
Add, subtract and intersect solids the way you think about them.
.subtracting { … }
import Cadova
Cadova is a Swift library for building precise, parametric 3D models in code, with a focus on 3D printing. Your models are plain Swift: easy to version, reuse and extend, and as expressive as the language itself.
Every shape in Cadova is a value you can compute with. Drag the orange numbers, or click one and use the arrow keys. Each variant below was built by Cadova from this exact code.
1import Cadova
2
3await Model("vase") {
4 RegularPolygon(sideCount: 6, circumradius: 22)
5 .rounded(radius: 5)
6 .extruded(height: 70, twist: 120°)
7 .colored(.tomato)
8}
Curious, but not ready to set anything up? The Cadova Playground is a quick way to get a feel for Cadova in your browser. Open an example or start from scratch, write some code, and watch the model update as you type. When you want to build something real, install Cadova and take it from there.
The same few ideas scale from a single part to complete projects. Every model here is Cadova code, several of them open source.
Spur, helical, bevel and planetary gears that mesh exactly, with Engage.
Frame, carriages, effector and covers: a complete printer, all in Swift.
Chassis, steering geometry and in-wheel planetary hub motors.
Tubes, lugs and dropouts placed from a single geometry configuration.
Real threads, bolts, nuts and threaded holes, with Helical.
Slice into any model with Cadova Viewer’s interactive cross-sections.
Hollowed with offset, pierced with repeated, and given a swept handle.
A two-player game, ready to print, with pips in a second color.
Add, subtract and intersect solids the way you think about them.
.subtracting { … }
Round, offset and trim profiles, then extrude, twist or revolve them.
.extruded(height: 70, twist: 120°)
Sweep a profile along a Bézier path, or blend between cross-sections.
.swept(along: path, …)
Fillet and chamfer edges, and keep holes printable without supports.
.shapingEdges(.fillet(radius: 2), …)
Export 3MF with separate parts and colors, straight into your slicer.
.withMaterial(.brass)
Write and build models on macOS, Linux and Windows.
swift run
A native macOS viewer for 3MF that reloads the moment your model is regenerated. Slice it with cross-sections, measure it, and look at it from several angles at once.
Download for macOSGenerate and preview models without leaving your editor, on macOS, Linux and Windows. The preview updates as you save, with parts, measuring and cross-sections.
Get it from the MarketplaceMark the values people should be able to change with @Parameter, run one command, and Cadova turns your model into a web page with sliders, switches and a live 3D preview. Visitors set it up the way they need and download a file for their slicer, no Swift required.
The model runs in the visitor’s browser, so the page is just static files you can put on any host. Cadova’s GitHub action can publish it to GitHub Pages every time you push.
More examples: a keystone patch panel and a QR code sign.
await Model("scoop") {
@Parameter("Volume", in: 20...100, unit: "ml")
var volume = 30.0
@Parameter("Hanging hole")
var hangingHole = true
Scoop(volume: volume, hangingHole: hangingHole)
}
$ swift package generate-customizer
A tutorial series from your first model to paths, lofts and sweeps, each episode about two minutes long. The code from every episode is on GitHub, ready to run.
.package(
url: "https://github.com/tomasf/Cadova.git",
from: "1.0.0"
)
import Cadova
await Model("gizmo") {
Box([10, 10, 5])
.subtracting {
Sphere(diameter: 10)
.translated(z: 5)
}
}
$ swift run
Open Models/gizmo.3mf in Cadova Viewer or your slicer. Edit, save, run again, and watch it update.