Files
modeling-app/rust/kcl-lib/tests/function_sketch/input.kcl
Adam Chalmers 89bae66257 KCL: User-defined KCL functions in examples etc now use keywords (#6603)
Preparing for the removal of positional functions from the language. The first big step is to change all our KCL code examples, test code, public samples etc to all use keyword functions.

Apologies for how large this PR is. Most of it is:

- Changing example KCL that defined its own functions, so the functions now use keyword arguments rather than positional arguments. E.g. change `cube([20, 20])` to be `cube(center = [20, 20])`.
- Some parts of the code assumed positional code and didn't handle keyword calls, e.g. the linter would only check for positional calls to startSketchOn. Now they should work with either positional or keyword.
- Update all the artifacts

This does _not_ remove support for positional calls. That will be in a follow-up PR.
2025-05-01 12:36:51 -04:00

14 lines
254 B
Plaintext

fn box(h, l, w) {
myBox = startSketchOn(XY)
|> startProfile(at = [0, 0])
|> line(end = [0, l])
|> line(end = [w, 0])
|> line(end = [0, -l])
|> close(%)
|> extrude(length = h)
return myBox
}
fnBox = box(h = 3, l = 6, w = 10)