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:
Adam Chalmers
2024-07-30 11:14:37 -05:00
committed by GitHub
parent 54936f6932
commit 07a90b3171
8 changed files with 207 additions and 358 deletions

View File

@ -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)]}, %)

View File

@ -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)]}, %)

View File

@ -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)]}, %)

View File

@ -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)]}, %)

View File

@ -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]}, %)

View 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)

View File

@ -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