* Improve snapshot testing Signed-off-by: Nick Cameron <nrc@ncameron.org> * A snapshot a day keeps the bugs away! 📷🐛 * A snapshot a day keeps the bugs away! 📷🐛 --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
33 lines
595 B
Plaintext
33 lines
595 B
Plaintext
---
|
|
source: kcl-lib/src/simulation_tests.rs
|
|
description: Result of unparsing pipe_as_arg.kcl
|
|
---
|
|
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)
|
|
|> startProfileAt(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])
|