Files
modeling-app/rust/kcl-lib/tests/kcl_samples/router-template-slate/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

234 lines
3.8 KiB
Plaintext

---
source: kcl-lib/src/simulation_tests.rs
description: Operations executed router-template-slate.kcl
---
[
{
"labeledArgs": {
"data": {
"value": {
"type": "String",
"value": "XZ"
},
"sourceRange": [
498,
502,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
484,
503,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
1376,
1377,
0
]
}
},
"name": "extrude",
"sourceRange": [
1348,
1378,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
1356,
1365,
0
]
}
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
1434,
1444,
0
]
},
"tag": {
"value": {
"type": "String",
"value": "START"
},
"sourceRange": [
1446,
1453,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
1420,
1454,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 7.5,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
2007,
2010,
0
]
}
},
"name": "extrude",
"sourceRange": [
1979,
2011,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
1987,
1996,
0
]
}
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
2066,
2076,
0
]
},
"tag": {
"value": {
"type": "String",
"value": "START"
},
"sourceRange": [
2078,
2085,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
2052,
2086,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 7.5,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
2590,
2593,
0
]
}
},
"name": "extrude",
"sourceRange": [
2562,
2594,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
2570,
2579,
0
]
}
}
]