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,508 @@
---
source: kcl/src/simulation_tests.rs
description: Artifact commands artifact_graph_example_code_offset_planes.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": [
17,
47,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 20.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": false
}
},
{
"cmdId": "[uuid]",
"range": [
17,
47,
0
],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.6,
"g": 0.6,
"b": 0.6,
"a": 0.3
}
}
},
{
"cmdId": "[uuid]",
"range": [
65,
96,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 50.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": false
}
},
{
"cmdId": "[uuid]",
"range": [
65,
96,
0
],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.6,
"g": 0.6,
"b": 0.6,
"a": 0.3
}
}
},
{
"cmdId": "[uuid]",
"range": [
114,
144,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 10.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": false
}
},
{
"cmdId": "[uuid]",
"range": [
114,
144,
0
],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.6,
"g": 0.6,
"b": 0.6,
"a": 0.3
}
}
},
{
"cmdId": "[uuid]",
"range": [
193,
218,
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": [
193,
218,
0
],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [
193,
218,
0
],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
224,
249,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 6.78,
"y": 15.01,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
193,
218,
0
],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

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

View File

@ -0,0 +1,14 @@
```mermaid
flowchart LR
subgraph path4 [Path]
4["Path<br>[193, 218, 0]"]
5["Segment<br>[224, 249, 0]"]
end
1["Plane<br>[17, 47, 0]"]
2["Plane<br>[65, 96, 0]"]
3["Plane<br>[114, 144, 0]"]
6["StartSketchOnPlane<br>[158, 187, 0]"]
1 --- 4
4 --- 5
1 <--x 6
```

View File

@ -0,0 +1,358 @@
---
source: kcl/src/simulation_tests.rs
description: Result of parsing artifact_graph_example_code_offset_planes.kcl
snapshot_kind: text
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 47,
"id": {
"end": 14,
"name": "offsetPlane001",
"start": 0,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "offset"
},
"arg": {
"end": 46,
"raw": "20",
"start": 44,
"type": "Literal",
"type": "Literal",
"value": {
"value": 20.0,
"suffix": "None"
}
}
}
],
"callee": {
"end": 28,
"name": "offsetPlane",
"start": 17,
"type": "Identifier"
},
"end": 47,
"start": 17,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 33,
"raw": "\"XY\"",
"start": 29,
"type": "Literal",
"type": "Literal",
"value": "XY"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 47,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 96,
"id": {
"end": 62,
"name": "offsetPlane002",
"start": 48,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "offset"
},
"arg": {
"argument": {
"end": 95,
"raw": "50",
"start": 93,
"type": "Literal",
"type": "Literal",
"value": {
"value": 50.0,
"suffix": "None"
}
},
"end": 95,
"operator": "-",
"start": 92,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
}
],
"callee": {
"end": 76,
"name": "offsetPlane",
"start": 65,
"type": "Identifier"
},
"end": 96,
"start": 65,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 81,
"raw": "\"XZ\"",
"start": 77,
"type": "Literal",
"type": "Literal",
"value": "XZ"
}
},
"start": 48,
"type": "VariableDeclarator"
},
"end": 96,
"kind": "const",
"start": 48,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 144,
"id": {
"end": 111,
"name": "offsetPlane003",
"start": 97,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "offset"
},
"arg": {
"end": 143,
"raw": "10",
"start": 141,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.0,
"suffix": "None"
}
}
}
],
"callee": {
"end": 125,
"name": "offsetPlane",
"start": 114,
"type": "Identifier"
},
"end": 144,
"start": 114,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 130,
"raw": "\"YZ\"",
"start": 126,
"type": "Literal",
"type": "Literal",
"value": "YZ"
}
},
"start": 97,
"type": "VariableDeclarator"
},
"end": 144,
"kind": "const",
"start": 97,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 249,
"id": {
"end": 155,
"name": "sketch002",
"start": 146,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 186,
"name": "offsetPlane001",
"start": 172,
"type": "Identifier",
"type": "Identifier"
}
],
"callee": {
"end": 171,
"name": "startSketchOn",
"start": 158,
"type": "Identifier"
},
"end": 187,
"start": 158,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"elements": [
{
"end": 210,
"raw": "0",
"start": 209,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 213,
"raw": "0",
"start": 212,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 214,
"start": 208,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 217,
"start": 216,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 207,
"name": "startProfileAt",
"start": 193,
"type": "Identifier"
},
"end": 218,
"start": 193,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 240,
"raw": "6.78",
"start": 236,
"type": "Literal",
"type": "Literal",
"value": {
"value": 6.78,
"suffix": "None"
}
},
{
"end": 247,
"raw": "15.01",
"start": 242,
"type": "Literal",
"type": "Literal",
"value": {
"value": 15.01,
"suffix": "None"
}
}
],
"end": 248,
"start": 235,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 228,
"name": "line",
"start": 224,
"type": "Identifier"
},
"end": 249,
"start": 224,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 249,
"start": 158,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 146,
"type": "VariableDeclarator"
},
"end": 249,
"kind": "const",
"start": 146,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"end": 250,
"nonCodeMeta": {
"nonCodeNodes": {
"2": [
{
"end": 146,
"start": 144,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 0
}
}

View File

@ -0,0 +1,7 @@
offsetPlane001 = offsetPlane("XY", offset = 20)
offsetPlane002 = offsetPlane("XZ", offset = -50)
offsetPlane003 = offsetPlane("YZ", offset = 10)
sketch002 = startSketchOn(offsetPlane001)
|> startProfileAt([0, 0], %)
|> line(end = [6.78, 15.01])

View File

@ -0,0 +1,155 @@
---
source: kcl/src/simulation_tests.rs
description: Operations executed artifact_graph_example_code_offset_planes.kcl
---
[
{
"labeledArgs": {
"offset": {
"value": {
"type": "Number",
"value": 20.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
44,
46,
0
]
}
},
"name": "offsetPlane",
"sourceRange": [
17,
47,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "String",
"value": "XY"
},
"sourceRange": [
29,
33,
0
]
}
},
{
"labeledArgs": {
"offset": {
"value": {
"type": "Number",
"value": -50.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
92,
95,
0
]
}
},
"name": "offsetPlane",
"sourceRange": [
65,
96,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "String",
"value": "XZ"
},
"sourceRange": [
77,
81,
0
]
}
},
{
"labeledArgs": {
"offset": {
"value": {
"type": "Number",
"value": 10.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
141,
143,
0
]
}
},
"name": "offsetPlane",
"sourceRange": [
114,
144,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "String",
"value": "YZ"
},
"sourceRange": [
126,
130,
0
]
}
},
{
"labeledArgs": {
"data": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": [
172,
186,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
158,
187,
0
],
"type": "StdLibCall",
"unlabeledArg": null
}
]

View File

@ -0,0 +1,200 @@
---
source: kcl/src/simulation_tests.rs
description: Variables in memory after executing artifact_graph_example_code_offset_planes.kcl
---
{
"offsetPlane001": {
"type": "Plane",
"value": {
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 20.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": []
}
},
"offsetPlane002": {
"type": "Plane",
"value": {
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 0.0,
"y": 50.0,
"z": 0.0
},
"xAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
}
},
"offsetPlane003": {
"type": "Plane",
"value": {
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 10.0,
"y": 0.0,
"z": 0.0
},
"xAxis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"yAxis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"zAxis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"units": {
"type": "Mm"
},
"__meta": []
}
},
"sketch002": {
"type": "Sketch",
"value": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
224,
249,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
6.78,
15.01
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
}
],
"on": {
"type": "plane",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": "Custom",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 20.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": [
193,
218,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
193,
218,
0
]
}
]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB