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.
This commit is contained in:
Adam Chalmers
2025-05-01 11:36:51 -05:00
committed by GitHub
parent 16f5d9c284
commit 89bae66257
254 changed files with 32085 additions and 20108 deletions

View File

@ -1,62 +1,62 @@
```mermaid
flowchart LR
subgraph path9 [Path]
9["Path<br>[928, 974, 0]"]
14["Segment<br>[982, 1004, 0]"]
17["Segment<br>[1012, 1042, 0]"]
18["Segment<br>[1050, 1094, 0]"]
20["Segment<br>[1102, 1129, 0]"]
22["Segment<br>[1137, 1181, 0]"]
24["Segment<br>[1189, 1196, 0]"]
9["Path<br>[929, 975, 0]"]
14["Segment<br>[983, 1005, 0]"]
17["Segment<br>[1013, 1043, 0]"]
18["Segment<br>[1051, 1095, 0]"]
20["Segment<br>[1103, 1130, 0]"]
22["Segment<br>[1138, 1182, 0]"]
24["Segment<br>[1190, 1197, 0]"]
38[Solid2d]
end
subgraph path10 [Path]
10["Path<br>[928, 974, 0]"]
15["Segment<br>[982, 1004, 0]"]
16["Segment<br>[1012, 1042, 0]"]
19["Segment<br>[1050, 1094, 0]"]
21["Segment<br>[1102, 1129, 0]"]
23["Segment<br>[1137, 1181, 0]"]
25["Segment<br>[1189, 1196, 0]"]
10["Path<br>[929, 975, 0]"]
15["Segment<br>[983, 1005, 0]"]
16["Segment<br>[1013, 1043, 0]"]
19["Segment<br>[1051, 1095, 0]"]
21["Segment<br>[1103, 1130, 0]"]
23["Segment<br>[1138, 1182, 0]"]
25["Segment<br>[1190, 1197, 0]"]
39[Solid2d]
end
subgraph path11 [Path]
11["Path<br>[2237, 2325, 0]"]
26["Segment<br>[2331, 2395, 0]"]
27["Segment<br>[2401, 2465, 0]"]
28["Segment<br>[2471, 2524, 0]"]
29["Segment<br>[2530, 2551, 0]"]
11["Path<br>[2238, 2326, 0]"]
26["Segment<br>[2332, 2396, 0]"]
27["Segment<br>[2402, 2466, 0]"]
28["Segment<br>[2472, 2525, 0]"]
29["Segment<br>[2531, 2552, 0]"]
37[Solid2d]
end
subgraph path12 [Path]
12["Path<br>[2882, 3048, 0]"]
30["Segment<br>[2882, 3048, 0]"]
12["Path<br>[2883, 3049, 0]"]
30["Segment<br>[2883, 3049, 0]"]
36[Solid2d]
end
subgraph path13 [Path]
13["Path<br>[4361, 4386, 0]"]
31["Segment<br>[4392, 4464, 0]"]
32["Segment<br>[4470, 4543, 0]"]
33["Segment<br>[4549, 4602, 0]"]
34["Segment<br>[4608, 4629, 0]"]
13["Path<br>[4362, 4387, 0]"]
31["Segment<br>[4393, 4465, 0]"]
32["Segment<br>[4471, 4544, 0]"]
33["Segment<br>[4550, 4603, 0]"]
34["Segment<br>[4609, 4630, 0]"]
35[Solid2d]
end
1["Plane<br>[1282, 1329, 0]"]
2["Plane<br>[1861, 1908, 0]"]
3["Plane<br>[2214, 2231, 0]"]
4["Plane<br>[4322, 4354, 0]"]
5["StartSketchOnPlane<br>[4308, 4355, 0]"]
6["StartSketchOnPlane<br>[900, 920, 0]"]
7["StartSketchOnPlane<br>[900, 920, 0]"]
8["StartSketchOnFace<br>[2834, 2876, 0]"]
40["Sweep Extrusion<br>[1269, 1372, 0]"]
41["Sweep Revolve<br>[1848, 1939, 0]"]
42["Sweep Extrusion<br>[2557, 2581, 0]"]
43["Sweep Extrusion<br>[3270, 3297, 0]"]
44["Sweep Extrusion<br>[3270, 3297, 0]"]
45["Sweep Extrusion<br>[3270, 3297, 0]"]
46["Sweep Extrusion<br>[3270, 3297, 0]"]
47["Sweep Extrusion<br>[4635, 4679, 0]"]
1["Plane<br>[1283, 1330, 0]"]
2["Plane<br>[1862, 1909, 0]"]
3["Plane<br>[2215, 2232, 0]"]
4["Plane<br>[4323, 4355, 0]"]
5["StartSketchOnPlane<br>[4309, 4356, 0]"]
6["StartSketchOnPlane<br>[901, 921, 0]"]
7["StartSketchOnPlane<br>[901, 921, 0]"]
8["StartSketchOnFace<br>[2835, 2877, 0]"]
40["Sweep Extrusion<br>[1270, 1373, 0]"]
41["Sweep Revolve<br>[1849, 1940, 0]"]
42["Sweep Extrusion<br>[2558, 2582, 0]"]
43["Sweep Extrusion<br>[3271, 3298, 0]"]
44["Sweep Extrusion<br>[3271, 3298, 0]"]
45["Sweep Extrusion<br>[3271, 3298, 0]"]
46["Sweep Extrusion<br>[3271, 3298, 0]"]
47["Sweep Extrusion<br>[4636, 4680, 0]"]
48[Wall]
49[Wall]
50[Wall]
@ -123,14 +123,14 @@ flowchart LR
111["SweepEdge Adjacent"]
112["SweepEdge Adjacent"]
113["SweepEdge Adjacent"]
114["EdgeCut Fillet<br>[2587, 2817, 0]"]
115["EdgeCut Fillet<br>[2587, 2817, 0]"]
116["EdgeCut Fillet<br>[2587, 2817, 0]"]
117["EdgeCut Fillet<br>[2587, 2817, 0]"]
118["EdgeCut Fillet<br>[4685, 4918, 0]"]
119["EdgeCut Fillet<br>[4685, 4918, 0]"]
120["EdgeCut Fillet<br>[4685, 4918, 0]"]
121["EdgeCut Fillet<br>[4685, 4918, 0]"]
114["EdgeCut Fillet<br>[2588, 2818, 0]"]
115["EdgeCut Fillet<br>[2588, 2818, 0]"]
116["EdgeCut Fillet<br>[2588, 2818, 0]"]
117["EdgeCut Fillet<br>[2588, 2818, 0]"]
118["EdgeCut Fillet<br>[4686, 4919, 0]"]
119["EdgeCut Fillet<br>[4686, 4919, 0]"]
120["EdgeCut Fillet<br>[4686, 4919, 0]"]
121["EdgeCut Fillet<br>[4686, 4919, 0]"]
1 <--x 6
1 --- 10
2 <--x 7