Type check and coerce arguments to user functions and return values from std Rust functions (#6958)

* Shuffle around function call code

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

* Refactor function calls to share more code

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

* Hack to leave the result of revolve as a singleton rather than array

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-05-19 16:50:15 +12:00
committed by GitHub
parent f3e9d110c0
commit b19acd550d
197 changed files with 13837 additions and 14317 deletions

View File

@ -4,19 +4,30 @@ description: Operations executed sketch_on_face_union.kcl
---
[
{
"labeledArgs": {},
"name": "startSketchOn",
"sourceRange": [],
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
},
"labeledArgs": {},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "subtract2d",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"tool": {
"value": {
@ -28,9 +39,11 @@ description: Operations executed sketch_on_face_union.kcl
"sourceRange": []
}
},
"name": "subtract2d",
"sourceRange": [],
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "subtract2d",
"unlabeledArg": {
"value": {
"type": "Sketch",
@ -39,9 +52,7 @@ description: Operations executed sketch_on_face_union.kcl
}
},
"sourceRange": []
}
},
{
},
"labeledArgs": {
"tool": {
"value": {
@ -53,9 +64,11 @@ description: Operations executed sketch_on_face_union.kcl
"sourceRange": []
}
},
"name": "subtract2d",
"sourceRange": [],
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
@ -64,9 +77,7 @@ description: Operations executed sketch_on_face_union.kcl
}
},
"sourceRange": []
}
},
{
},
"labeledArgs": {
"length": {
"value": {
@ -85,34 +96,23 @@ description: Operations executed sketch_on_face_union.kcl
"sourceRange": []
}
},
"name": "extrude",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
}
"sourceRange": []
},
{
"labeledArgs": {},
"name": "startSketchOn",
"sourceRange": [],
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
}
},
"labeledArgs": {},
"sourceRange": []
},
{
"type": "KclStdLibCall",
"type": "StdLibCall",
"name": "offsetPlane",
"unlabeledArg": {
"value": {
@ -142,6 +142,17 @@ description: Operations executed sketch_on_face_union.kcl
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
@ -160,9 +171,11 @@ description: Operations executed sketch_on_face_union.kcl
"sourceRange": []
}
},
"name": "extrude",
"sourceRange": [],
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
@ -171,9 +184,7 @@ description: Operations executed sketch_on_face_union.kcl
}
},
"sourceRange": []
}
},
{
},
"labeledArgs": {
"length": {
"value": {
@ -192,20 +203,20 @@ description: Operations executed sketch_on_face_union.kcl
"sourceRange": []
}
},
"name": "extrude",
"sourceRange": [],
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Sketch",
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
}
},
{
},
"labeledArgs": {
"face": {
"value": {
@ -216,20 +227,20 @@ description: Operations executed sketch_on_face_union.kcl
"sourceRange": []
}
},
"name": "startSketchOn",
"sourceRange": [],
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Solid",
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
}
},
{
},
"labeledArgs": {
"length": {
"value": {
@ -248,17 +259,6 @@ description: Operations executed sketch_on_face_union.kcl
"sourceRange": []
}
},
"name": "extrude",
"sourceRange": [],
"type": "StdLibCall",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
}
"sourceRange": []
}
]