-
Notifications
You must be signed in to change notification settings - Fork 11
Examples
Tomas Franzén edited this page Jul 3, 2025
·
14 revisions

await Model("text") {
Text("Cadova")
.withFont("Futura", style: "Condensed Medium", size: 10)
.wrappedAroundCircle(spanning: 230°..<310°)
.aligned(at: .centerX, .bottom)
.swept(along: BezierPath {
curve(controlX: 20, controlY: 10, controlZ: 3, endX: 20, endY: 30, endZ: 12)
})
}
await Model("loft") {
Loft(.resampled(.easeInOut)) {
layer(z: 0) {
Ring(outerDiameter: 20, innerDiameter: 12)
}
layer(z: 30) {
Rectangle(x: 25, y: 6)
.aligned(at: .center)
.cloned { $0.rotated(90°) }
.subtracting {
RegularPolygon(sideCount: 8, circumradius: 2)
}
}
layer(z: 35) {
Ring(outerDiameter: 12, innerDiameter: 10)
}
}
}
Using overhangSafe(_:) makes a circle or cylinder extend its shape to work better with FDM 3D printing. The shapes are extended in the right direction automatically, downward for additive geometry and upward for subtractive geometry (holes).
await Model("teardrop") {
Stack(.x, spacing: 5) {
Box(20)
.aligned(at: .centerXY)
.subtracting {
Cylinder(diameter: 10, height: 20)
.overhangSafe(.teardrop)
}
.rotated(x: -90°)
Circle(diameter: 20)
.overhangSafe()
.extruded(height: 20)
.rotated(x: -90°)
}
.aligned(at: .minZ)
.withCircularOverhangMethod(.bridge)
}