Previous: ``` startProfileAt([x, y], %) startProfileAt([x, y], sketch001) ``` New: ``` startProfile(%, at = [x, y]) startProfile(sketch001, at = [x, y]) ```
21 lines
611 B
Plaintext
21 lines
611 B
Plaintext
---
|
|
source: kcl-lib/src/simulation_tests.rs
|
|
description: Result of unparsing subtract_cylinder_from_cube.kcl
|
|
---
|
|
fn cube(center) {
|
|
return startSketchOn(XY)
|
|
|> startProfile(at = [center[0] - 10, center[1] - 10])
|
|
|> line(endAbsolute = [center[0] + 10, center[1] - 10])
|
|
|> line(endAbsolute = [center[0] + 10, center[1] + 10])
|
|
|> line(endAbsolute = [center[0] - 10, center[1] + 10])
|
|
|> close()
|
|
|> extrude(length = 10)
|
|
}
|
|
|
|
part001 = cube([0, 0])
|
|
part002 = startSketchOn(XY)
|
|
|> circle(center = [2, 2], radius = 2)
|
|
|> extrude(length = 5)
|
|
|
|
fullPart = subtract([part001], tools = [part002])
|