Use kcl_input! macro (#3189)
* Use kcl_input! macro These two lines are equivalent: `kcl_input!("foo")` `include_str!("inputs/foo.kcl")` Simplifies the tests. * Move more KCL test programs into their own files * Move twenty-twenty asserts into their own function * Move more asserts into 'assert_out'
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
const part001 = startSketchOn('XY')
|
||||
|> startProfileAt([0,0], %)
|
||||
|> line([0, 10], %, $thing)
|
||||
|> line([10, 0], %)
|
||||
|> line([0, -10], %, $thing2)
|
||||
|> close(%, $thing3)
|
||||
|> extrude(10, %)
|
||||
|> fillet({radius: 2, tags: [thing3, getOppositeEdge(thing3)]}, %)
|
@ -0,0 +1,8 @@
|
||||
const part001 = startSketchOn('XY')
|
||||
|> startProfileAt([0,0], %)
|
||||
|> line([0, 10], %, $thing)
|
||||
|> line([10, 0], %)
|
||||
|> line([0, -10], %, $thing2)
|
||||
|> close(%)
|
||||
|> extrude(10, %)
|
||||
|> fillet({radius: 2, tags: [thing, getOppositeEdge(thing)]}, %)
|
@ -0,0 +1,8 @@
|
||||
const part001 = startSketchOn('XY')
|
||||
|> startProfileAt([0,0], %)
|
||||
|> line([0, 10], %, $thing)
|
||||
|> line([10, 0], %, $thing1)
|
||||
|> line([0, -10], %, $thing2)
|
||||
|> close(%, $thing3)
|
||||
|> extrude(10, %)
|
||||
|> fillet({radius: 2, tags: [getNextAdjacentEdge(thing3)]}, %)
|
@ -0,0 +1,8 @@
|
||||
const part001 = startSketchOn('XY')
|
||||
|> startProfileAt([0,0], %)
|
||||
|> line([0, 10], %, $thing)
|
||||
|> line([10, 0], %, $thing1)
|
||||
|> line([0, -10], %, $thing2)
|
||||
|> close(%, $thing3)
|
||||
|> extrude(10, %)
|
||||
|> fillet({radius: 2, tags: [getPreviousAdjacentEdge(thing3)]}, %)
|
@ -0,0 +1,9 @@
|
||||
const part001 = startSketchOn('XY')
|
||||
|> startProfileAt([0,0], %)
|
||||
|> line([0, 10], %, $thing)
|
||||
|> line([10, 0], %)
|
||||
|> line([0, -10], %, $thing2)
|
||||
|> close(%)
|
||||
|> extrude(10, %)
|
||||
|> fillet({radius: 2, tags: [thing, thing2]}, %)
|
||||
|
13
src/wasm-lib/tests/executor/inputs/function_sketch.kcl
Normal file
13
src/wasm-lib/tests/executor/inputs/function_sketch.kcl
Normal file
@ -0,0 +1,13 @@
|
||||
fn box = (h, l, w) => {
|
||||
const myBox = startSketchOn('XY')
|
||||
|> startProfileAt([0,0], %)
|
||||
|> line([0, l], %)
|
||||
|> line([w, 0], %)
|
||||
|> line([0, -l], %)
|
||||
|> close(%)
|
||||
|> extrude(h, %)
|
||||
|
||||
return myBox
|
||||
}
|
||||
|
||||
const fnBox = box(3, 6, 10)
|
@ -0,0 +1,13 @@
|
||||
fn box = (p, h, l, w) => {
|
||||
const myBox = startSketchOn('XY')
|
||||
|> startProfileAt(p, %)
|
||||
|> line([0, l], %)
|
||||
|> line([w, 0], %)
|
||||
|> line([0, -l], %)
|
||||
|> close(%)
|
||||
|> extrude(h, %)
|
||||
|
||||
return myBox
|
||||
}
|
||||
|
||||
const thing = box([0,0], 3, 6, 10)
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user