* Remove deprecated syntax Signed-off-by: Nick Cameron <nrc@ncameron.org> * fix one test * fix sketch on revolved face test * fix test: empty-scene default-planes act as expected * fix up more tests * another fix * remove another const --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
27 lines
947 B
Plaintext
27 lines
947 B
Plaintext
// Parameters
|
|
r = 50 // base radius
|
|
h = 10 // layer height
|
|
t = 0.005 // taper factor [0-1)
|
|
// Defines how to modify each layer of the vase.
|
|
// Each replica is shifted up the Z axis, and has a smoothly-varying radius
|
|
fn transform(replicaId) {
|
|
scale = r * abs(1 - (t * replicaId)) * (5 + math::cos((replicaId / 8): number(rad)))
|
|
return {
|
|
translate = [0, 0, replicaId * 10],
|
|
scale = [scale, scale, 0],
|
|
}
|
|
}
|
|
// Each layer is just a pretty thin cylinder with a fillet.
|
|
fn layer() {
|
|
return startSketchOn(XY) // or some other plane idk
|
|
|> circle(center = [0, 0], radius = 1, tag = $tag1)
|
|
|> extrude(length = h)
|
|
// |> fillet(
|
|
// radius = h / 2.01,
|
|
// tags = [tag1, getOppositeEdge(tag1)]
|
|
// )
|
|
}
|
|
// The vase is 100 layers tall.
|
|
// The 100 layers are replica of each other, with a slight transformation applied to each.
|
|
vase = layer() |> patternTransform(instances = 100, transform = transform)
|