Files
modeling-app/rust/kcl-lib/tests/kcl_samples/lego/ast.snap

3511 lines
118 KiB
Plaintext
Raw Normal View History

test: Vendor kcl-samples and add simulation tests for them (#5460) * Change to unzip * Download kcl-samples as zip to public dir * Fix fetch:samples, e2e electron still not working * Change error message to be clearer * Refactor so that input and output directories of sim tests can be different * Add kcl samples test implementation * Update output since adding kcl_samples tests * Update kcl-samples branch * Fix git-ignore pattern to only apply to the root * Fix yarn install and yarn fetch:samples to work the first time * Remove unneeded exists check * Change to use kcl-samples in public directory * Add kcl-samples * Update output since updating kcl-samples * Update output files * Change to not fetch samples during yarn install * Update output after merge * Ignore kcl-samples in codespell * WIP: Don't run e2e if only kcl-samples changed * Conditionally run cargo tests * Fix to round floating point values in program memory arrays * Update output since merge and rounding numbers in memory * Fix memory redaction for floating point to find more values * Fix float redaction pattern * Update output since rounding floating point numbers * Add center to floating point pattern * Fix trigger to use picomatch syntax * Update output since rounding center * Remove kcl-samples github workflows * Enable Rust backtrace * Update output after re-running * Update output after changing order of post-extrude commands * Fix to have deterministic order of commands * Update output after reverting ordering changes * Update kcl-samples * Update output after updating samples * Fix error messages to show the names of all samples that failed * Change cargo test command to match current one * Update kcl-samples * Update output since updating kcl-samples * Add generate manifest workflow and yarn script * Fix error check to actually work * Change util function to be what we actually need * Move new files after merge * Fix paths since directory move * Add dependabot updates for kcl-samples * Add GitHub workflow to make PR to kcl-samples repo * Add GitHub workflow to check kcl-samples header comments * Fix worfklow to change to the right directory * Add auto-commit simulation test output changes * Add permissions to workflows * Fix to run git commit step * Install just if needed * Fix directory of justfile * Add installation of cargo-insta * Fix to use underscore * Fix to allow just command failure * Change to always install CLI tools and cache them * Trying to fix overwrite failing * Combine commands * Change reviewer * Change to PR targeting the next branch * Change git commands to not do unnecessary fetch * Comment out trigger for creating a PR * Update kcl-samples from next branch * Update outputs after kcl-samples change * Fix to use bash pipefail * Add rust backtrace * Print full env from sim tests * Change command to use long option name * Fix to use ci profile even when calling through just * Add INSTA_UPDATE=always * Fix git push by using an app token on checkout * Add comments * Fix to use bash options * Change to echo when no changes are found * Fix so that kcl-samples updates don't trigger full run * Fix paths to reflect new crate location * Fix path detection * Fix e2e job to ignore kcl_samples simulation test output * Fix the fetch logic for the KCL samples after vendoring (#5661) Fixes the last 2 E2E tests for #5460. --------- Co-authored-by: Pierre Jacquier <pierre@zoo.dev> Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com> Co-authored-by: Frank Noirot <frank@zoo.dev>
2025-03-06 18:01:24 -05:00
---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing lego.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 303,
"id": {
"end": 299,
"name": "lbumps",
"start": 293,
"type": "Identifier"
},
"init": {
"end": 303,
"raw": "5",
"start": 302,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
},
"start": 293,
"type": "VariableDeclarator"
},
"end": 303,
"kind": "const",
"start": 293,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 338,
"id": {
"end": 334,
"name": "wbumps",
"start": 328,
"type": "Identifier"
},
"init": {
"end": 338,
"raw": "3",
"start": 337,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.0,
"suffix": "None"
}
},
"start": 328,
"type": "VariableDeclarator"
},
"end": 338,
"kind": "const",
"start": 328,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 374,
"id": {
"end": 368,
"name": "pitch",
"start": 363,
"type": "Identifier"
},
"init": {
"end": 374,
"raw": "8.0",
"start": 371,
"type": "Literal",
"type": "Literal",
"value": {
"value": 8.0,
"suffix": "None"
}
},
"start": 363,
"type": "VariableDeclarator"
},
"end": 374,
"kind": "const",
"start": 363,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 390,
"id": {
"end": 384,
"name": "clearance",
"start": 375,
"type": "Identifier"
},
"init": {
"end": 390,
"raw": "0.1",
"start": 387,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.1,
"suffix": "None"
}
},
"start": 375,
"type": "VariableDeclarator"
},
"end": 390,
"kind": "const",
"start": 375,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 405,
"id": {
"end": 399,
"name": "bumpDiam",
"start": 391,
"type": "Identifier"
},
"init": {
"end": 405,
"raw": "4.8",
"start": 402,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.8,
"suffix": "None"
}
},
"start": 391,
"type": "VariableDeclarator"
},
"end": 405,
"kind": "const",
"start": 391,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 422,
"id": {
"end": 416,
"name": "bumpHeight",
"start": 406,
"type": "Identifier"
},
"init": {
"end": 422,
"raw": "1.8",
"start": 419,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.8,
"suffix": "None"
}
},
"start": 406,
"type": "VariableDeclarator"
},
"end": 422,
"kind": "const",
"start": 406,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 435,
"id": {
"end": 429,
"name": "height",
"start": 423,
"type": "Identifier"
},
"init": {
"end": 435,
"raw": "3.2",
"start": 432,
"type": "Literal",
"type": "Literal",
"value": {
"value": 3.2,
"suffix": "None"
}
},
"start": 423,
"type": "VariableDeclarator"
},
"end": 435,
"kind": "const",
"start": 423,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 482,
"id": {
"end": 437,
"name": "t",
"start": 436,
"type": "Identifier"
},
"init": {
"end": 482,
"left": {
"end": 475,
"left": {
"end": 463,
"left": {
"end": 446,
"name": "pitch",
"start": 441,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 463,
"left": {
"end": 451,
"raw": "2",
"start": 450,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"end": 463,
"name": "clearance",
"start": 454,
"type": "Identifier",
"type": "Identifier"
},
"start": 450,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 441,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "-",
"right": {
"end": 475,
"name": "bumpDiam",
"start": 467,
"type": "Identifier",
"type": "Identifier"
},
"start": 441,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "/",
"right": {
"end": 482,
"raw": "2.0",
"start": 479,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 441,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 436,
"type": "VariableDeclarator"
},
"end": 482,
"kind": "const",
"start": 436,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 503,
"id": {
"end": 491,
"name": "postDiam",
"start": 483,
"type": "Identifier"
},
"init": {
"end": 503,
"left": {
"end": 499,
"name": "pitch",
"start": 494,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 503,
"name": "t",
"start": 502,
"type": "Identifier",
"type": "Identifier"
},
"start": 494,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 483,
"type": "VariableDeclarator"
},
"end": 503,
"kind": "const",
"start": 483,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 571,
"id": {
"end": 535,
"name": "totalLength",
"start": 524,
"type": "Identifier"
},
"init": {
"end": 571,
"left": {
"end": 552,
"left": {
"end": 544,
"name": "lbumps",
"start": 538,
"type": "Identifier",
"type": "Identifier"
},
"operator": "*",
"right": {
"end": 552,
"name": "pitch",
"start": 547,
"type": "Identifier",
"type": "Identifier"
},
"start": 538,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "-",
"right": {
"end": 571,
"left": {
"end": 559,
"raw": "2.0",
"start": 556,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"end": 571,
"name": "clearance",
"start": 562,
"type": "Identifier",
"type": "Identifier"
},
"start": 556,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 538,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 524,
"type": "VariableDeclarator"
},
"end": 571,
"kind": "const",
"start": 524,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 619,
"id": {
"end": 583,
"name": "totalWidth",
"start": 573,
"type": "Identifier"
},
"init": {
"end": 619,
"left": {
"end": 600,
"left": {
"end": 592,
"name": "wbumps",
"start": 586,
"type": "Identifier",
"type": "Identifier"
},
"operator": "*",
"right": {
"end": 600,
"name": "pitch",
"start": 595,
"type": "Identifier",
"type": "Identifier"
},
"start": 586,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "-",
"right": {
"end": 619,
"left": {
"end": 607,
"raw": "2.0",
"start": 604,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"end": 619,
"name": "clearance",
"start": 610,
"type": "Identifier",
"type": "Identifier"
},
"start": 604,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 586,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 573,
"type": "VariableDeclarator"
},
"end": 619,
"kind": "const",
"start": 573,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 714,
"id": {
"end": 691,
"name": "lSegments",
"start": 682,
"type": "Identifier"
},
"init": {
"end": 714,
"left": {
"end": 705,
"name": "totalLength",
"start": 694,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 714,
"name": "lbumps",
"start": 708,
"type": "Identifier",
"type": "Identifier"
},
"start": 694,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 682,
"type": "VariableDeclarator"
},
"end": 714,
"kind": "const",
"start": 682,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 746,
"id": {
"end": 724,
"name": "wSegments",
"start": 715,
"type": "Identifier"
},
"init": {
"end": 746,
"left": {
"end": 737,
"name": "totalWidth",
"start": 727,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 746,
"name": "wbumps",
"start": 740,
"type": "Identifier",
"type": "Identifier"
},
"start": 727,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 715,
"type": "VariableDeclarator"
},
"end": 746,
"kind": "const",
"start": 715,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 881,
"expression": {
"arguments": [
{
"end": 844,
"name": "lbumps",
"start": 838,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 847,
"raw": "1",
"start": 846,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
{
"end": 880,
"raw": "\"lbumps must be greater than 1\"",
"start": 849,
"type": "Literal",
"type": "Literal",
"value": "lbumps must be greater than 1"
}
],
"callee": {
"end": 837,
"name": "assertGreaterThan",
"start": 820,
"type": "Identifier"
},
"end": 881,
"start": 820,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 820,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"end": 943,
"expression": {
"arguments": [
{
"end": 906,
"name": "wbumps",
"start": 900,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 909,
"raw": "1",
"start": 908,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
{
"end": 942,
"raw": "\"wbumps must be greater than 1\"",
"start": 911,
"type": "Literal",
"type": "Literal",
"value": "wbumps must be greater than 1"
}
],
"callee": {
"end": 899,
"name": "assertGreaterThan",
"start": 882,
"type": "Identifier"
},
"end": 943,
"start": 882,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 882,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"declaration": {
"end": 1243,
"id": {
"end": 1068,
"name": "pegFace",
"start": 1061,
"type": "Identifier"
},
"init": {
"end": 1243,
"properties": [
{
"end": 1241,
"key": {
"end": 1080,
"name": "plane",
"start": 1075,
"type": "Identifier"
},
"start": 1075,
"type": "ObjectProperty",
"value": {
"end": 1241,
"properties": [
{
"end": 1126,
"key": {
"end": 1095,
"name": "origin",
"start": 1089,
"type": "Identifier"
},
"start": 1089,
"type": "ObjectProperty",
"value": {
"end": 1126,
"properties": [
{
"end": 1105,
"key": {
"end": 1101,
"name": "x",
"start": 1100,
"type": "Identifier"
},
"start": 1100,
"type": "ObjectProperty",
"value": {
"end": 1105,
"raw": "0",
"start": 1104,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1112,
"key": {
"end": 1108,
"name": "y",
"start": 1107,
"type": "Identifier"
},
"start": 1107,
"type": "ObjectProperty",
"value": {
"end": 1112,
"raw": "0",
"start": 1111,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1124,
"key": {
"end": 1115,
"name": "z",
"start": 1114,
"type": "Identifier"
},
"start": 1114,
"type": "ObjectProperty",
"value": {
"end": 1124,
"name": "height",
"start": 1118,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 1098,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
},
{
"end": 1163,
"key": {
"end": 1137,
"name": "xAxis",
"start": 1132,
"type": "Identifier"
},
"start": 1132,
"type": "ObjectProperty",
"value": {
"end": 1163,
"properties": [
{
"end": 1147,
"key": {
"end": 1143,
"name": "x",
"start": 1142,
"type": "Identifier"
},
"start": 1142,
"type": "ObjectProperty",
"value": {
"end": 1147,
"raw": "1",
"start": 1146,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
},
{
"end": 1154,
"key": {
"end": 1150,
"name": "y",
"start": 1149,
"type": "Identifier"
},
"start": 1149,
"type": "ObjectProperty",
"value": {
"end": 1154,
"raw": "0",
"start": 1153,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1161,
"key": {
"end": 1157,
"name": "z",
"start": 1156,
"type": "Identifier"
},
"start": 1156,
"type": "ObjectProperty",
"value": {
"end": 1161,
"raw": "0",
"start": 1160,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
}
],
"start": 1140,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
},
{
"end": 1200,
"key": {
"end": 1174,
"name": "yAxis",
"start": 1169,
"type": "Identifier"
},
"start": 1169,
"type": "ObjectProperty",
"value": {
"end": 1200,
"properties": [
{
"end": 1184,
"key": {
"end": 1180,
"name": "x",
"start": 1179,
"type": "Identifier"
},
"start": 1179,
"type": "ObjectProperty",
"value": {
"end": 1184,
"raw": "0",
"start": 1183,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1191,
"key": {
"end": 1187,
"name": "y",
"start": 1186,
"type": "Identifier"
},
"start": 1186,
"type": "ObjectProperty",
"value": {
"end": 1191,
"raw": "1",
"start": 1190,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
},
{
"end": 1198,
"key": {
"end": 1194,
"name": "z",
"start": 1193,
"type": "Identifier"
},
"start": 1193,
"type": "ObjectProperty",
"value": {
"end": 1198,
"raw": "0",
"start": 1197,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
}
],
"start": 1177,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
},
{
"end": 1237,
"key": {
"end": 1211,
"name": "zAxis",
"start": 1206,
"type": "Identifier"
},
"start": 1206,
"type": "ObjectProperty",
"value": {
"end": 1237,
"properties": [
{
"end": 1221,
"key": {
"end": 1217,
"name": "x",
"start": 1216,
"type": "Identifier"
},
"start": 1216,
"type": "ObjectProperty",
"value": {
"end": 1221,
"raw": "0",
"start": 1220,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1228,
"key": {
"end": 1224,
"name": "y",
"start": 1223,
"type": "Identifier"
},
"start": 1223,
"type": "ObjectProperty",
"value": {
"end": 1228,
"raw": "0",
"start": 1227,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1235,
"key": {
"end": 1231,
"name": "z",
"start": 1230,
"type": "Identifier"
},
"start": 1230,
"type": "ObjectProperty",
"value": {
"end": 1235,
"raw": "1",
"start": 1234,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
}
],
"start": 1214,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
}
],
"start": 1083,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
}
],
"start": 1071,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
"start": 1061,
"type": "VariableDeclarator"
},
"end": 1243,
"kind": "const",
"start": 1061,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 1558,
"id": {
"end": 1379,
"name": "tubeFace",
"start": 1371,
"type": "Identifier"
},
"init": {
"end": 1558,
"properties": [
{
"end": 1556,
"key": {
"end": 1391,
"name": "plane",
"start": 1386,
"type": "Identifier"
},
"start": 1386,
"type": "ObjectProperty",
"value": {
"end": 1556,
"properties": [
{
"end": 1441,
"key": {
"end": 1406,
"name": "origin",
"start": 1400,
"type": "Identifier"
},
"start": 1400,
"type": "ObjectProperty",
"value": {
"end": 1441,
"properties": [
{
"end": 1416,
"key": {
"end": 1412,
"name": "x",
"start": 1411,
"type": "Identifier"
},
"start": 1411,
"type": "ObjectProperty",
"value": {
"end": 1416,
"raw": "0",
"start": 1415,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1423,
"key": {
"end": 1419,
"name": "y",
"start": 1418,
"type": "Identifier"
},
"start": 1418,
"type": "ObjectProperty",
"value": {
"end": 1423,
"raw": "0",
"start": 1422,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1439,
"key": {
"end": 1426,
"name": "z",
"start": 1425,
"type": "Identifier"
},
"start": 1425,
"type": "ObjectProperty",
"value": {
"end": 1439,
"left": {
"end": 1435,
"name": "height",
"start": 1429,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 1439,
"name": "t",
"start": 1438,
"type": "Identifier",
"type": "Identifier"
},
"start": 1429,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"start": 1409,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
},
{
"end": 1478,
"key": {
"end": 1452,
"name": "xAxis",
"start": 1447,
"type": "Identifier"
},
"start": 1447,
"type": "ObjectProperty",
"value": {
"end": 1478,
"properties": [
{
"end": 1462,
"key": {
"end": 1458,
"name": "x",
"start": 1457,
"type": "Identifier"
},
"start": 1457,
"type": "ObjectProperty",
"value": {
"end": 1462,
"raw": "1",
"start": 1461,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
},
{
"end": 1469,
"key": {
"end": 1465,
"name": "y",
"start": 1464,
"type": "Identifier"
},
"start": 1464,
"type": "ObjectProperty",
"value": {
"end": 1469,
"raw": "0",
"start": 1468,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1476,
"key": {
"end": 1472,
"name": "z",
"start": 1471,
"type": "Identifier"
},
"start": 1471,
"type": "ObjectProperty",
"value": {
"end": 1476,
"raw": "0",
"start": 1475,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
}
],
"start": 1455,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
},
{
"end": 1515,
"key": {
"end": 1489,
"name": "yAxis",
"start": 1484,
"type": "Identifier"
},
"start": 1484,
"type": "ObjectProperty",
"value": {
"end": 1515,
"properties": [
{
"end": 1499,
"key": {
"end": 1495,
"name": "x",
"start": 1494,
"type": "Identifier"
},
"start": 1494,
"type": "ObjectProperty",
"value": {
"end": 1499,
"raw": "0",
"start": 1498,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1506,
"key": {
"end": 1502,
"name": "y",
"start": 1501,
"type": "Identifier"
},
"start": 1501,
"type": "ObjectProperty",
"value": {
"end": 1506,
"raw": "1",
"start": 1505,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
},
{
"end": 1513,
"key": {
"end": 1509,
"name": "z",
"start": 1508,
"type": "Identifier"
},
"start": 1508,
"type": "ObjectProperty",
"value": {
"end": 1513,
"raw": "0",
"start": 1512,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
}
],
"start": 1492,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
},
{
"end": 1552,
"key": {
"end": 1526,
"name": "zAxis",
"start": 1521,
"type": "Identifier"
},
"start": 1521,
"type": "ObjectProperty",
"value": {
"end": 1552,
"properties": [
{
"end": 1536,
"key": {
"end": 1532,
"name": "x",
"start": 1531,
"type": "Identifier"
},
"start": 1531,
"type": "ObjectProperty",
"value": {
"end": 1536,
"raw": "0",
"start": 1535,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1543,
"key": {
"end": 1539,
"name": "y",
"start": 1538,
"type": "Identifier"
},
"start": 1538,
"type": "ObjectProperty",
"value": {
"end": 1543,
"raw": "0",
"start": 1542,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
},
{
"end": 1550,
"key": {
"end": 1546,
"name": "z",
"start": 1545,
"type": "Identifier"
},
"start": 1545,
"type": "ObjectProperty",
"value": {
"end": 1550,
"raw": "1",
"start": 1549,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
}
],
"start": 1529,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
}
],
"start": 1394,
"type": "ObjectExpression",
"type": "ObjectExpression"
}
}
],
"start": 1382,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
"start": 1371,
"type": "VariableDeclarator"
},
"end": 1558,
"kind": "const",
"start": 1371,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 1935,
"id": {
"end": 1578,
"name": "s",
"start": 1577,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 1599,
"raw": "'XY'",
"start": 1595,
"type": "Literal",
"type": "Literal",
"value": "XY"
}
],
"callee": {
"end": 1594,
"name": "startSketchOn",
"start": 1581,
"type": "Identifier"
},
"end": 1600,
"start": 1581,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"elements": [
{
"end": 1637,
"left": {
"argument": {
"end": 1633,
"name": "totalWidth",
"start": 1623,
"type": "Identifier",
"type": "Identifier"
},
"end": 1633,
"operator": "-",
"start": 1622,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "/",
"right": {
"end": 1637,
"raw": "2",
"start": 1636,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 1622,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 1655,
"left": {
"argument": {
"end": 1651,
"name": "totalLength",
"start": 1640,
"type": "Identifier",
"type": "Identifier"
},
"end": 1651,
"operator": "-",
"start": 1639,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "/",
"right": {
"end": 1655,
"raw": "2",
"start": 1654,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 1639,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"end": 1656,
"start": 1621,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 1659,
"start": 1658,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 1620,
"name": "startProfileAt",
"start": 1606,
"type": "Identifier"
},
"end": 1660,
"start": 1606,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 1674,
"name": "end",
"start": 1671,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 1688,
"name": "totalWidth",
"start": 1678,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 1691,
"raw": "0",
"start": 1690,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 1692,
"start": 1677,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 1670,
"name": "line",
"start": 1666,
"type": "Identifier"
},
"end": 1693,
"start": 1666,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 1707,
"name": "end",
"start": 1704,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 1712,
"raw": "0",
"start": 1711,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 1725,
"name": "totalLength",
"start": 1714,
"type": "Identifier",
"type": "Identifier"
}
],
"end": 1726,
"start": 1710,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 1703,
"name": "line",
"start": 1699,
"type": "Identifier"
},
"end": 1727,
"start": 1699,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 1741,
"name": "end",
"start": 1738,
"type": "Identifier"
},
"arg": {
"elements": [
{
"argument": {
"end": 1756,
"name": "totalWidth",
"start": 1746,
"type": "Identifier",
"type": "Identifier"
},
"end": 1756,
"operator": "-",
"start": 1745,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"end": 1759,
"raw": "0",
"start": 1758,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 1760,
"start": 1744,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 1737,
"name": "line",
"start": 1733,
"type": "Identifier"
},
"end": 1761,
"start": 1733,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [],
"callee": {
"end": 1772,
"name": "close",
"start": 1767,
"type": "Identifier"
},
"end": 1774,
"start": 1767,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 1794,
"name": "length",
"start": 1788,
"type": "Identifier"
},
"arg": {
"end": 1803,
"name": "height",
"start": 1797,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 1787,
"name": "extrude",
"start": 1780,
"type": "Identifier"
},
"end": 1804,
"start": 1780,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 1935,
"nonCodeMeta": {
"nonCodeNodes": {
"6": [
{
"end": 1935,
"start": 1804,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Sketch and extrude a rectangular shape to create the shell underneath the lego. This is a hack until we have a shell function.",
"style": "line"
}
}
]
},
"startNodes": []
},
"start": 1581,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 1577,
"type": "VariableDeclarator"
},
"end": 1935,
"kind": "const",
"start": 1577,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 2295,
"id": {
"end": 1948,
"name": "shellExtrude",
"start": 1936,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 1966,
"name": "s",
"start": 1965,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 1975,
"raw": "\"start\"",
"start": 1968,
"type": "Literal",
"type": "Literal",
"value": "start"
}
],
"callee": {
"end": 1964,
"name": "startSketchOn",
"start": 1951,
"type": "Identifier"
},
"end": 1976,
"start": 1951,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"elements": [
{
"argument": {
"end": 2026,
"left": {
"end": 2022,
"left": {
"end": 2018,
"name": "totalWidth",
"start": 2008,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 2022,
"raw": "2",
"start": 2021,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2008,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "-",
"right": {
"end": 2026,
"name": "t",
"start": 2025,
"type": "Identifier",
"type": "Identifier"
},
"start": 2008,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 2026,
"operator": "-",
"start": 2006,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"argument": {
"end": 2057,
"left": {
"end": 2053,
"left": {
"end": 2049,
"name": "totalLength",
"start": 2038,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 2053,
"raw": "2",
"start": 2052,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2038,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "-",
"right": {
"end": 2057,
"name": "t",
"start": 2056,
"type": "Identifier",
"type": "Identifier"
},
"start": 2038,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 2057,
"operator": "-",
"start": 2036,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 2065,
"start": 1997,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 2068,
"start": 2067,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 1996,
"name": "startProfileAt",
"start": 1982,
"type": "Identifier"
},
"end": 2069,
"start": 1982,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 2083,
"name": "end",
"start": 2080,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 2106,
"left": {
"end": 2097,
"name": "totalWidth",
"start": 2087,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 2106,
"left": {
"end": 2102,
"raw": "2",
"start": 2101,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"end": 2106,
"name": "t",
"start": 2105,
"type": "Identifier",
"type": "Identifier"
},
"start": 2101,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 2087,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 2110,
"raw": "0",
"start": 2109,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 2111,
"start": 2086,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 2079,
"name": "line",
"start": 2075,
"type": "Identifier"
},
"end": 2112,
"start": 2075,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 2126,
"name": "end",
"start": 2123,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 2131,
"raw": "0",
"start": 2130,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 2153,
"left": {
"end": 2144,
"name": "totalLength",
"start": 2133,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 2153,
"left": {
"end": 2149,
"raw": "2",
"start": 2148,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"end": 2153,
"name": "t",
"start": 2152,
"type": "Identifier",
"type": "Identifier"
},
"start": 2148,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 2133,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"end": 2155,
"start": 2129,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 2122,
"name": "line",
"start": 2118,
"type": "Identifier"
},
"end": 2156,
"start": 2118,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 2170,
"name": "end",
"start": 2167,
"type": "Identifier"
},
"arg": {
"elements": [
{
"argument": {
"end": 2195,
"left": {
"end": 2186,
"name": "totalWidth",
"start": 2176,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 2195,
"left": {
"end": 2191,
"raw": "2",
"start": 2190,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"end": 2195,
"name": "t",
"start": 2194,
"type": "Identifier",
"type": "Identifier"
},
"start": 2190,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 2176,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 2195,
"operator": "-",
"start": 2174,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"end": 2200,
"raw": "0",
"start": 2199,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 2201,
"start": 2173,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 2166,
"name": "line",
"start": 2162,
"type": "Identifier"
},
"end": 2202,
"start": 2162,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [],
"callee": {
"end": 2213,
"name": "close",
"start": 2208,
"type": "Identifier"
},
"end": 2215,
"start": 2208,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 2235,
"name": "length",
"start": 2229,
"type": "Identifier"
},
"arg": {
"argument": {
"end": 2250,
"left": {
"end": 2246,
"name": "height",
"start": 2240,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 2250,
"name": "t",
"start": 2249,
"type": "Identifier",
"type": "Identifier"
},
"start": 2240,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 2250,
"operator": "-",
"start": 2238,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
}
],
"callee": {
"end": 2228,
"name": "extrude",
"start": 2221,
"type": "Identifier"
},
"end": 2252,
"start": 2221,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 2295,
"nonCodeMeta": {
"nonCodeNodes": {
"6": [
{
"end": 2295,
"start": 2252,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Create the pegs on the top of the base",
"style": "line"
}
}
]
},
"startNodes": []
},
"start": 1951,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 1936,
"type": "VariableDeclarator"
},
"end": 2295,
"kind": "const",
"start": 1936,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 2761,
"id": {
"end": 2299,
"name": "peg",
"start": 2296,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 2317,
"name": "s",
"start": 2316,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 2324,
"raw": "'end'",
"start": 2319,
"type": "Literal",
"type": "Literal",
"value": "end"
}
],
"callee": {
"end": 2315,
"name": "startSketchOn",
"start": 2302,
"type": "Identifier"
},
"end": 2325,
"start": 2302,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 2352,
"name": "center",
"start": 2346,
"type": "Identifier"
},
"arg": {
"elements": [
{
"argument": {
"end": 2392,
"left": {
"end": 2387,
"left": {
"end": 2373,
"name": "pitch",
"start": 2368,
"type": "Identifier",
"type": "Identifier"
},
"operator": "*",
"right": {
"end": 2387,
"left": {
"end": 2383,
"name": "wbumps",
"start": 2377,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 2387,
"raw": "1",
"start": 2386,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 2377,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 2368,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "/",
"right": {
"end": 2392,
"raw": "2",
"start": 2391,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2368,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 2392,
"operator": "-",
"start": 2366,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"argument": {
"end": 2430,
"left": {
"end": 2425,
"left": {
"end": 2411,
"name": "pitch",
"start": 2406,
"type": "Identifier",
"type": "Identifier"
},
"operator": "*",
"right": {
"end": 2425,
"left": {
"end": 2421,
"name": "lbumps",
"start": 2415,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 2425,
"raw": "1",
"start": 2424,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 2415,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 2406,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "/",
"right": {
"end": 2430,
"raw": "2",
"start": 2429,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2406,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 2430,
"operator": "-",
"start": 2404,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 2440,
"start": 2355,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 2455,
"name": "radius",
"start": 2449,
"type": "Identifier"
},
"arg": {
"end": 2470,
"left": {
"end": 2466,
"name": "bumpDiam",
"start": 2458,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 2470,
"raw": "2",
"start": 2469,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2458,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"end": 2337,
"name": "circle",
"start": 2331,
"type": "Identifier"
},
"end": 2477,
"start": 2331,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 2511,
"name": "axis",
"start": 2507,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 2516,
"raw": "1",
"start": 2515,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
{
"end": 2519,
"raw": "0",
"start": 2518,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 2520,
"start": 2514,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 2538,
"name": "instances",
"start": 2529,
"type": "Identifier"
},
"arg": {
"end": 2547,
"name": "wbumps",
"start": 2541,
"type": "Identifier",
"type": "Identifier"
}
},
{
"type": "LabeledArg",
"label": {
"end": 2564,
"name": "distance",
"start": 2556,
"type": "Identifier"
},
"arg": {
"end": 2572,
"name": "pitch",
"start": 2567,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 2498,
"name": "patternLinear2d",
"start": 2483,
"type": "Identifier"
},
"end": 2579,
"start": 2483,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 2613,
"name": "axis",
"start": 2609,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 2618,
"raw": "0",
"start": 2617,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 2621,
"raw": "1",
"start": 2620,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
],
"end": 2622,
"start": 2616,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 2640,
"name": "instances",
"start": 2631,
"type": "Identifier"
},
"arg": {
"end": 2649,
"name": "lbumps",
"start": 2643,
"type": "Identifier",
"type": "Identifier"
}
},
{
"type": "LabeledArg",
"label": {
"end": 2666,
"name": "distance",
"start": 2658,
"type": "Identifier"
},
"arg": {
"end": 2674,
"name": "pitch",
"start": 2669,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 2600,
"name": "patternLinear2d",
"start": 2585,
"type": "Identifier"
},
"end": 2681,
"start": 2585,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 2701,
"name": "length",
"start": 2695,
"type": "Identifier"
},
"arg": {
"end": 2714,
"name": "bumpHeight",
"start": 2704,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 2694,
"name": "extrude",
"start": 2687,
"type": "Identifier"
},
"end": 2715,
"start": 2687,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 2761,
"nonCodeMeta": {
"nonCodeNodes": {
"4": [
{
"end": 2761,
"start": 2715,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Create the pegs on the bottom of the base",
"style": "line"
}
}
]
},
"startNodes": []
},
"start": 2302,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 2296,
"type": "VariableDeclarator"
},
"end": 2761,
"kind": "const",
"start": 2296,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 3226,
"id": {
"end": 2773,
"name": "tubePattern",
"start": 2762,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 2798,
"name": "tubeFace",
"start": 2790,
"type": "Identifier",
"type": "Identifier"
}
],
"callee": {
"end": 2789,
"name": "startSketchOn",
"start": 2776,
"type": "Identifier"
},
"end": 2799,
"start": 2776,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 2826,
"name": "center",
"start": 2820,
"type": "Identifier"
},
"arg": {
"elements": [
{
"argument": {
"end": 2879,
"left": {
"end": 2866,
"left": {
"end": 2861,
"left": {
"end": 2847,
"name": "pitch",
"start": 2842,
"type": "Identifier",
"type": "Identifier"
},
"operator": "*",
"right": {
"end": 2861,
"left": {
"end": 2857,
"name": "wbumps",
"start": 2851,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 2861,
"raw": "1",
"start": 2860,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 2851,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 2842,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "/",
"right": {
"end": 2866,
"raw": "2",
"start": 2865,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2842,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "-",
"right": {
"end": 2879,
"left": {
"end": 2875,
"name": "pitch",
"start": 2870,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 2879,
"raw": "2",
"start": 2878,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2870,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 2842,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 2879,
"operator": "-",
"start": 2840,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"argument": {
"end": 2931,
"left": {
"end": 2918,
"left": {
"end": 2913,
"left": {
"end": 2899,
"name": "pitch",
"start": 2894,
"type": "Identifier",
"type": "Identifier"
},
"operator": "*",
"right": {
"end": 2913,
"left": {
"end": 2909,
"name": "lbumps",
"start": 2903,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 2913,
"raw": "1",
"start": 2912,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 2903,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 2894,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "/",
"right": {
"end": 2918,
"raw": "2",
"start": 2917,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2894,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "-",
"right": {
"end": 2931,
"left": {
"end": 2927,
"name": "pitch",
"start": 2922,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 2931,
"raw": "2",
"start": 2930,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2922,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 2894,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"end": 2931,
"operator": "-",
"start": 2892,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 2942,
"start": 2829,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 2957,
"name": "radius",
"start": 2951,
"type": "Identifier"
},
"arg": {
"end": 2972,
"left": {
"end": 2968,
"name": "bumpDiam",
"start": 2960,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"end": 2972,
"raw": "2",
"start": 2971,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 2960,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"end": 2811,
"name": "circle",
"start": 2805,
"type": "Identifier"
},
"end": 2979,
"start": 2805,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 3013,
"name": "axis",
"start": 3009,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 3018,
"raw": "1",
"start": 3017,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
{
"end": 3021,
"raw": "0",
"start": 3020,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 3022,
"start": 3016,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 3040,
"name": "instances",
"start": 3031,
"type": "Identifier"
},
"arg": {
"end": 3053,
"left": {
"end": 3049,
"name": "wbumps",
"start": 3043,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 3053,
"raw": "1",
"start": 3052,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 3043,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 3070,
"name": "distance",
"start": 3062,
"type": "Identifier"
},
"arg": {
"end": 3078,
"name": "pitch",
"start": 3073,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 3000,
"name": "patternLinear2d",
"start": 2985,
"type": "Identifier"
},
"end": 3085,
"start": 2985,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 3119,
"name": "axis",
"start": 3115,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 3124,
"raw": "0",
"start": 3123,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"end": 3127,
"raw": "1",
"start": 3126,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
}
],
"end": 3128,
"start": 3122,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 3146,
"name": "instances",
"start": 3137,
"type": "Identifier"
},
"arg": {
"end": 3159,
"left": {
"end": 3155,
"name": "lbumps",
"start": 3149,
"type": "Identifier",
"type": "Identifier"
},
"operator": "-",
"right": {
"end": 3159,
"raw": "1",
"start": 3158,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 3149,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
},
{
"type": "LabeledArg",
"label": {
"end": 3176,
"name": "distance",
"start": 3168,
"type": "Identifier"
},
"arg": {
"end": 3184,
"name": "pitch",
"start": 3179,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 3106,
"name": "patternLinear2d",
"start": 3091,
"type": "Identifier"
},
"end": 3191,
"start": 3091,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 3211,
"name": "length",
"start": 3205,
"type": "Identifier"
},
"arg": {
"argument": {
"end": 3225,
"name": "bumpHeight",
"start": 3215,
"type": "Identifier",
"type": "Identifier"
},
"end": 3225,
"operator": "-",
"start": 3214,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
}
],
"callee": {
"end": 3204,
"name": "extrude",
"start": 3197,
"type": "Identifier"
},
"end": 3226,
"start": 3197,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 3226,
"start": 2776,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 2762,
"type": "VariableDeclarator"
},
"end": 3226,
"kind": "const",
"start": 2762,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"end": 3227,
"innerAttrs": [
{
"end": 271,
"name": {
"end": 247,
"name": "settings",
"start": 239,
"type": "Identifier"
},
"properties": [
{
"end": 270,
"key": {
"end": 265,
"name": "defaultLengthUnit",
"start": 248,
"type": "Identifier"
},
"start": 248,
"type": "ObjectProperty",
"value": {
"end": 270,
"name": "in",
"start": 268,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 238,
"type": "Annotation"
}
],
"nonCodeMeta": {
"nonCodeNodes": {
"0": [
{
"end": 327,
"start": 303,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "number of bumps long",
"style": "line"
}
}
],
"1": [
{
"end": 362,
"start": 338,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "number of bumps wide",
"style": "line"
}
}
],
"8": [
{
"end": 523,
"start": 503,
"type": "NonCodeNode",
"value": {
"type": "inlineComment",
"value": "works out to 6.5",
"style": "line"
}
}
],
"10": [
{
"end": 681,
"start": 620,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Calculate the number of segments in the length and width",
"style": "line"
}
}
],
"12": [
{
"end": 819,
"start": 746,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Add assertions to ensure that the number of bumps are greater than 1",
"style": "line"
}
}
],
"14": [
{
"end": 1060,
"start": 943,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Create the plane for the pegs. This is a hack so that the pegs can be patterned along the face of the lego base.",
"style": "line"
}
}
],
"15": [
{
"end": 1370,
"start": 1243,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Create the plane for the tubes underneath the lego. This is a hack so that the tubes can be patterned underneath the lego.",
"style": "line"
}
}
],
"16": [
{
"end": 1576,
"start": 1558,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "Make the base",
"style": "line"
}
}
]
},
"startNodes": [
{
"end": 13,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Lego Brick",
"style": "line"
}
},
{
"end": 223,
"start": 14,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "A standard Lego brick. This is a small, plastic construction block toy that can be interlocked with other blocks to build various structures, models, and figures. There are a lot of hacks used in this code.",
"style": "line"
}
},
{
"end": 225,
"start": 223,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
},
{
"end": 237,
"start": 225,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Set Units",
"style": "line"
}
},
{
"end": 273,
"start": 271,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
},
{
"end": 292,
"start": 273,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Define constants",
"style": "line"
}
}
]
},
"start": 0
}
}