* Add libm dependency * Change to use libm for trig functions * Remove redactions for floating point * Update output * Use clippy to prevent stdlib math sneaking back in --------- Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
552 lines
12 KiB
Plaintext
552 lines
12 KiB
Plaintext
---
|
|
source: kcl-lib/src/simulation_tests.rs
|
|
description: Operations executed intersect_cubes.kcl
|
|
---
|
|
{
|
|
"rust/kcl-lib/tests/intersect_cubes/input.kcl": [
|
|
{
|
|
"type": "GroupBegin",
|
|
"group": {
|
|
"type": "FunctionCall",
|
|
"name": "cube",
|
|
"functionSourceRange": [],
|
|
"unlabeledArg": null,
|
|
"labeledArgs": {
|
|
"center": {
|
|
"value": {
|
|
"type": "Array",
|
|
"value": [
|
|
{
|
|
"type": "Number",
|
|
"value": 0.0,
|
|
"ty": {
|
|
"type": "Default",
|
|
"len": {
|
|
"type": "Mm"
|
|
},
|
|
"angle": {
|
|
"type": "Degrees"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Number",
|
|
"value": 0.0,
|
|
"ty": {
|
|
"type": "Default",
|
|
"len": {
|
|
"type": "Mm"
|
|
},
|
|
"angle": {
|
|
"type": "Degrees"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
"size": {
|
|
"value": {
|
|
"type": "Number",
|
|
"value": 10.0,
|
|
"ty": {
|
|
"type": "Default",
|
|
"len": {
|
|
"type": "Mm"
|
|
},
|
|
"angle": {
|
|
"type": "Degrees"
|
|
}
|
|
}
|
|
},
|
|
"sourceRange": []
|
|
}
|
|
}
|
|
},
|
|
"nodePath": {
|
|
"steps": [
|
|
{
|
|
"type": "ProgramBodyItem",
|
|
"index": 1
|
|
},
|
|
{
|
|
"type": "VariableDeclarationDeclaration"
|
|
},
|
|
{
|
|
"type": "VariableDeclarationInit"
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "StdLibCall",
|
|
"name": "startSketchOn",
|
|
"unlabeledArg": {
|
|
"value": {
|
|
"type": "Plane",
|
|
"artifact_id": "[uuid]"
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
"labeledArgs": {},
|
|
"nodePath": {
|
|
"steps": [
|
|
{
|
|
"type": "ProgramBodyItem",
|
|
"index": 0
|
|
},
|
|
{
|
|
"type": "VariableDeclarationDeclaration"
|
|
},
|
|
{
|
|
"type": "VariableDeclarationInit"
|
|
},
|
|
{
|
|
"type": "FunctionExpressionBody"
|
|
},
|
|
{
|
|
"type": "FunctionExpressionBodyItem",
|
|
"index": 0
|
|
},
|
|
{
|
|
"type": "ReturnStatementArg"
|
|
},
|
|
{
|
|
"type": "PipeBodyItem",
|
|
"index": 0
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "StdLibCall",
|
|
"name": "extrude",
|
|
"unlabeledArg": {
|
|
"value": {
|
|
"type": "Sketch",
|
|
"value": {
|
|
"artifactId": "[uuid]"
|
|
}
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
"labeledArgs": {
|
|
"length": {
|
|
"value": {
|
|
"type": "Number",
|
|
"value": 20.0,
|
|
"ty": {
|
|
"type": "Default",
|
|
"len": {
|
|
"type": "Mm"
|
|
},
|
|
"angle": {
|
|
"type": "Degrees"
|
|
}
|
|
}
|
|
},
|
|
"sourceRange": []
|
|
}
|
|
},
|
|
"nodePath": {
|
|
"steps": [
|
|
{
|
|
"type": "ProgramBodyItem",
|
|
"index": 0
|
|
},
|
|
{
|
|
"type": "VariableDeclarationDeclaration"
|
|
},
|
|
{
|
|
"type": "VariableDeclarationInit"
|
|
},
|
|
{
|
|
"type": "FunctionExpressionBody"
|
|
},
|
|
{
|
|
"type": "FunctionExpressionBodyItem",
|
|
"index": 0
|
|
},
|
|
{
|
|
"type": "ReturnStatementArg"
|
|
},
|
|
{
|
|
"type": "PipeBodyItem",
|
|
"index": 6
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "GroupEnd"
|
|
},
|
|
{
|
|
"type": "GroupBegin",
|
|
"group": {
|
|
"type": "FunctionCall",
|
|
"name": "cube",
|
|
"functionSourceRange": [],
|
|
"unlabeledArg": null,
|
|
"labeledArgs": {
|
|
"center": {
|
|
"value": {
|
|
"type": "Array",
|
|
"value": [
|
|
{
|
|
"type": "Number",
|
|
"value": 7.0,
|
|
"ty": {
|
|
"type": "Default",
|
|
"len": {
|
|
"type": "Mm"
|
|
},
|
|
"angle": {
|
|
"type": "Degrees"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "Number",
|
|
"value": 3.0,
|
|
"ty": {
|
|
"type": "Default",
|
|
"len": {
|
|
"type": "Mm"
|
|
},
|
|
"angle": {
|
|
"type": "Degrees"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
"size": {
|
|
"value": {
|
|
"type": "Number",
|
|
"value": 5.0,
|
|
"ty": {
|
|
"type": "Default",
|
|
"len": {
|
|
"type": "Mm"
|
|
},
|
|
"angle": {
|
|
"type": "Degrees"
|
|
}
|
|
}
|
|
},
|
|
"sourceRange": []
|
|
}
|
|
}
|
|
},
|
|
"nodePath": {
|
|
"steps": [
|
|
{
|
|
"type": "ProgramBodyItem",
|
|
"index": 2
|
|
},
|
|
{
|
|
"type": "VariableDeclarationDeclaration"
|
|
},
|
|
{
|
|
"type": "VariableDeclarationInit"
|
|
},
|
|
{
|
|
"type": "PipeBodyItem",
|
|
"index": 0
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "StdLibCall",
|
|
"name": "startSketchOn",
|
|
"unlabeledArg": {
|
|
"value": {
|
|
"type": "Plane",
|
|
"artifact_id": "[uuid]"
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
"labeledArgs": {},
|
|
"nodePath": {
|
|
"steps": [
|
|
{
|
|
"type": "ProgramBodyItem",
|
|
"index": 0
|
|
},
|
|
{
|
|
"type": "VariableDeclarationDeclaration"
|
|
},
|
|
{
|
|
"type": "VariableDeclarationInit"
|
|
},
|
|
{
|
|
"type": "FunctionExpressionBody"
|
|
},
|
|
{
|
|
"type": "FunctionExpressionBodyItem",
|
|
"index": 0
|
|
},
|
|
{
|
|
"type": "ReturnStatementArg"
|
|
},
|
|
{
|
|
"type": "PipeBodyItem",
|
|
"index": 0
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "StdLibCall",
|
|
"name": "extrude",
|
|
"unlabeledArg": {
|
|
"value": {
|
|
"type": "Sketch",
|
|
"value": {
|
|
"artifactId": "[uuid]"
|
|
}
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
"labeledArgs": {
|
|
"length": {
|
|
"value": {
|
|
"type": "Number",
|
|
"value": 10.0,
|
|
"ty": {
|
|
"type": "Default",
|
|
"len": {
|
|
"type": "Mm"
|
|
},
|
|
"angle": {
|
|
"type": "Degrees"
|
|
}
|
|
}
|
|
},
|
|
"sourceRange": []
|
|
}
|
|
},
|
|
"nodePath": {
|
|
"steps": [
|
|
{
|
|
"type": "ProgramBodyItem",
|
|
"index": 0
|
|
},
|
|
{
|
|
"type": "VariableDeclarationDeclaration"
|
|
},
|
|
{
|
|
"type": "VariableDeclarationInit"
|
|
},
|
|
{
|
|
"type": "FunctionExpressionBody"
|
|
},
|
|
{
|
|
"type": "FunctionExpressionBodyItem",
|
|
"index": 0
|
|
},
|
|
{
|
|
"type": "ReturnStatementArg"
|
|
},
|
|
{
|
|
"type": "PipeBodyItem",
|
|
"index": 6
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "GroupEnd"
|
|
},
|
|
{
|
|
"type": "StdLibCall",
|
|
"name": "translate",
|
|
"unlabeledArg": {
|
|
"value": {
|
|
"type": "Solid",
|
|
"value": {
|
|
"artifactId": "[uuid]"
|
|
}
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
"labeledArgs": {
|
|
"z": {
|
|
"value": {
|
|
"type": "Number",
|
|
"value": 1.0,
|
|
"ty": {
|
|
"type": "Default",
|
|
"len": {
|
|
"type": "Mm"
|
|
},
|
|
"angle": {
|
|
"type": "Degrees"
|
|
}
|
|
}
|
|
},
|
|
"sourceRange": []
|
|
}
|
|
},
|
|
"nodePath": {
|
|
"steps": [
|
|
{
|
|
"type": "ProgramBodyItem",
|
|
"index": 2
|
|
},
|
|
{
|
|
"type": "VariableDeclarationDeclaration"
|
|
},
|
|
{
|
|
"type": "VariableDeclarationInit"
|
|
},
|
|
{
|
|
"type": "PipeBodyItem",
|
|
"index": 1
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "StdLibCall",
|
|
"name": "intersect",
|
|
"unlabeledArg": {
|
|
"value": {
|
|
"type": "Array",
|
|
"value": [
|
|
{
|
|
"type": "Solid",
|
|
"value": {
|
|
"artifactId": "[uuid]"
|
|
}
|
|
},
|
|
{
|
|
"type": "Solid",
|
|
"value": {
|
|
"artifactId": "[uuid]"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
"labeledArgs": {},
|
|
"nodePath": {
|
|
"steps": [
|
|
{
|
|
"type": "ProgramBodyItem",
|
|
"index": 3
|
|
},
|
|
{
|
|
"type": "VariableDeclarationDeclaration"
|
|
},
|
|
{
|
|
"type": "VariableDeclarationInit"
|
|
}
|
|
]
|
|
},
|
|
"sourceRange": []
|
|
}
|
|
],
|
|
"std::appearance": [],
|
|
"std::array": [],
|
|
"std::math": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"name": "PI",
|
|
"value": {
|
|
"type": "Number",
|
|
"value": 3.141592653589793,
|
|
"ty": {
|
|
"type": "Unknown"
|
|
}
|
|
},
|
|
"visibility": "export",
|
|
"nodePath": {
|
|
"steps": []
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"name": "E",
|
|
"value": {
|
|
"type": "Number",
|
|
"value": 2.718281828459045,
|
|
"ty": {
|
|
"type": "Known",
|
|
"type": "Count"
|
|
}
|
|
},
|
|
"visibility": "export",
|
|
"nodePath": {
|
|
"steps": []
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"name": "TAU",
|
|
"value": {
|
|
"type": "Number",
|
|
"value": 6.283185307179586,
|
|
"ty": {
|
|
"type": "Known",
|
|
"type": "Count"
|
|
}
|
|
},
|
|
"visibility": "export",
|
|
"nodePath": {
|
|
"steps": []
|
|
},
|
|
"sourceRange": []
|
|
}
|
|
],
|
|
"std::prelude": [
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"name": "START",
|
|
"value": {
|
|
"type": "String",
|
|
"value": "start"
|
|
},
|
|
"visibility": "export",
|
|
"nodePath": {
|
|
"steps": []
|
|
},
|
|
"sourceRange": []
|
|
},
|
|
{
|
|
"type": "VariableDeclaration",
|
|
"name": "END",
|
|
"value": {
|
|
"type": "String",
|
|
"value": "end"
|
|
},
|
|
"visibility": "export",
|
|
"nodePath": {
|
|
"steps": []
|
|
},
|
|
"sourceRange": []
|
|
}
|
|
],
|
|
"std::sketch": [],
|
|
"std::solid": [],
|
|
"std::sweep": [],
|
|
"std::transform": [],
|
|
"std::turns": [],
|
|
"std::types": [],
|
|
"std::units": []
|
|
}
|