Files
modeling-app/rust/kcl-lib/tests/kcl_samples/countersunk-plate/ops.snap
Jonathan Tran 7486d25cf1 Change KCL stdlib floating-point results to not be platform dependent (#7499)
* 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>
2025-06-17 01:34:50 +00:00

1072 lines
22 KiB
Plaintext

---
source: kcl-lib/src/simulation_tests.rs
description: Operations executed countersunk-plate.kcl
---
{
"public/kcl-samples/countersunk-plate/main.kcl": [
{
"type": "VariableDeclaration",
"name": "boltSpacing",
"value": {
"type": "Number",
"value": 5.0,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 0
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "boltDiameter",
"value": {
"type": "Number",
"value": 0.25,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 1
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "centerHoleDiameter",
"value": {
"type": "Number",
"value": 1.75,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 2
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "plateThickness",
"value": {
"type": "Number",
"value": 0.375,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 3
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "r1",
"value": {
"type": "Number",
"value": 1.6625,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 4
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "r2",
"value": {
"type": "Number",
"value": 0.75,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 5
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "d",
"value": {
"type": "Number",
"value": 2.5,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 6
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "tangentAngle",
"value": {
"type": "Number",
"value": 0.3736328030752811,
"ty": {
"type": "Known",
"type": "Angle",
"type": "Radians"
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 7
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "tangentLength",
"value": {
"type": "Number",
"value": 2.3275187969165794,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 8
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Plane",
"artifact_id": "[uuid]"
},
"sourceRange": []
},
"labeledArgs": {},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 9
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "polar",
"functionSourceRange": [],
"unlabeledArg": null,
"labeledArgs": {
"angle": {
"value": {
"type": "Number",
"value": 1.1971635237196154,
"ty": {
"type": "Known",
"type": "Angle",
"type": "Radians"
}
},
"sourceRange": []
},
"length": {
"value": {
"type": "Number",
"value": 1.6625,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 9
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 1
},
{
"type": "CallKwArg",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "x",
"value": {
"type": "Number",
"value": 0.6068125000000003,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": []
},
"sourceRange": []
},
{
"type": "VariableDeclaration",
"name": "y",
"value": {
"type": "Number",
"value": 1.547799999949525,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"visibility": "default",
"nodePath": {
"steps": []
},
"sourceRange": []
},
{
"type": "GroupEnd"
},
{
"type": "StdLibCall",
"name": "subtract2d",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"tool": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 9
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 11
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 0.375,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 9
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "PipeBodyItem",
"index": 12
}
]
},
"sourceRange": []
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "countersink",
"functionSourceRange": [],
"unlabeledArg": {
"value": {
"type": "Number",
"value": -2.5,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
},
"labeledArgs": {}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 11
},
{
"type": "ExpressionStatementExpr"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"face": {
"value": {
"type": "String",
"value": "end"
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 10
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "FunctionExpressionBody"
},
{
"type": "FunctionExpressionBodyItem",
"index": 0
},
{
"type": "ExpressionStatementExpr"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": -0.375,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 10
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "FunctionExpressionBody"
},
{
"type": "FunctionExpressionBodyItem",
"index": 0
},
{
"type": "ExpressionStatementExpr"
},
{
"type": "PipeBodyItem",
"index": 2
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "chamfer",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 0.25,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "hole01",
"artifact_id": "[uuid]"
}
]
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 10
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "FunctionExpressionBody"
},
{
"type": "FunctionExpressionBodyItem",
"index": 0
},
{
"type": "ExpressionStatementExpr"
},
{
"type": "PipeBodyItem",
"index": 3
}
]
},
"sourceRange": []
},
{
"type": "GroupEnd"
},
{
"type": "GroupBegin",
"group": {
"type": "FunctionCall",
"name": "countersink",
"functionSourceRange": [],
"unlabeledArg": {
"value": {
"type": "Number",
"value": 2.5,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
},
"labeledArgs": {}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 12
},
{
"type": "ExpressionStatementExpr"
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "startSketchOn",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"face": {
"value": {
"type": "String",
"value": "end"
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 10
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "FunctionExpressionBody"
},
{
"type": "FunctionExpressionBodyItem",
"index": 0
},
{
"type": "ExpressionStatementExpr"
},
{
"type": "PipeBodyItem",
"index": 0
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "extrude",
"unlabeledArg": {
"value": {
"type": "Sketch",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": -0.375,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 10
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "FunctionExpressionBody"
},
{
"type": "FunctionExpressionBodyItem",
"index": 0
},
{
"type": "ExpressionStatementExpr"
},
{
"type": "PipeBodyItem",
"index": 2
}
]
},
"sourceRange": []
},
{
"type": "StdLibCall",
"name": "chamfer",
"unlabeledArg": {
"value": {
"type": "Solid",
"value": {
"artifactId": "[uuid]"
}
},
"sourceRange": []
},
"labeledArgs": {
"length": {
"value": {
"type": "Number",
"value": 0.25,
"ty": {
"type": "Default",
"len": {
"type": "Inches"
},
"angle": {
"type": "Degrees"
}
}
},
"sourceRange": []
},
"tags": {
"value": {
"type": "Array",
"value": [
{
"type": "TagIdentifier",
"value": "hole01",
"artifact_id": "[uuid]"
}
]
},
"sourceRange": []
}
},
"nodePath": {
"steps": [
{
"type": "ProgramBodyItem",
"index": 10
},
{
"type": "VariableDeclarationDeclaration"
},
{
"type": "VariableDeclarationInit"
},
{
"type": "FunctionExpressionBody"
},
{
"type": "FunctionExpressionBodyItem",
"index": 0
},
{
"type": "ExpressionStatementExpr"
},
{
"type": "PipeBodyItem",
"index": 3
}
]
},
"sourceRange": []
},
{
"type": "GroupEnd"
}
],
"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": []
}