* 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>
24 lines
477 B
Plaintext
24 lines
477 B
Plaintext
fn cube(length, center) {
|
|
l = length/2
|
|
x = center[0]
|
|
y = center[1]
|
|
p0 = [-l + x, -l + y]
|
|
p1 = [-l + x, l + y]
|
|
p2 = [ l + x, l + y]
|
|
p3 = [ l + x, -l + y]
|
|
|
|
return startSketchOn(XY)
|
|
|> startProfile(at = p0)
|
|
|> line(endAbsolute = p1)
|
|
|> line(endAbsolute = p2)
|
|
|> line(endAbsolute = p3)
|
|
|> line(endAbsolute = p0)
|
|
|> close()
|
|
|> extrude(length = length)
|
|
}
|
|
|
|
fn double(x) { return x * 2}
|
|
fn width() { return 200 }
|
|
|
|
myCube = cube(200 |> double(%), [0,0])
|