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 cube.kcl
[
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "edge_lines_visible",
"hidden": false
@ -17,11 +13,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "set_scene_units",
"unit": "mm"
@ -29,11 +21,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
@ -42,11 +30,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"range": [],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
@ -55,11 +39,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
185,
202,
0
],
"range": [],
"command": {
"type": "make_plane",
"origin": {
@ -84,11 +64,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
210,
231,
0
],
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
@ -104,22 +80,14 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
210,
231,
0
],
"range": [],
"command": {
"type": "start_path"
}
},
{
"cmdId": "[uuid]",
"range": [
210,
231,
0
],
"range": [],
"command": {
"type": "move_path_pen",
"path": "[uuid]",
@ -132,22 +100,14 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
210,
231,
0
],
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
239,
261,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -164,11 +124,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
269,
291,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -185,11 +141,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
299,
321,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -206,11 +158,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
329,
351,
0
],
"range": [],
"command": {
"type": "extend_path",
"path": "[uuid]",
@ -227,11 +175,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
359,
366,
0
],
"range": [],
"command": {
"type": "close_path",
"path_id": "[uuid]"
@ -239,11 +183,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "enable_sketch_mode",
"entity_id": "[uuid]",
@ -259,11 +199,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "extrude",
"target": "[uuid]",
@ -273,22 +209,14 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "sketch_mode_disable"
}
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "object_bring_to_front",
"object_id": "[uuid]"
@ -296,11 +224,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "solid3d_get_extrusion_face_info",
"object_id": "[uuid]",
@ -309,11 +233,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -323,11 +243,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
@ -337,11 +253,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -351,11 +263,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
@ -365,11 +273,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -379,11 +283,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",
@ -393,11 +293,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "solid3d_get_opposite_edge",
"object_id": "[uuid]",
@ -407,11 +303,7 @@ description: Artifact commands cube.kcl
},
{
"cmdId": "[uuid]",
"range": [
374,
402,
0
],
"range": [],
"command": {
"type": "solid3d_get_next_adjacent_edge",
"object_id": "[uuid]",

File diff suppressed because it is too large Load Diff

View File

@ -45,11 +45,7 @@ description: Operations executed cube.kcl
}
]
},
"sourceRange": [
446,
452,
0
]
"sourceRange": []
},
"sideLength": {
"value": {
@ -65,18 +61,10 @@ description: Operations executed cube.kcl
}
}
},
"sourceRange": [
433,
435,
0
]
"sourceRange": []
}
},
"sourceRange": [
415,
453,
0
]
"sourceRange": []
},
{
"labeledArgs": {
@ -85,19 +73,11 @@ description: Operations executed cube.kcl
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": [
199,
201,
0
]
"sourceRange": []
}
},
"name": "startSketchOn",
"sourceRange": [
185,
202,
0
],
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": null
},
@ -117,19 +97,11 @@ description: Operations executed cube.kcl
}
}
},
"sourceRange": [
391,
401,
0
]
"sourceRange": []
}
},
"name": "extrude",
"sourceRange": [
374,
402,
0
],
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
@ -138,11 +110,7 @@ description: Operations executed cube.kcl
"artifactId": "[uuid]"
}
},
"sourceRange": [
374,
402,
0
]
"sourceRange": []
}
},
{

View File

@ -16,44 +16,28 @@ description: Variables in memory after executing cube.kcl
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
239,
261,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
269,
291,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
299,
321,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
329,
351,
0
],
"sourceRange": [],
"tag": null,
"type": "extrudePlane"
}
@ -65,11 +49,7 @@ description: Variables in memory after executing cube.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
239,
261,
0
]
"sourceRange": []
},
"from": [
-20.0,
@ -88,11 +68,7 @@ description: Variables in memory after executing cube.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
269,
291,
0
]
"sourceRange": []
},
"from": [
-20.0,
@ -111,11 +87,7 @@ description: Variables in memory after executing cube.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
299,
321,
0
]
"sourceRange": []
},
"from": [
20.0,
@ -134,11 +106,7 @@ description: Variables in memory after executing cube.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
329,
351,
0
]
"sourceRange": []
},
"from": [
20.0,
@ -157,11 +125,7 @@ description: Variables in memory after executing cube.kcl
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
359,
366,
0
]
"sourceRange": []
},
"from": [
-20.0,
@ -222,11 +186,7 @@ description: Variables in memory after executing cube.kcl
"tag": null,
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
210,
231,
0
]
"sourceRange": []
}
},
"artifactId": "[uuid]",

View File

@ -0,0 +1,24 @@
---
source: kcl-lib/src/simulation_tests.rs
description: Result of unparsing cube.kcl
---
fn cube(sideLength, center) {
l = sideLength / 2
x = center[0]
y = center[1]
p0 = [-l + x, -l + y]
p1 = [-l + x, l + y]
p2 = [l + x, l + y]
p3 = [l + x, -l + y]
return startSketchOn(XY)
|> startProfileAt(p0, %)
|> line(endAbsolute = p1)
|> line(endAbsolute = p2)
|> line(endAbsolute = p3)
|> line(endAbsolute = p0)
|> close()
|> extrude(length = sideLength)
}
myCube = cube(sideLength = 40, center = [0, 0])