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,728 @@
---
source: kcl/src/simulation_tests.rs
description: Artifact commands parametric.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": [
228,
247,
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": [
253,
278,
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": [
253,
278,
0
],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [
253,
278,
0
],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
"to": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
},
{
"cmdId": "[uuid]",
"range": [
284,
305,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 5.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
311,
332,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 8.0,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
338,
365,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -0.1852,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
371,
405,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": -7.8148,
"y": 0.0,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
411,
445,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": -4.8148,
"z": 0.0
},
"relative": true
}
}
},
{
"cmdId": "[uuid]",
"range": [
451,
459,
0
],
"command": {
"type": "close_path",
"path_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
451,
459,
0
],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
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": [
465,
488,
0
],
"command": {
"type": "extrude",
"target": "[uuid]",
"distance": 9.0,
"faces": null
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
"edge_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
"edge_id": "[uuid]",
"face_id": "[uuid]"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
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 parametric.kcl
extension: md
snapshot_kind: binary
---

View File

@ -0,0 +1,82 @@
```mermaid
flowchart LR
subgraph path2 [Path]
2["Path<br>[253, 278, 0]"]
3["Segment<br>[284, 305, 0]"]
4["Segment<br>[311, 332, 0]"]
5["Segment<br>[338, 365, 0]"]
6["Segment<br>[371, 405, 0]"]
7["Segment<br>[411, 445, 0]"]
8["Segment<br>[451, 459, 0]"]
9[Solid2d]
end
1["Plane<br>[228, 247, 0]"]
10["Sweep Extrusion<br>[465, 488, 0]"]
11[Wall]
12[Wall]
13[Wall]
14[Wall]
15[Wall]
16[Wall]
17["Cap Start"]
18["Cap End"]
19["SweepEdge Opposite"]
20["SweepEdge Adjacent"]
21["SweepEdge Opposite"]
22["SweepEdge Adjacent"]
23["SweepEdge Opposite"]
24["SweepEdge Adjacent"]
25["SweepEdge Opposite"]
26["SweepEdge Adjacent"]
27["SweepEdge Opposite"]
28["SweepEdge Adjacent"]
29["SweepEdge Opposite"]
30["SweepEdge Adjacent"]
1 --- 2
2 --- 3
2 --- 4
2 --- 5
2 --- 6
2 --- 7
2 --- 8
2 ---- 10
2 --- 9
3 --- 16
3 --- 29
3 --- 30
4 --- 15
4 --- 27
4 --- 28
5 --- 14
5 --- 25
5 --- 26
6 --- 13
6 --- 23
6 --- 24
7 --- 12
7 --- 21
7 --- 22
8 --- 11
8 --- 19
8 --- 20
10 --- 11
10 --- 12
10 --- 13
10 --- 14
10 --- 15
10 --- 16
10 --- 17
10 --- 18
10 --- 19
10 --- 20
10 --- 21
10 --- 22
10 --- 23
10 --- 24
10 --- 25
10 --- 26
10 --- 27
10 --- 28
10 --- 29
10 --- 30
```

View File

@ -0,0 +1,863 @@
---
source: kcl/src/simulation_tests.rs
description: Result of parsing parametric.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 18,
"id": {
"end": 10,
"name": "sigmaAllow",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 18,
"raw": "35000",
"start": 13,
"type": "Literal",
"type": "Literal",
"value": {
"value": 35000.0,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 18,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 35,
"id": {
"end": 31,
"name": "width",
"start": 26,
"type": "Identifier"
},
"init": {
"end": 35,
"raw": "9",
"start": 34,
"type": "Literal",
"type": "Literal",
"value": {
"value": 9.0,
"suffix": "None"
}
},
"start": 26,
"type": "VariableDeclarator"
},
"end": 35,
"kind": "const",
"start": 26,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 51,
"id": {
"end": 45,
"name": "p",
"start": 44,
"type": "Identifier"
},
"init": {
"end": 51,
"raw": "150",
"start": 48,
"type": "Literal",
"type": "Literal",
"value": {
"value": 150.0,
"suffix": "None"
}
},
"start": 44,
"type": "VariableDeclarator"
},
"end": 51,
"kind": "const",
"start": 44,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 88,
"id": {
"end": 84,
"name": "distance",
"start": 76,
"type": "Identifier"
},
"init": {
"end": 88,
"raw": "6",
"start": 87,
"type": "Literal",
"type": "Literal",
"value": {
"value": 6.0,
"suffix": "None"
}
},
"start": 76,
"type": "VariableDeclarator"
},
"end": 88,
"kind": "const",
"start": 76,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 106,
"id": {
"end": 102,
"name": "FOS",
"start": 99,
"type": "Identifier"
},
"init": {
"end": 106,
"raw": "2",
"start": 105,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 99,
"type": "VariableDeclarator"
},
"end": 106,
"kind": "const",
"start": 99,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 116,
"id": {
"end": 112,
"name": "leg1",
"start": 108,
"type": "Identifier"
},
"init": {
"end": 116,
"raw": "5",
"start": 115,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
},
"start": 108,
"type": "VariableDeclarator"
},
"end": 116,
"kind": "const",
"start": 108,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 135,
"id": {
"end": 131,
"name": "leg2",
"start": 127,
"type": "Identifier"
},
"init": {
"end": 135,
"raw": "8",
"start": 134,
"type": "Literal",
"type": "Literal",
"value": {
"value": 8.0,
"suffix": "None"
}
},
"start": 127,
"type": "VariableDeclarator"
},
"end": 135,
"kind": "const",
"start": 127,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 207,
"id": {
"end": 155,
"name": "thickness",
"start": 146,
"type": "Identifier"
},
"init": {
"arguments": [
{
"end": 206,
"left": {
"end": 198,
"left": {
"end": 185,
"left": {
"end": 181,
"left": {
"end": 175,
"left": {
"end": 171,
"name": "distance",
"start": 163,
"type": "Identifier",
"type": "Identifier"
},
"operator": "*",
"right": {
"end": 175,
"name": "p",
"start": 174,
"type": "Identifier",
"type": "Identifier"
},
"start": 163,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "*",
"right": {
"end": 181,
"name": "FOS",
"start": 178,
"type": "Identifier",
"type": "Identifier"
},
"start": 163,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "*",
"right": {
"end": 185,
"raw": "6",
"start": 184,
"type": "Literal",
"type": "Literal",
"value": {
"value": 6.0,
"suffix": "None"
}
},
"start": 163,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "/",
"right": {
"end": 198,
"name": "sigmaAllow",
"start": 188,
"type": "Identifier",
"type": "Identifier"
},
"start": 163,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "/",
"right": {
"end": 206,
"name": "width",
"start": 201,
"type": "Identifier",
"type": "Identifier"
},
"start": 163,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"callee": {
"end": 162,
"name": "sqrt",
"start": 158,
"type": "Identifier"
},
"end": 207,
"start": 158,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 146,
"type": "VariableDeclarator"
},
"end": 207,
"kind": "const",
"start": 146,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 488,
"id": {
"end": 225,
"name": "bracket",
"start": 218,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 246,
"raw": "'XY'",
"start": 242,
"type": "Literal",
"type": "Literal",
"value": "XY"
}
],
"callee": {
"end": 241,
"name": "startSketchOn",
"start": 228,
"type": "Identifier"
},
"end": 247,
"start": 228,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"elements": [
{
"end": 270,
"raw": "0",
"start": 269,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 273,
"raw": "0",
"start": 272,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 274,
"start": 268,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 277,
"start": 276,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 267,
"name": "startProfileAt",
"start": 253,
"type": "Identifier"
},
"end": 278,
"start": 253,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 297,
"raw": "0",
"start": 296,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 303,
"name": "leg1",
"start": 299,
"type": "Identifier",
"type": "Identifier"
}
],
"end": 304,
"start": 295,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 288,
"name": "line",
"start": 284,
"type": "Identifier"
},
"end": 305,
"start": 284,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 327,
"name": "leg2",
"start": 323,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 330,
"raw": "0",
"start": 329,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 331,
"start": 322,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 315,
"name": "line",
"start": 311,
"type": "Identifier"
},
"end": 332,
"start": 311,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 351,
"raw": "0",
"start": 350,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"argument": {
"end": 363,
"name": "thickness",
"start": 354,
"type": "Identifier",
"type": "Identifier"
},
"end": 363,
"operator": "-",
"start": 353,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 364,
"start": 349,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 342,
"name": "line",
"start": 338,
"type": "Identifier"
},
"end": 365,
"start": 338,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 400,
"left": {
"argument": {
"end": 388,
"name": "leg2",
"start": 384,
"type": "Identifier",
"type": "Identifier"
},
"end": 388,
"operator": "-",
"start": 383,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "+",
"right": {
"end": 400,
"name": "thickness",
"start": 391,
"type": "Identifier",
"type": "Identifier"
},
"start": 383,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 403,
"raw": "0",
"start": 402,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 404,
"start": 382,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 375,
"name": "line",
"start": 371,
"type": "Identifier"
},
"end": 405,
"start": 371,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 424,
"raw": "0",
"start": 423,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 443,
"left": {
"argument": {
"end": 431,
"name": "leg1",
"start": 427,
"type": "Identifier",
"type": "Identifier"
},
"end": 431,
"operator": "-",
"start": 426,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "+",
"right": {
"end": 443,
"name": "thickness",
"start": 434,
"type": "Identifier",
"type": "Identifier"
},
"start": 426,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"end": 444,
"start": 422,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 415,
"name": "line",
"start": 411,
"type": "Identifier"
},
"end": 445,
"start": 411,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"end": 458,
"start": 457,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 456,
"name": "close",
"start": 451,
"type": "Identifier"
},
"end": 459,
"start": 451,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "length"
},
"arg": {
"end": 487,
"name": "width",
"start": 482,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 472,
"name": "extrude",
"start": 465,
"type": "Identifier"
},
"end": 488,
"start": 465,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 488,
"start": 228,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 218,
"type": "VariableDeclarator"
},
"end": 488,
"kind": "const",
"start": 218,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"end": 489,
"nonCodeMeta": {
"nonCodeNodes": {
"0": [
{
"end": 25,
"start": 18,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "psi",
"style": "line"
}
}
],
"1": [
{
"end": 43,
"start": 35,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "inch",
"style": "line"
}
}
],
"2": [
{
"end": 75,
"start": 51,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "Force on shelf - lbs",
"style": "line"
}
}
],
"3": [
{
"end": 98,
"start": 88,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "inches",
"style": "line"
}
}
],
"4": [
{
"end": 108,
"start": 106,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
],
"5": [
{
"end": 126,
"start": 116,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "inches",
"style": "line"
}
}
],
"6": [
{
"end": 145,
"start": 135,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "inches",
"style": "line"
}
}
],
"7": [
{
"end": 217,
"start": 207,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "inches",
"style": "line"
}
}
]
},
"startNodes": []
},
"start": 0
}
}

View File

@ -0,0 +1,18 @@
sigmaAllow = 35000 // psi
width = 9 // inch
p = 150 // Force on shelf - lbs
distance = 6 // inches
FOS = 2
leg1 = 5 // inches
leg2 = 8 // inches
thickness = sqrt(distance * p * FOS * 6 / sigmaAllow / width) // inches
bracket = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line(end = [0, leg1])
|> line(end = [leg2, 0])
|> line(end = [0, -thickness])
|> line(end = [-leg2 + thickness, 0])
|> line(end = [0, -leg1 + thickness])
|> close(%)
|> extrude(length = width)

View File

@ -0,0 +1,73 @@
---
source: kcl/src/simulation_tests.rs
description: Operations executed parametric.kcl
---
[
{
"labeledArgs": {
"data": {
"value": {
"type": "String",
"value": "XY"
},
"sourceRange": [
242,
246,
0
]
}
},
"name": "startSketchOn",
"sourceRange": [
228,
247,
0
],
"type": "StdLibCall",
"unlabeledArg": null
},
{
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 9.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": [
482,
487,
0
]
}
},
"name": "extrude",
"sourceRange": [
465,
488,
0
],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": [
0,
0,
0
]
}
}
]

View File

@ -0,0 +1,477 @@
---
source: kcl/src/simulation_tests.rs
description: Variables in memory after executing parametric.kcl
---
{
"FOS": {
"type": "Number",
"value": 2.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
105,
106,
0
]
}
]
},
"bracket": {
"type": "Solid",
"value": {
"type": "Solid",
"id": "[uuid]",
"artifactId": "[uuid]",
"value": [
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
284,
305,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
311,
332,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
338,
365,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
371,
405,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
411,
445,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
451,
459,
0
],
"tag": null,
"type": "extrudePlane"
}
],
"sketch": {
"type": "Sketch",
"id": "[uuid]",
"paths": [
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
284,
305,
0
]
},
"from": [
0.0,
0.0
],
"tag": null,
"to": [
0.0,
5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
311,
332,
0
]
},
"from": [
0.0,
5.0
],
"tag": null,
"to": [
8.0,
5.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
338,
365,
0
]
},
"from": [
8.0,
5.0
],
"tag": null,
"to": [
8.0,
4.8148
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
371,
405,
0
]
},
"from": [
8.0,
4.8148
],
"tag": null,
"to": [
0.1852,
4.8148
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
411,
445,
0
]
},
"from": [
0.1852,
4.8148
],
"tag": null,
"to": [
0.1852,
0.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
451,
459,
0
]
},
"from": [
0.1852,
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": [
253,
278,
0
]
}
},
"artifactId": "[uuid]",
"originalId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
253,
278,
0
]
}
]
},
"height": 9.0,
"startCapId": "[uuid]",
"endCapId": "[uuid]",
"units": {
"type": "Mm"
},
"__meta": [
{
"sourceRange": [
253,
278,
0
]
}
]
}
},
"distance": {
"type": "Number",
"value": 6.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
87,
88,
0
]
}
]
},
"leg1": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
115,
116,
0
]
}
]
},
"leg2": {
"type": "Number",
"value": 8.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
134,
135,
0
]
}
]
},
"p": {
"type": "Number",
"value": 150.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
48,
51,
0
]
}
]
},
"sigmaAllow": {
"type": "Number",
"value": 35000.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
13,
18,
0
]
}
]
},
"thickness": {
"type": "Number",
"value": 0.1852,
"ty": {
"type": "Unknown"
},
"__meta": [
{
"sourceRange": [
158,
207,
0
]
}
]
},
"width": {
"type": "Number",
"value": 9.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
34,
35,
0
]
}
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB