Files
modeling-app/rust/kcl-lib/tests/artifact_graph_example_code1/ops.snap
Adam Chalmers aea82e004a KCL: Convert x/y lines to use keyword arguments (#5615)
Previously, `xLine`, `xLineTo`, `yLine` and `yLineTo` used positional arguments. Now:

- `xLineTo` and `yLineTo` have been removed
- `xLine` and `yLine` both use keyword arguments:
  - `length`, optional (i.e. a relative distance along the X or Y axis)
  - `endAbsolute` optional (i.e. an absolute point along the X or Y axis)
  - `tag` optional
- Exactly one of `length` or `endAbsolute` must be given. Not both, not neither.

For example:

```
// Old way
|> xLine(6.04, %)
|> yLineTo(20, %, $base)

// New way
|> xLine(length = 6.04)
|> yLine(endAbsolute = 20, tag = $base)
```

This also improves some of the general-purpose keyword arguments code in modeling app's TS codebase.
2025-03-07 22:07:16 -06:00

216 lines
3.5 KiB
Plaintext

---
source: kcl/src/simulation_tests.rs
description: Operations executed artifact_graph_example_code1.kcl
---
[
{
"labeledArgs": {
"data": {
"value": {
"type": "String",
"value": "XY"
},
"sourceRange": [
26,
30,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
12,
31,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": -10.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
288,
291,
0
]
}
},
"name": "extrude",
"sourceRange": [
260,
292,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
268,
277,
0
]
}
},
{
"labeledArgs": {
"radius": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
314,
315,
0
]
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "seg01",
"artifact_id": "[uuid]"
}
]
},
"sourceRange": [
324,
331,
0
]
}
},
"name": "fillet",
"sourceRange": [
298,
332,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
359,
369,
0
]
},
"tag": {
"value": {
"type": "TagIdentifier",
"value": "seg02",
"artifact_id": "[uuid]"
},
"sourceRange": [
371,
376,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
345,
377,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
576,
577,
0
]
}
},
"name": "extrude",
"sourceRange": [
548,
578,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
556,
565,
0
]
}
}
]