Move the wasm lib, and cleanup rust directory and all references (#5585)

* git mv src/wasm-lib rust

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv wasm-lib to workspace

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv kcl-lib

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv derive docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* resolve file paths

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* clippy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* move more shit

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix more paths

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* make yarn build:wasm work

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix scripts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixups

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* better references

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix cargo ci

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix reference

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix more ci

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* cargo sort

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix script

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix a dep

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* sort

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* remove unused deps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Revert "remove unused deps"

This reverts commit fbabdb062e275fd5cbc1476f8480a1afee15d972.

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* deps;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-03-01 13:59:01 -08:00
committed by GitHub
parent 0a2bf4b55f
commit c3bdc6f106
1443 changed files with 509 additions and 4274 deletions

View File

@ -0,0 +1,927 @@
---
source: kcl/src/simulation_tests.rs
description: Artifact commands sketch_on_face_end_negative_extrude.kcl
snapshot_kind: text
---
[
{
"cmdId": "[uuid]",
"range": [
0,
0,
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": 1.0,
"z": 0.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.7,
"g": 0.28,
"b": 0.28,
"a": 0.4
}
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.28,
"g": 0.7,
"b": 0.28,
"a": 0.4
}
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
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": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.28,
"g": 0.28,
"b": 0.7,
"a": 0.4
}
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
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": 1.0,
"z": 0.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
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": 100.0,
"clobber": false,
"hide": true
}
},
{
"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": [
29,
48,
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": 1.0,
"z": 0.0
},
"size": 60.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
56,
78,
0
],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
56,
78,
0
],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [
56,
78,
0
],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
86,
108,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 20.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
116,
138,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 20.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
146,
169,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -20.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
217,
225,
0
],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
217,
225,
0
],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": {
"x": 0.0,
"y": 0.0,
"z": 1.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 20.0,
"faces": null
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
231,
251,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
298,
323,
0
],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": null
}
},
{
"cmdId": "[uuid]",
"range": [
298,
323,
0
],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [
298,
323,
0
],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
329,
348,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
354,
373,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
379,
399,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -10.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
405,
413,
0
],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
"ortho": false,
"animated": false,
"adjust_camera": false,
"planar_normal": null
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": -5.0,
"faces": null
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
419,
439,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
}
]

View File

@ -0,0 +1,6 @@
---
source: kcl/src/simulation_tests.rs
description: Artifact graph flowchart sketch_on_face_end_negative_extrude.kcl
extension: md
snapshot_kind: binary
---

View File

@ -0,0 +1,118 @@
```mermaid
flowchart LR
subgraph path2 [Path]
2["Path<br>[56, 78, 0]"]
3["Segment<br>[86, 108, 0]"]
4["Segment<br>[116, 138, 0]"]
5["Segment<br>[146, 169, 0]"]
6["Segment<br>[217, 225, 0]"]
7[Solid2d]
end
subgraph path23 [Path]
23["Path<br>[298, 323, 0]"]
24["Segment<br>[329, 348, 0]"]
25["Segment<br>[354, 373, 0]"]
26["Segment<br>[379, 399, 0]"]
27["Segment<br>[405, 413, 0]"]
28[Solid2d]
end
1["Plane<br>[29, 48, 0]"]
8["Sweep Extrusion<br>[231, 251, 0]"]
9[Wall]
10[Wall]
11[Wall]
12[Wall]
13["Cap Start"]
14["Cap End"]
15["SweepEdge Opposite"]
16["SweepEdge Adjacent"]
17["SweepEdge Opposite"]
18["SweepEdge Adjacent"]
19["SweepEdge Opposite"]
20["SweepEdge Adjacent"]
21["SweepEdge Opposite"]
22["SweepEdge Adjacent"]
29["Sweep Extrusion<br>[419, 439, 0]"]
30[Wall]
31[Wall]
32[Wall]
33[Wall]
34["Cap Start"]
35["Cap End"]
36["SweepEdge Opposite"]
37["SweepEdge Adjacent"]
38["SweepEdge Opposite"]
39["SweepEdge Adjacent"]
40["SweepEdge Opposite"]
41["SweepEdge Adjacent"]
42["SweepEdge Opposite"]
43["SweepEdge Adjacent"]
44["StartSketchOnFace<br>[263, 292, 0]"]
1 --- 2
2 --- 3
2 --- 4
2 --- 5
2 --- 6
2 ---- 8
2 --- 7
3 --- 12
3 --- 21
3 --- 22
4 --- 11
4 --- 19
4 --- 20
5 --- 10
5 --- 17
5 --- 18
6 --- 9
6 --- 15
6 --- 16
8 --- 9
8 --- 10
8 --- 11
8 --- 12
8 --- 13
8 --- 14
8 --- 15
8 --- 16
8 --- 17
8 --- 18
8 --- 19
8 --- 20
8 --- 21
8 --- 22
14 --- 23
23 --- 24
23 --- 25
23 --- 26
23 --- 27
23 ---- 29
23 --- 28
24 --- 33
24 --- 42
24 --- 43
25 --- 32
25 --- 40
25 --- 41
26 --- 31
26 --- 38
26 --- 39
27 --- 30
27 --- 36
27 --- 37
29 --- 30
29 --- 31
29 --- 32
29 --- 33
29 --- 34
29 --- 35
29 --- 36
29 --- 37
29 --- 38
29 --- 39
29 --- 40
29 --- 41
29 --- 42
29 --- 43
14 <--x 44
```

View File

@ -0,0 +1,793 @@
---
source: kcl/src/simulation_tests.rs
description: Result of parsing sketch_on_face_end_negative_extrude.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 184,
"id": {
"end": 7,
"name": "cube",
"start": 3,
"type": "Identifier"
},
"init": {
"body": {
"body": [
{
"declaration": {
"end": 169,
"id": {
"end": 26,
"name": "sg",
"start": 24,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 47,
"raw": "'XY'",
"start": 43,
"type": "Literal",
"type": "Literal",
"value": "XY"
}
],
"callee": {
"end": 42,
"name": "startSketchOn",
"start": 29,
"type": "Identifier"
},
"end": 48,
"start": 29,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"end": 74,
"name": "pos",
"start": 71,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 77,
"start": 76,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 70,
"name": "startProfileAt",
"start": 56,
"type": "Identifier"
},
"end": 78,
"start": 56,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 99,
"raw": "0",
"start": 98,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 106,
"name": "scale",
"start": 101,
"type": "Identifier",
"type": "Identifier"
}
],
"end": 107,
"start": 97,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 90,
"name": "line",
"start": 86,
"type": "Identifier"
},
"end": 108,
"start": 86,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 133,
"name": "scale",
"start": 128,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 136,
"raw": "0",
"start": 135,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 137,
"start": 127,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 120,
"name": "line",
"start": 116,
"type": "Identifier"
},
"end": 138,
"start": 116,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 159,
"raw": "0",
"start": 158,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"argument": {
"end": 167,
"name": "scale",
"start": 162,
"type": "Identifier",
"type": "Identifier"
},
"end": 167,
"operator": "-",
"start": 161,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 168,
"start": 157,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 150,
"name": "line",
"start": 146,
"type": "Identifier"
},
"end": 169,
"start": 146,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 169,
"start": 29,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 24,
"type": "VariableDeclarator"
},
"end": 169,
"kind": "const",
"start": 24,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"argument": {
"end": 182,
"name": "sg",
"start": 180,
"type": "Identifier",
"type": "Identifier"
},
"end": 182,
"start": 173,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 184,
"nonCodeMeta": {
"nonCodeNodes": {
"0": [
{
"end": 173,
"start": 169,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 20
},
"end": 184,
"params": [
{
"type": "Parameter",
"identifier": {
"end": 11,
"name": "pos",
"start": 8,
"type": "Identifier"
}
},
{
"type": "Parameter",
"identifier": {
"end": 18,
"name": "scale",
"start": 13,
"type": "Identifier"
}
}
],
"start": 7,
"type": "FunctionExpression",
"type": "FunctionExpression"
},
"start": 3,
"type": "VariableDeclarator"
},
"end": 184,
"kind": "fn",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 251,
"id": {
"end": 192,
"name": "part001",
"start": 185,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"elements": [
{
"end": 202,
"raw": "0",
"start": 201,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 205,
"raw": "0",
"start": 204,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 206,
"start": 200,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 210,
"raw": "20",
"start": 208,
"type": "Literal",
"type": "Literal",
"value": {
"value": 20.0,
"suffix": "None"
}
}
],
"callee": {
"end": 199,
"name": "cube",
"start": 195,
"type": "Identifier"
},
"end": 211,
"start": 195,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"end": 224,
"start": 223,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 222,
"name": "close",
"start": 217,
"type": "Identifier"
},
"end": 225,
"start": 217,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "length"
},
"arg": {
"end": 250,
"raw": "20",
"start": 248,
"type": "Literal",
"type": "Literal",
"value": {
"value": 20.0,
"suffix": "None"
}
}
}
],
"callee": {
"end": 238,
"name": "extrude",
"start": 231,
"type": "Identifier"
},
"end": 251,
"start": 231,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 251,
"start": 195,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 185,
"type": "VariableDeclarator"
},
"end": 251,
"kind": "const",
"start": 185,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 439,
"id": {
"end": 260,
"name": "part002",
"start": 253,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 284,
"name": "part001",
"start": 277,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 291,
"raw": "\"END\"",
"start": 286,
"type": "Literal",
"type": "Literal",
"value": "END"
}
],
"callee": {
"end": 276,
"name": "startSketchOn",
"start": 263,
"type": "Identifier"
},
"end": 292,
"start": 263,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"elements": [
{
"end": 315,
"raw": "0",
"start": 314,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 318,
"raw": "0",
"start": 317,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 319,
"start": 313,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 322,
"start": 321,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 312,
"name": "startProfileAt",
"start": 298,
"type": "Identifier"
},
"end": 323,
"start": 298,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 342,
"raw": "0",
"start": 341,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 346,
"raw": "10",
"start": 344,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
}
],
"end": 347,
"start": 340,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 333,
"name": "line",
"start": 329,
"type": "Identifier"
},
"end": 348,
"start": 329,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 368,
"raw": "10",
"start": 366,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
},
{
"end": 371,
"raw": "0",
"start": 370,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 372,
"start": 365,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 358,
"name": "line",
"start": 354,
"type": "Identifier"
},
"end": 373,
"start": 354,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 392,
"raw": "0",
"start": 391,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"argument": {
"end": 397,
"raw": "10",
"start": 395,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
},
"end": 397,
"operator": "-",
"start": 394,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 398,
"start": 390,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 383,
"name": "line",
"start": 379,
"type": "Identifier"
},
"end": 399,
"start": 379,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"end": 412,
"start": 411,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 410,
"name": "close",
"start": 405,
"type": "Identifier"
},
"end": 413,
"start": 405,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "length"
},
"arg": {
"argument": {
"end": 438,
"raw": "5",
"start": 437,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
},
"end": 438,
"operator": "-",
"start": 436,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
}
],
"callee": {
"end": 426,
"name": "extrude",
"start": 419,
"type": "Identifier"
},
"end": 439,
"start": 419,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 439,
"start": 263,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 253,
"type": "VariableDeclarator"
},
"end": 439,
"kind": "const",
"start": 253,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"end": 440,
"nonCodeMeta": {
"nonCodeNodes": {
"1": [
{
"end": 253,
"start": 251,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 0
}
}

View File

@ -0,0 +1,20 @@
fn cube(pos, scale) {
sg = startSketchOn('XY')
|> startProfileAt(pos, %)
|> line(end = [0, scale])
|> line(end = [scale, 0])
|> line(end = [0, -scale])
return sg
}
part001 = cube([0, 0], 20)
|> close(%)
|> extrude(length = 20)
part002 = startSketchOn(part001, "END")
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> line(end = [10, 0])
|> line(end = [0, -10])
|> close(%)
|> extrude(length = -5)

View File

@ -0,0 +1,172 @@
---
source: kcl/src/simulation_tests.rs
description: Operations executed sketch_on_face_end_negative_extrude.kcl
---
[
{
"type": "UserDefinedFunctionCall",
"name": "cube",
"functionSourceRange": [
7,
184,
0
],
"unlabeledArg": null,
"labeledArgs": {},
"sourceRange": [
195,
211,
0
]
},
{
"labeledArgs": {
"data": {
"value": {
"type": "String",
"value": "XY"
},
"sourceRange": [
43,
47,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
29,
48,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"type": "UserDefinedFunctionReturn"
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 20.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
248,
250,
0
]
}
},
"name": "extrude",
"sourceRange": [
231,
251,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
277,
284,
0
]
},
"tag": {
"value": {
"type": "String",
"value": "END"
},
"sourceRange": [
286,
291,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
263,
292,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": -5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
436,
438,
0
]
}
},
"name": "extrude",
"sourceRange": [
419,
439,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}
]

View File

@ -0,0 +1,717 @@
---
source: kcl/src/simulation_tests.rs
description: Variables in memory after executing sketch_on_face_end_negative_extrude.kcl
---
{
"cube": {
"type": "Function",
"__meta": [
{
"sourceRange": [
7,
184,
0
]
}
]
},
"part001": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
86,
108,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
116,
138,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
146,
169,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
217,
225,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
86,
108,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
0.0,
20.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
116,
138,
0
]
},
"from": [
0.0,
20.0
],
"tag": null,
"to": [
20.0,
20.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
146,
169,
0
]
},
"from": [
20.0,
20.0
],
"tag": null,
"to": [
20.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
217,
225,
0
]
},
"from": [
20.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
56,
78,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
56,
78,
0
]
}
]
},
"height": 20.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
56,
78,
0
]
}
]
}
},
"part002": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
329,
348,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
354,
373,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
379,
399,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
405,
413,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
329,
348,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
0.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
354,
373,
0
]
},
"from": [
0.0,
10.0
],
"tag": null,
"to": [
10.0,
10.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
379,
399,
0
]
},
"from": [
10.0,
10.0
],
"tag": null,
"to": [
10.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
405,
413,
0
]
},
"from": [
10.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "face",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "end",
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"solid": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
86,
108,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
116,
138,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
146,
169,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
217,
225,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
86,
108,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
0.0,
20.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
116,
138,
0
]
},
"from": [
0.0,
20.0
],
"tag": null,
"to": [
20.0,
20.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
146,
169,
0
]
},
"from": [
20.0,
20.0
],
"tag": null,
"to": [
20.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
217,
225,
0
]
},
"from": [
20.0,
0.0
],
"tag": null,
"to": [
0.0,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "XY",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"zAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"units": {
"type": "Mm"
},
"__meta": []
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
56,
78,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
56,
78,
0
]
}
]
},
"height": 20.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
56,
78,
0
]
}
]
},
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
263,
292,
0
]
}
]
},
"start": {
"from": [
0.0,
0.0
],
"to": [
0.0,
0.0
],
"units": {
"type": "Mm"
},
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
298,
323,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
298,
323,
0
]
}
]
},
"height": -5.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
298,
323,
0
]
}
]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB