Files
modeling-app/rust/kcl-lib/tests/kcl_samples/socket-head-cap-screw/ast.snap
Nick Cameron a7e09a89ef 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>
2025-03-19 15:06:27 -07:00

1951 lines
69 KiB
Plaintext

---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing socket-head-cap-screw.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "screwLength",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"raw": "1.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "screwDiameter",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"raw": ".190",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.19,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "headDiameter",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"raw": ".313",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.313,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "headLength",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"name": "screwDiameter",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "hexWallToWall",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"left": {
"end": 0,
"raw": "5",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
},
"operator": "/",
"right": {
"end": 0,
"raw": "32",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 32.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "capRatio",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"left": {
"end": 0,
"name": "screwDiameter",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 0,
"name": "headDiameter",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "hexRatio",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"left": {
"end": 0,
"name": "hexWallToWall",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 0,
"name": "headDiameter",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "hexWallLength",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"left": {
"end": 0,
"left": {
"end": 0,
"left": {
"end": 0,
"name": "hexWallToWall",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "*",
"right": {
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "/",
"right": {
"arguments": [
{
"arguments": [
{
"end": 0,
"raw": "30",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 30.0,
"suffix": "None"
}
}
],
"callee": {
"end": 0,
"name": "toRadians",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
}
],
"callee": {
"end": 0,
"name": "cos",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "hexStartingAngle",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"raw": "210",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 210.0,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "hexInteriorAngle",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"raw": "120",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 120.0,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "hexChangeAngle",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"left": {
"end": 0,
"raw": "180",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 180.0,
"suffix": "None"
}
},
"operator": "-",
"right": {
"end": 0,
"name": "hexInteriorAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "capScrew",
"start": 0,
"type": "Identifier"
},
"init": {
"body": {
"body": [
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "screwHeadSketch",
"start": 0,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 0,
"raw": "'XZ'",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "XZ"
}
],
"callee": {
"end": 0,
"name": "startSketchOn",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "center",
"start": 0,
"type": "Identifier"
},
"arg": {
"elements": [
{
"computed": false,
"end": 0,
"object": {
"end": 0,
"name": "start",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"property": {
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
"start": 0,
"type": "MemberExpression",
"type": "MemberExpression"
},
{
"computed": false,
"end": 0,
"object": {
"end": 0,
"name": "start",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"property": {
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 0,
"type": "MemberExpression",
"type": "MemberExpression"
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "radius",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"left": {
"end": 0,
"left": {
"end": 0,
"name": "dia",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 0,
"name": "capRatio",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "/",
"right": {
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"end": 0,
"name": "circle",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 0,
"nonCodeMeta": {
"nonCodeNodes": {
"1": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Extrude the screw head sketch",
"style": "line"
}
}
]
},
"startNodes": []
},
"start": 0,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "screwHead",
"start": 0,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"name": "capHeadLength",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 0,
"name": "extrude",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 0,
"name": "screwHeadSketch",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "hexPatternSketch",
"start": 0,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 0,
"name": "screwHead",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 0,
"raw": "'end'",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "end"
}
],
"callee": {
"end": 0,
"name": "startSketchOn",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"elements": [
{
"end": 0,
"left": {
"end": 0,
"name": "hexWallToWall",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 0,
"name": "startProfileAt",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"left": {
"argument": {
"end": 0,
"name": "hexWallLength",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "/",
"right": {
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"end": 0,
"name": "yLine",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"end": 0,
"properties": [
{
"end": 0,
"key": {
"end": 0,
"name": "angle",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"name": "hexStartingAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
},
{
"end": 0,
"key": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"name": "hexWallLength",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 0,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 0,
"name": "angledLine",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"end": 0,
"properties": [
{
"end": 0,
"key": {
"end": 0,
"name": "angle",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"left": {
"end": 0,
"name": "hexStartingAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 0,
"name": "hexChangeAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
},
{
"end": 0,
"key": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"name": "hexWallLength",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 0,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 0,
"name": "angledLine",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"end": 0,
"properties": [
{
"end": 0,
"key": {
"end": 0,
"name": "angle",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"left": {
"end": 0,
"name": "hexStartingAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 0,
"left": {
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"end": 0,
"name": "hexChangeAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
},
{
"end": 0,
"key": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"name": "hexWallLength",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 0,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 0,
"name": "angledLine",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"end": 0,
"properties": [
{
"end": 0,
"key": {
"end": 0,
"name": "angle",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"left": {
"end": 0,
"name": "hexStartingAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 0,
"left": {
"end": 0,
"raw": "3",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"end": 0,
"name": "hexChangeAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
},
{
"end": 0,
"key": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"name": "hexWallLength",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 0,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 0,
"name": "angledLine",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"end": 0,
"properties": [
{
"end": 0,
"key": {
"end": 0,
"name": "angle",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"left": {
"end": 0,
"name": "hexStartingAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 0,
"left": {
"end": 0,
"raw": "4",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"end": 0,
"name": "hexChangeAngle",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
},
{
"end": 0,
"key": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"name": "hexWallLength",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 0,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 0,
"name": "angledLine",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [],
"callee": {
"end": 0,
"name": "close",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
}
],
"end": 0,
"start": 0,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "hexPattern",
"start": 0,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"left": {
"argument": {
"end": 0,
"name": "headLength",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "*",
"right": {
"end": 0,
"raw": "0.75",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.75,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"end": 0,
"name": "extrude",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 0,
"name": "hexPatternSketch",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "screwBodySketch",
"start": 0,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 0,
"name": "screwHead",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 0,
"raw": "\"start\"",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "start"
}
],
"callee": {
"end": 0,
"name": "startSketchOn",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "center",
"start": 0,
"type": "Identifier"
},
"arg": {
"elements": [
{
"computed": false,
"end": 0,
"object": {
"end": 0,
"name": "start",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"property": {
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
"start": 0,
"type": "MemberExpression",
"type": "MemberExpression"
},
{
"computed": false,
"end": 0,
"object": {
"end": 0,
"name": "start",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"property": {
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 0,
"type": "MemberExpression",
"type": "MemberExpression"
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "radius",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"left": {
"end": 0,
"name": "dia",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"end": 0,
"name": "circle",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 0,
"start": 0,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "screwBody",
"start": 0,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 0,
"name": "extrude",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 0,
"name": "screwBodySketch",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"argument": {
"end": 0,
"name": "screwBody",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 0,
"nonCodeMeta": {
"nonCodeNodes": {
"1": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Define the sketch of the hex pattern on the screw head",
"style": "line"
}
}
],
"3": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Create the head of the cap screw",
"style": "line"
}
}
]
},
"start": 0
},
"end": 0,
"params": [
{
"type": "Parameter",
"identifier": {
"end": 0,
"name": "start",
"start": 0,
"type": "Identifier"
}
},
{
"type": "Parameter",
"identifier": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
}
},
{
"type": "Parameter",
"identifier": {
"end": 0,
"name": "dia",
"start": 0,
"type": "Identifier"
}
},
{
"type": "Parameter",
"identifier": {
"end": 0,
"name": "capHeadLength",
"start": 0,
"type": "Identifier"
}
}
],
"start": 0,
"type": "FunctionExpression",
"type": "FunctionExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "fn",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 0,
"expression": {
"arguments": [
{
"elements": [
{
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 0,
"name": "screwLength",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 0,
"name": "screwDiameter",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 0,
"name": "screwDiameter",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
],
"callee": {
"end": 0,
"name": "capScrew",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 0,
"innerAttrs": [
{
"end": 0,
"name": {
"end": 0,
"name": "settings",
"start": 0,
"type": "Identifier"
},
"properties": [
{
"end": 0,
"key": {
"end": 0,
"name": "defaultLengthUnit",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"name": "in",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 0,
"type": "Annotation"
}
],
"nonCodeMeta": {
"nonCodeNodes": {
"8": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "first angle of hex pattern",
"style": "line"
}
}
],
"10": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Write a function that defines the Socket Head Cap Screw",
"style": "line"
}
}
],
"11": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Socket Head Cap Screw",
"style": "line"
}
},
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "This is for a #10-24 screw that is 1.00 inches long. A socket head cap screw is a type of fastener that is widely used in a variety of applications requiring a high strength fastening solution. It is characterized by its cylindrical head and internal hexagonal drive, which allows for tightening with an Allen wrench or hex key.",
"style": "line"
}
},
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
},
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Set units",
"style": "line"
}
},
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
},
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Define constants",
"style": "line"
}
}
]
},
"start": 0
}
}