Files
modeling-app/rust/kcl-lib/tests/kcl_samples/i-beam/artifact_commands.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

348 lines
5.0 KiB
Plaintext

---
source: kcl-lib/src/simulation_tests.rs
description: Artifact commands i-beam.kcl
---
[
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "edge_lines_visible",
"hidden": false
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "set_scene_units",
"unit": "mm"
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [
110,
143,
0
],
"command": {
"type": "set_scene_units",
"unit": "in"
}
},
{
"cmdId": "[uuid]",
"range": [
379,
399,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": -1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
405,
441,
0
],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 1.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
405,
441,
0
],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [
405,
441,
0
],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 2.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
447,
474,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 1.3315,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
480,
510,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -0.293,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
516,
552,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.1465,
"y": 1.707,
"z": 0.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [
558,
580,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.1465,
"y": 0.0,
"z": 0.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [
586,
613,
0
],
"command": {
"type": "entity_mirror",
"ids": [
"[uuid]"
],
"axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"point": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
619,
646,
0
],
"command": {
"type": "entity_mirror",
"ids": [
"[uuid]"
],
"axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"point": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
652,
680,
0
],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 1.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
652,
680,
0
],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 24.0,
"faces": null
}
},
{
"cmdId": "[uuid]",
"range": [
652,
680,
0
],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
652,
680,
0
],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
652,
680,
0
],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
}
]