John Smith
john@example.com
---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing enclosure.kcl
{
"Ok": {
"body": [
"commentStart": 115,
"declaration": {
"commentStart": 117,
"end": 0,
"id": {
"name": "length",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 126,
"raw": "175",
"type": "Literal",
"value": {
"value": 175.0,
"suffix": "None"
}
"type": "VariableDeclarator"
"kind": "const",
"type": "VariableDeclaration",
"type": "VariableDeclaration"
"commentStart": 130,
"name": "width",
"commentStart": 138,
"raw": "125",
"value": 125.0,
"commentStart": 142,
"name": "height",
"commentStart": 151,
"raw": "70",
"value": 70.0,
"commentStart": 154,
"name": "wallThickness",
"commentStart": 170,
"raw": "3",
"value": 3.0,
"commentStart": 172,
"name": "holeDia",
"commentStart": 182,
"raw": "4",
"value": 4.0,
"commentStart": 183,
"commentStart": 231,
"name": "sketch001",
"arguments": [
"commentStart": 257,
"raw": "'XY'",
"value": "XY"
],
"callee": {
"commentStart": 243,
"name": "startSketchOn",
"type": "CallExpression",
"type": "CallExpression"
"commentStart": 283,
"elements": [
"commentStart": 284,
"raw": "0",
"value": 0.0,
"commentStart": 287,
"type": "ArrayExpression",
"type": "ArrayExpression"
"commentStart": 291,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
"commentStart": 268,
"name": "startProfileAt",
"commentStart": 310,
"commentStart": 311,
"commentStart": 314,
"type": "Identifier",
"commentStart": 322,
"commentStart": 325,
"type": "TagDeclarator",
"value": "rectangleSegmentA001"
"commentStart": 299,
"name": "angledLine",
"commentStart": 364,
"commentStart": 373,
"left": {
"commentStart": 380,
"name": "rectangleSegmentA001",
"name": "segAng",
"operator": "+",
"right": {
"commentStart": 404,
"raw": "90",
"value": 90.0,
"type": "BinaryExpression",
"type": "BinaryExpression"
"commentStart": 415,
"commentStart": 430,
"commentStart": 433,
"value": "rectangleSegmentB001"
"commentStart": 353,
"commentStart": 472,
"commentStart": 488,
"commentStart": 481,
"argument": {
"commentStart": 526,
"commentStart": 519,
"name": "segLen",
"commentStart": 518,
"operator": "-",
"type": "UnaryExpression",
"type": "UnaryExpression"
"commentStart": 556,
"commentStart": 559,
"value": "rectangleSegmentC001"
"commentStart": 461,
"type": "LabeledArg",
"label": {
"commentStart": 592,
"name": "endAbsolute",
"arg": {
"commentStart": 606,
"commentStart": 621,
"commentStart": 607,
"name": "profileStartX",
"commentStart": 639,
"commentStart": 625,
"name": "profileStartY",
"commentStart": 644,
"name": "tag",
"commentStart": 650,
"value": "rectangleSegmentD001"
"commentStart": 587,
"name": "line",
"type": "CallExpressionKw",
"unlabeled": null
"arguments": [],
"commentStart": 678,
"name": "close",
"type": "PipeExpression",
"type": "PipeExpression"
"preComments": [
"",
"// Model a box with base enclosure dimensions"
"commentStart": 686,
"name": "extrude001",
"commentStart": 718,
"commentStart": 727,
"commentStart": 699,
"name": "extrude",
"unlabeled": {
"commentStart": 707,
"commentStart": 755,
"name": "radius",
"commentStart": 764,
"operator": "*",
"commentStart": 780,
"commentStart": 790,
"name": "tags",
"commentStart": 797,
"commentStart": 828,
"commentStart": 808,
"name": "getNextAdjacentEdge",
"commentStart": 880,
"name": "rectangleSegmentB001",
"commentStart": 860,
"commentStart": 932,
"name": "rectangleSegmentC001",
"commentStart": 912,
"commentStart": 984,
"name": "rectangleSegmentD001",
"commentStart": 964,
"commentStart": 740,
"name": "fillet",
"commentStart": 1114,
"name": "faces",
"commentStart": 1122,
"commentStart": 1123,
"raw": "\"end\"",
"value": "end"
"commentStart": 1138,
"name": "thickness",
"commentStart": 1150,
"commentStart": 1100,
"name": "shell",
"nonCodeMeta": {
"nonCodeNodes": {
"1": [
"commentStart": 1023,
"type": "NonCodeNode",
"type": "newLineBlockComment",
"value": "Apply a shell to the enclosure base to create the internal storage",
"style": "line"
"2": [
"commentStart": 1170,
"value": "Define a function to create the internal structure to secure a fastener at each corner",
]
"startNodes": []
"commentStart": 1262,
"commentStart": 1265,
"name": "function001",
"body": {
"commentStart": 1291,
"commentStart": 1342,
"name": "plane001",
"commentStart": 1353,
"properties": [
"commentStart": 1359,
"key": {
"name": "plane",
"type": "ObjectProperty",
"commentStart": 1367,
"commentStart": 1375,
"name": "origin",
"commentStart": 1384,
"commentStart": 1385,
"raw": "0.0",
"commentStart": 1390,
"commentStart": 1395,
"commentStart": 1417,
"name": "xAxis",
"commentStart": 1425,
"commentStart": 1426,
"raw": "1.0",
"value": 1.0,
"commentStart": 1431,
"commentStart": 1436,
"commentStart": 1448,
"name": "yAxis",
"commentStart": 1456,
"commentStart": 1457,
"commentStart": 1462,
"commentStart": 1467,
"commentStart": 1479,
"name": "zAxis",
"commentStart": 1487,
"commentStart": 1488,
"commentStart": 1493,
"commentStart": 1498,
"type": "ObjectExpression",
"type": "ObjectExpression"
"// Create a plane to sketch on shell interior"
"commentStart": 1514,
"commentStart": 1573,
"name": "sketch002",
"commentStart": 1599,
"commentStart": 1585,
"commentStart": 1633,
"name": "center",
"commentStart": 1642,
"commentStart": 1643,
"computed": false,
"object": {
"name": "originStart",
"property": {
"commentStart": 1655,
"type": "MemberExpression",
"type": "MemberExpression"
"commentStart": 1659,
"commentStart": 1671,
"raw": "1",
"commentStart": 1685,
"commentStart": 1694,
"commentStart": 1704,
"commentStart": 1616,
"name": "circle",
"commentStart": 1756,
"commentStart": 1765,
"commentStart": 1766,
"commentStart": 1778,
"commentStart": 1782,
"commentStart": 1794,
"commentStart": 1808,
"commentStart": 1817,
"commentStart": 1739,
"commentStart": 1835,
"commentStart": 1734,
"name": "hole",
"// Create a pillar with a fasterner hole at the center"
"commentStart": 1840,
"name": "extrude002",
"commentStart": 1872,
"commentStart": 1881,
"commentStart": 1890,
"commentStart": 1853,
"commentStart": 1861,
"commentStart": 1915,
"commentStart": 1904,
"type": "ReturnStatement",
"type": "ReturnStatement"
"type": "newLine"
"start": 0
"commentStart": 1276,
"params": [
"type": "Parameter",
"identifier": {
"commentStart": 1277,
"type": "FunctionExpression",
"type": "FunctionExpression"
"kind": "fn",
"commentStart": 1927,
"expression": {
"commentStart": 1985,
"commentStart": 1989,
"commentStart": 2005,
"commentStart": 2009,
"commentStart": 2020,
"commentStart": 2036,
"commentStart": 2040,
"commentStart": 1973,
"// Place the internal pillar at each corner"
"type": "ExpressionStatement",
"type": "ExpressionStatement"
"commentStart": 2051,
"commentStart": 2063,
"commentStart": 2067,
"commentStart": 2083,
"commentStart": 2087,
"commentStart": 2098,
"commentStart": 2108,
"commentStart": 2124,
"commentStart": 2128,
"commentStart": 2140,
"commentStart": 2152,
"commentStart": 2156,
"commentStart": 2165,
"commentStart": 2181,
"commentStart": 2185,
"commentStart": 2197,
"commentStart": 2213,
"commentStart": 2217,
"commentStart": 2228,
"commentStart": 2240,
"commentStart": 2244,
"commentStart": 2253,
"commentStart": 2269,
"commentStart": 2273,
"commentStart": 2285,
"commentStart": 2295,
"commentStart": 2311,
"commentStart": 2315,
"commentStart": 2326,
"commentStart": 2369,
"name": "sketch003",
"commentStart": 2395,
"commentStart": 2381,
"commentStart": 2421,
"commentStart": 2422,
"commentStart": 2430,
"raw": "1.2",
"value": 1.2,
"commentStart": 2435,
"commentStart": 2439,
"commentStart": 2406,
"commentStart": 2458,
"commentStart": 2459,
"commentStart": 2462,
"commentStart": 2470,
"commentStart": 2473,
"value": "rectangleSegmentA002"
"commentStart": 2447,
"commentStart": 2512,
"commentStart": 2521,
"commentStart": 2528,
"commentStart": 2552,
"commentStart": 2563,
"commentStart": 2578,
"commentStart": 2581,
"value": "rectangleSegmentB002"
"commentStart": 2501,
"commentStart": 2620,
"commentStart": 2636,
"commentStart": 2629,
"commentStart": 2674,
"commentStart": 2667,
"commentStart": 2666,
"commentStart": 2704,
"commentStart": 2707,
"value": "rectangleSegmentC002"
"commentStart": 2609,
"commentStart": 2740,
"commentStart": 2754,
"commentStart": 2769,
"commentStart": 2755,
"commentStart": 2787,
"commentStart": 2773,
"commentStart": 2792,
"commentStart": 2798,
"value": "rectangleSegmentD002"
"commentStart": 2735,
"commentStart": 2826,
"commentStart": 2859,
"commentStart": 2868,
"commentStart": 2879,
"commentStart": 2887,
"commentStart": 2893,
"commentStart": 2909,
"commentStart": 2913,
"commentStart": 2931,
"commentStart": 2947,
"commentStart": 2951,
"commentStart": 2976,
"commentStart": 2985,
"commentStart": 2844,
"commentStart": 3001,
"commentStart": 2839,
"commentStart": 3029,
"commentStart": 3038,
"commentStart": 3049,
"commentStart": 3057,
"commentStart": 3063,
"commentStart": 3079,
"commentStart": 3083,
"commentStart": 3101,
"commentStart": 3111,
"commentStart": 3127,
"commentStart": 3131,
"commentStart": 3157,
"commentStart": 3166,
"commentStart": 3014,
"commentStart": 3182,
"commentStart": 3009,
"commentStart": 3210,
"commentStart": 3219,
"commentStart": 3230,
"commentStart": 3238,
"raw": "2.2",
"value": 2.2,
"commentStart": 3245,
"commentStart": 3261,
"commentStart": 3265,
"commentStart": 3284,
"commentStart": 3300,
"commentStart": 3304,
"commentStart": 3329,
"commentStart": 3338,
"commentStart": 3195,
"commentStart": 3354,
"commentStart": 3190,
"commentStart": 3382,
"commentStart": 3391,
"commentStart": 3402,
"commentStart": 3410,
"commentStart": 3417,
"commentStart": 3433,
"commentStart": 3437,
"commentStart": 3456,
"commentStart": 3466,
"commentStart": 3482,
"commentStart": 3486,
"commentStart": 3512,
"commentStart": 3521,
"commentStart": 3367,
"commentStart": 3537,
"commentStart": 3362,
"// Define lid position and outer surface"
"commentStart": 3540,
"name": "extrude003",
"commentStart": 3572,
"commentStart": 3581,
"commentStart": 3553,
"commentStart": 3561,
"commentStart": 3616,
"commentStart": 3625,
"commentStart": 3641,
"commentStart": 3651,
"commentStart": 3658,
"commentStart": 3689,
"name": "rectangleSegmentA002",
"commentStart": 3669,
"commentStart": 3741,
"name": "rectangleSegmentB002",
"commentStart": 3721,
"commentStart": 3793,
"name": "rectangleSegmentC002",
"commentStart": 3773,
"commentStart": 3845,
"name": "rectangleSegmentD002",
"commentStart": 3825,
"commentStart": 3601,
"commentStart": 3882,
"value": "Define lid inner and sealing surfaces",
"commentStart": 3925,
"name": "sketch004",
"commentStart": 3951,
"commentStart": 3963,
"raw": "'END'",
"value": "END"
"commentStart": 3937,
"commentStart": 3990,
"commentStart": 3999,
"commentStart": 4007,
"commentStart": 4013,
"commentStart": 4035,
"commentStart": 4057,
"commentStart": 3975,
"commentStart": 4076,
"commentStart": 4077,
"commentStart": 4080,
"commentStart": 4089,
"raw": "2",
"value": 2.0,
"commentStart": 4093,
"commentStart": 4110,
"commentStart": 4113,
"value": "rectangleSegmentA003"
"commentStart": 4065,
"commentStart": 4152,
"commentStart": 4161,
"commentStart": 4168,
"name": "rectangleSegmentA003",
"commentStart": 4192,
"commentStart": 4203,
"commentStart": 4213,
"commentStart": 4217,
"commentStart": 4240,
"commentStart": 4243,
"value": "rectangleSegmentB003"
"commentStart": 4141,
"commentStart": 4282,
"commentStart": 4298,
"commentStart": 4291,
"commentStart": 4336,
"commentStart": 4329,
"commentStart": 4328,
"commentStart": 4366,
"commentStart": 4369,
"value": "rectangleSegmentC003"
"commentStart": 4271,
"commentStart": 4402,
"commentStart": 4416,
"commentStart": 4431,
"commentStart": 4417,
"commentStart": 4449,
"commentStart": 4435,
"commentStart": 4454,
"commentStart": 4460,
"value": "rectangleSegmentD003"
"commentStart": 4397,
"commentStart": 4488,
"commentStart": 4521,
"commentStart": 4530,
"commentStart": 4541,
"commentStart": 4549,
"commentStart": 4555,
"commentStart": 4571,
"commentStart": 4575,
"commentStart": 4593,
"commentStart": 4609,
"commentStart": 4613,
"commentStart": 4638,
"commentStart": 4647,
"commentStart": 4657,
"commentStart": 4506,
"commentStart": 4679,
"commentStart": 4501,
"commentStart": 4707,
"commentStart": 4716,
"commentStart": 4727,
"commentStart": 4735,
"commentStart": 4741,
"commentStart": 4757,
"commentStart": 4761,
"commentStart": 4779,
"commentStart": 4789,
"commentStart": 4805,
"commentStart": 4809,
"commentStart": 4835,
"commentStart": 4844,
"commentStart": 4854,
"commentStart": 4692,
"commentStart": 4876,
"commentStart": 4687,
"commentStart": 4904,
"commentStart": 4913,
"commentStart": 4924,
"commentStart": 4932,
"commentStart": 4939,
"commentStart": 4955,
"commentStart": 4959,
"commentStart": 4978,
"commentStart": 4994,
"commentStart": 4998,
"commentStart": 5023,
"commentStart": 5032,
"commentStart": 5042,
"commentStart": 4889,
"commentStart": 5064,
"commentStart": 4884,
"commentStart": 5092,
"commentStart": 5101,
"commentStart": 5112,
"commentStart": 5120,
"commentStart": 5127,
"commentStart": 5143,
"commentStart": 5147,
"commentStart": 5166,
"commentStart": 5176,
"commentStart": 5192,
"commentStart": 5196,
"commentStart": 5222,
"commentStart": 5231,
"commentStart": 5241,
"commentStart": 5077,
"commentStart": 5263,
"commentStart": 5072,
"commentStart": 5266,
"name": "extrude004",
"commentStart": 5298,
"commentStart": 5307,
"commentStart": 5279,
"commentStart": 5287,
"commentStart": 5342,
"commentStart": 5351,
"commentStart": 5367,
"commentStart": 5377,
"commentStart": 5384,
"commentStart": 5415,
"commentStart": 5395,
"commentStart": 5467,
"name": "rectangleSegmentB003",
"commentStart": 5447,
"commentStart": 5519,
"name": "rectangleSegmentC003",
"commentStart": 5499,
"commentStart": 5571,
"name": "rectangleSegmentD003",
"commentStart": 5551,
"commentStart": 5327,
"commentStart": 0,
"innerAttrs": [
"name": {
"commentStart": 83,
"name": "settings",
"// Enclosure",
"// An enclosure body and sealing lid for storing items",
"// Set units"
"commentStart": 92,
"name": "defaultLengthUnit",
"commentStart": 112,
"name": "mm",
"type": "Annotation"
"nonCodeNodes": {},
"startNodes": [