Improve snapshot testing (#5856)

* Improve snapshot testing

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Nick Cameron
2025-03-20 11:06:27 +13:00
committed by GitHub
parent 4b6166dc4f
commit a7e09a89ef
551 changed files with 115788 additions and 275855 deletions

View File

@ -5,11 +5,7 @@ description: Artifact commands parametric.kcl
[
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "edge_lines_visible",
"hidden": false
@ -17,11 +13,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "set_scene_units",
"unit": "mm"
@ -29,11 +21,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
@ -42,11 +30,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
@ -55,11 +39,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
228,
247,
0
],
"range": [],
"command": {
"type": "make_plane",
"origin": {
@ -84,11 +64,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
253,
278,
0
],
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
@ -104,22 +80,14 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
253,
278,
0
],
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [
253,
278,
0
],
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
@ -132,22 +100,14 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
253,
278,
0
],
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
284,
305,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -164,11 +124,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
311,
332,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -185,11 +141,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
338,
365,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -206,11 +158,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
371,
405,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -227,11 +175,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
411,
445,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -248,11 +192,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
451,
459,
0
],
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
@ -260,11 +200,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
@ -280,11 +216,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
@ -294,22 +226,14 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
@ -317,11 +241,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
@ -330,11 +250,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -344,11 +260,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
@ -358,11 +270,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -372,11 +280,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
@ -386,11 +290,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -400,11 +300,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
@ -414,11 +310,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -428,11 +320,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
@ -442,11 +330,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -456,11 +340,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
@ -470,11 +350,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -484,11 +360,7 @@ description: Artifact commands parametric.kcl
},
{
"cmdId": "[uuid]",
"range": [
465,
488,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",

File diff suppressed because it is too large Load Diff

View File

@ -10,19 +10,11 @@ description: Operations executed parametric.kcl
"type": "String",
"value": "XY"
},
"sourceRange": [
242,
246,
0
]
"sourceRange": []
}
},
"name": "startSketchOn",
"sourceRange": [
228,
247,
0
],
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": null
},
@ -42,19 +34,11 @@ description: Operations executed parametric.kcl
}
}
},
"sourceRange": [
482,
487,
0
]
"sourceRange": []
}
},
"name": "extrude",
"sourceRange": [
465,
488,
0
],
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
@ -63,11 +47,7 @@ description: Operations executed parametric.kcl
"artifactId": "[uuid]"
}
},
"sourceRange": [
465,
488,
0
]
"sourceRange": []
}
}
]

View File

@ -26,66 +26,42 @@ description: Variables in memory after executing parametric.kcl
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
284,
305,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
311,
332,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
338,
365,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
371,
405,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
411,
445,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
451,
459,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
}
@ -97,11 +73,7 @@ description: Variables in memory after executing parametric.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
284,
305,
0
]
"sourceRange": []
},
"from": [
0.0,
@ -120,11 +92,7 @@ description: Variables in memory after executing parametric.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
311,
332,
0
]
"sourceRange": []
},
"from": [
0.0,
@ -143,11 +111,7 @@ description: Variables in memory after executing parametric.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
338,
365,
0
]
"sourceRange": []
},
"from": [
8.0,
@ -166,11 +130,7 @@ description: Variables in memory after executing parametric.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
371,
405,
0
]
"sourceRange": []
},
"from": [
8.0,
@ -189,11 +149,7 @@ description: Variables in memory after executing parametric.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
411,
445,
0
]
"sourceRange": []
},
"from": [
0.1852,
@ -212,11 +168,7 @@ description: Variables in memory after executing parametric.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
451,
459,
0
]
"sourceRange": []
},
"from": [
0.1852,
@ -277,11 +229,7 @@ description: Variables in memory after executing parametric.kcl
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
253,
278,
0
]
"sourceRange": []
}
},
"artifactId": "[uuid]",

View File

@ -0,0 +1,22 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing parametric.kcl
---
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)