diff --git a/.github/workflows/check-exampleKcl.yml b/.github/workflows/check-exampleKcl.yml index 60ec6418cb1..de3863b6633 100644 --- a/.github/workflows/check-exampleKcl.yml +++ b/.github/workflows/check-exampleKcl.yml @@ -5,6 +5,7 @@ on: types: [opened, synchronize] paths: - 'src/lib/exampleKcl.ts' + - 'public/kcl-samples/bracket/main.kcl' permissions: contents: read @@ -22,11 +23,11 @@ jobs: uses: actions/github-script@v7 with: script: | - const message = '`src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.'; + const message = '`public/kcl-samples/bracket/main.kcl` or `src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.'; const issue_number = context.payload.pull_request.number; const owner = context.repo.owner; const repo = context.repo.repo; - + const { data: comments } = await github.rest.issues.listComments({ owner, repo, @@ -43,4 +44,4 @@ jobs: issue_number, body: message, }); - } \ No newline at end of file + } diff --git a/e2e/playwright/code-pane-and-errors.spec.ts b/e2e/playwright/code-pane-and-errors.spec.ts index 76585cbe477..3a66167a51d 100644 --- a/e2e/playwright/code-pane-and-errors.spec.ts +++ b/e2e/playwright/code-pane-and-errors.spec.ts @@ -1,4 +1,4 @@ -import { bracket } from '@src/lib/exampleKcl' +import { bracket } from '@e2e/playwright/fixtures/bracket' import fsp from 'fs/promises' import { join } from 'path' diff --git a/e2e/playwright/fixtures/bracket.ts b/e2e/playwright/fixtures/bracket.ts new file mode 100644 index 00000000000..d17bd431fe9 --- /dev/null +++ b/e2e/playwright/fixtures/bracket.ts @@ -0,0 +1,16 @@ +import fs from 'fs' +import path from 'path' + +export const bracket = fs.readFileSync( + path.resolve( + __dirname, + '..', + '..', + '..', + 'public', + 'kcl-samples', + 'bracket', + 'main.kcl' + ), + 'utf8' +) diff --git a/e2e/playwright/onboarding-tests.spec.ts b/e2e/playwright/onboarding-tests.spec.ts index 63963431b31..1e397c1eade 100644 --- a/e2e/playwright/onboarding-tests.spec.ts +++ b/e2e/playwright/onboarding-tests.spec.ts @@ -1,4 +1,4 @@ -import { bracket } from '@src/lib/exampleKcl' +import { bracket } from '@e2e/playwright/fixtures/bracket' import { onboardingPaths } from '@src/routes/Onboarding/paths' import fsp from 'fs/promises' import { join } from 'path' @@ -15,6 +15,7 @@ import { executorInputPath, getUtils, orRunWhenFullSuiteEnabled, + runningOnWindows, settingsToToml, } from '@e2e/playwright/test-utils' import { expect, test } from '@e2e/playwright/zoo-test' @@ -279,6 +280,9 @@ test.describe('Onboarding tests', () => { if (!tronApp) { fail() } + if (runningOnWindows()) { + test.fixme(orRunWhenFullSuiteEnabled()) + } await tronApp.cleanProjectDir({ app: { onboarding_status: '/parametric-modeling', diff --git a/e2e/playwright/regression-tests.spec.ts b/e2e/playwright/regression-tests.spec.ts index d713e5cbcaa..c5deb4b9cc5 100644 --- a/e2e/playwright/regression-tests.spec.ts +++ b/e2e/playwright/regression-tests.spec.ts @@ -1,5 +1,5 @@ +import { bracket } from '@e2e/playwright/fixtures/bracket' import type { Page } from '@playwright/test' -import { bracket } from '@src/lib/exampleKcl' import { reportRejection } from '@src/lib/trap' import * as fsp from 'fs/promises' import path from 'path' diff --git a/e2e/playwright/testing-samples-loading.spec.ts b/e2e/playwright/testing-samples-loading.spec.ts index affbf289a8b..4b54d117c0a 100644 --- a/e2e/playwright/testing-samples-loading.spec.ts +++ b/e2e/playwright/testing-samples-loading.spec.ts @@ -1,9 +1,13 @@ +import { bracket } from '@e2e/playwright/fixtures/bracket' import { FILE_EXT } from '@src/lib/constants' -import { bracket } from '@src/lib/exampleKcl' import * as fsp from 'fs/promises' import { join } from 'path' -import { getUtils } from '@e2e/playwright/test-utils' +import { + getUtils, + orRunWhenFullSuiteEnabled, + runningOnWindows, +} from '@e2e/playwright/test-utils' import { expect, test } from '@e2e/playwright/zoo-test' test.describe('Testing in-app sample loading', () => { @@ -80,6 +84,9 @@ test.describe('Testing in-app sample loading', () => { 'Desktop: should create new file by default, optionally overwrite', { tag: '@electron' }, async ({ editor, context, page, scene, cmdBar }, testInfo) => { + if (runningOnWindows()) { + test.fixme(orRunWhenFullSuiteEnabled()) + } const { dir } = await context.folderSetupFn(async (dir) => { const bracketDir = join(dir, 'bracket') await fsp.mkdir(bracketDir, { recursive: true }) diff --git a/package.json b/package.json index dd9b573d796..fc33824d1ed 100644 --- a/package.json +++ b/package.json @@ -147,6 +147,7 @@ "importOrder": [ "", "^@rust/(.*)$", + "^@public/(.*)$", "^@e2e/(.*)$", "^@src/(.*)$", "^[./]" diff --git a/public/kcl-samples/bracket/main.kcl b/public/kcl-samples/bracket/main.kcl index 60cf0a172d4..b8e3c56b015 100644 --- a/public/kcl-samples/bracket/main.kcl +++ b/public/kcl-samples/bracket/main.kcl @@ -1,47 +1,84 @@ // Shelf Bracket // This is a bracket that holds a shelf. It is made of aluminum and is designed to hold a force of 300 lbs. The bracket is 6 inches wide and the force is applied at the end of the shelf, 12 inches from the wall. The bracket has a factor of safety of 1.2. The legs of the bracket are 5 inches and 2 inches long. The thickness of the bracket is calculated from the constraints provided. -// Define constants +// Set units +@settings(defaultLengthUnit = in) + +// Define parameters sigmaAllow = 35000 // psi (6061-T6 aluminum) -width = 6 // inch +width = 5.0 p = 300 // Force on shelf - lbs -factorOfSafety = 1.2 // FOS of 1.2 -shelfMountL = 5 // inches -wallMountL = 2 // inches -shelfDepth = 12 // Shelf is 12 inches in depth from the wall -moment = shelfDepth * p // assume the force is applied at the end of the shelf to be conservative (lb-in) - - -// Calculate required thickness of bracket -thickness = sqrt(moment * factorOfSafety * 6 / (sigmaAllow * width)) // this is the calculation of two brackets holding up the shelf (inches) +fos = 1.2 // Factor of safety of 1.2 +shelfMountLength = 5.0 +wallMountLength = 2.25 +shelfDepth = 12 // Shelf is 12 inches deep from the wall +shelfMountingHoleDiameter = .50 +wallMountingHoleDiameter = .625 +// Calculated parameters +moment = shelfDepth * p // assume the force is applied at the end of the shelf +thickness = sqrt(moment * fos * 6 / (sigmaAllow * width)) // required thickness for two brackets to hold up the shelf +bendRadius = 0.25 +extBendRadius = bendRadius + thickness +filletRadius = .5 +shelfMountingHolePlacementOffset = shelfMountingHoleDiameter * 1.5 +wallMountingHolePlacementOffset = wallMountingHoleDiameter * 1.5 -filletRadius = .25 -extFilletRadius = filletRadius + thickness -mountingHoleDiameter = 0.5 +// Add checks to ensure bracket is possible. These make sure that there is adequate distance between holes and edges. +assertGreaterThanOrEq(wallMountLength, wallMountingHoleDiameter * 3, "Holes not possible. Either decrease hole diameter or increase wallMountLength") +assertGreaterThanOrEq(shelfMountLength, shelfMountingHoleDiameter * 5.5, "wallMountLength must be longer for hole sizes to work. Either decrease mounting hole diameters or increase shelfMountLength") +assertGreaterThanOrEq(width, shelfMountingHoleDiameter * 5.5, "Holes not possible. Either decrease hole diameter or increase width") +assertGreaterThanOrEq(width, wallMountingHoleDiameter * 5.5, "Holes not possible. Either decrease hole diameter or increase width") -sketch001 = startSketchOn(XZ) +// Create the body of the bracket +bracketBody = startSketchOn(XZ) |> startProfileAt([0, 0], %) - |> xLine(length = shelfMountL - thickness, tag = $seg01) + |> xLine(length = shelfMountLength - thickness, tag = $seg01) |> yLine(length = thickness, tag = $seg02) - |> xLine(length = -shelfMountL, tag = $seg03) - |> yLine(length = -wallMountL, tag = $seg04) + |> xLine(length = -shelfMountLength, tag = $seg03) + |> yLine(length = -wallMountLength, tag = $seg04) |> xLine(length = thickness, tag = $seg05) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg06) |> close() |> extrude(%, length = width) - |> fillet(radius = extFilletRadius, tags = [getNextAdjacentEdge(seg03)]) - |> fillet(radius = filletRadius, tags = [getNextAdjacentEdge(seg06)]) - |> fillet(radius = filletRadius, tags = [seg02, getOppositeEdge(seg02)]) - |> fillet(radius = filletRadius, tags = [seg05, getOppositeEdge(seg05)]) - -sketch002 = startSketchOn(sketch001, seg03) - |> circle(center = [-1.25, 1], radius = mountingHoleDiameter / 2) - |> patternLinear2d(instances = 2, distance = 2.5, axis = [-1, 0]) - |> patternLinear2d(instances = 2, distance = 4, axis = [0, 1]) + +// Add mounting holes to mount to the shelf +shelfMountingHoles = startSketchOn(bracketBody, seg03) + |> circle( + center = [ + -(bendRadius + shelfMountingHolePlacementOffset), + shelfMountingHolePlacementOffset + ], + radius = shelfMountingHoleDiameter / 2, + ) + |> patternLinear2d(instances = 2, distance = -(extBendRadius + shelfMountingHolePlacementOffset) + shelfMountLength - shelfMountingHolePlacementOffset, axis = [-1, 0]) + |> patternLinear2d(instances = 2, distance = width - (shelfMountingHolePlacementOffset * 2), axis = [0, 1]) |> extrude(%, length = -thickness - .01) -sketch003 = startSketchOn(sketch001, seg04) - |> circle(center = [1, -1], radius = mountingHoleDiameter / 2) - |> patternLinear2d(instances = 2, distance = 4, axis = [1, 0]) +// Add mounting holes to mount to the wall +wallMountingHoles = startSketchOn(bracketBody, seg04) + |> circle( + center = [ + wallMountLength - wallMountingHolePlacementOffset - bendRadius, + wallMountingHolePlacementOffset + ], + radius = wallMountingHoleDiameter / 2, + ) + |> patternLinear2d(instances = 2, distance = width - (wallMountingHolePlacementOffset * 2), axis = [0, 1]) |> extrude(%, length = -thickness - 0.1) + +// Apply bends +fillet(bracketBody, radius = extBendRadius, tags = [getNextAdjacentEdge(seg03)]) +fillet(bracketBody, radius = bendRadius, tags = [getNextAdjacentEdge(seg06)]) + +// Apply corner fillets +fillet( + bracketBody, + radius = filletRadius, + tags = [ + seg02, + getOppositeEdge(seg02), + seg05, + getOppositeEdge(seg05) + ], +) diff --git a/rust/kcl-lib/tests/kcl_samples/bracket/artifact_commands.snap b/rust/kcl-lib/tests/kcl_samples/bracket/artifact_commands.snap index d0b4706333e..c1b11d00986 100644 --- a/rust/kcl-lib/tests/kcl_samples/bracket/artifact_commands.snap +++ b/rust/kcl-lib/tests/kcl_samples/bracket/artifact_commands.snap @@ -29,6 +29,14 @@ description: Artifact commands bracket.kcl "hidden": true } }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "set_scene_units", + "unit": "in" + } + }, { "cmdId": "[uuid]", "range": [], @@ -106,7 +114,7 @@ description: Artifact commands bracket.kcl "segment": { "type": "line", "end": { - "x": 4.6487, + "x": 4.6151, "y": 0.0, "z": 0.0 }, @@ -124,7 +132,7 @@ description: Artifact commands bracket.kcl "type": "line", "end": { "x": 0.0, - "y": 0.3513, + "y": 0.3849, "z": 0.0 }, "relative": true @@ -158,7 +166,7 @@ description: Artifact commands bracket.kcl "type": "line", "end": { "x": 0.0, - "y": -2.0, + "y": -2.25, "z": 0.0 }, "relative": true @@ -174,7 +182,7 @@ description: Artifact commands bracket.kcl "segment": { "type": "line", "end": { - "x": 0.3513, + "x": 0.3849, "y": 0.0, "z": 0.0 }, @@ -229,7 +237,7 @@ description: Artifact commands bracket.kcl "command": { "type": "extrude", "target": "[uuid]", - "distance": 6.0, + "distance": 5.0, "faces": null, "opposite": "None" } @@ -378,118 +386,6 @@ description: Artifact commands bracket.kcl "face_id": "[uuid]" } }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_get_next_adjacent_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "face_id": "[uuid]" - } - }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_get_next_adjacent_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "face_id": "[uuid]" - } - }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_get_opposite_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "face_id": "[uuid]" - } - }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_get_opposite_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "face_id": "[uuid]" - } - }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_fillet_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "radius": 0.601324026261472, - "tolerance": 0.0000001, - "cut_type": "fillet" - } - }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_fillet_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "radius": 0.25, - "tolerance": 0.0000001, - "cut_type": "fillet" - } - }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_fillet_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "radius": 0.25, - "tolerance": 0.0000001, - "cut_type": "fillet" - } - }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_fillet_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "radius": 0.25, - "tolerance": 0.0000001, - "cut_type": "fillet" - } - }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_fillet_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "radius": 0.25, - "tolerance": 0.0000001, - "cut_type": "fillet" - } - }, - { - "cmdId": "[uuid]", - "range": [], - "command": { - "type": "solid3d_fillet_edge", - "object_id": "[uuid]", - "edge_id": "[uuid]", - "radius": 0.25, - "tolerance": 0.0000001, - "cut_type": "fillet" - } - }, { "cmdId": "[uuid]", "range": [], @@ -516,8 +412,8 @@ description: Artifact commands bracket.kcl "type": "move_path_pen", "path": "[uuid]", "to": { - "x": -1.0, - "y": 1.0, + "x": -0.75, + "y": 0.75, "z": 0.0 } } @@ -538,8 +434,8 @@ description: Artifact commands bracket.kcl "segment": { "type": "arc", "center": { - "x": -1.25, - "y": 1.0 + "x": -1.0, + "y": 0.75 }, "radius": 0.25, "start": { @@ -573,7 +469,7 @@ description: Artifact commands bracket.kcl [ { "translate": { - "x": -2.5, + "x": -2.8651438116461088, "y": 0.0, "z": 0.0 }, @@ -614,7 +510,7 @@ description: Artifact commands bracket.kcl { "translate": { "x": 0.0, - "y": 4.0, + "y": 3.5, "z": 0.0 }, "scale": { @@ -654,7 +550,7 @@ description: Artifact commands bracket.kcl { "translate": { "x": 0.0, - "y": 4.0, + "y": 3.5, "z": 0.0 }, "scale": { @@ -700,7 +596,7 @@ description: Artifact commands bracket.kcl "command": { "type": "extrude", "target": "[uuid]", - "distance": -0.361324026261472, + "distance": -0.39485618835389114, "faces": null, "opposite": "None" } @@ -767,7 +663,7 @@ description: Artifact commands bracket.kcl "command": { "type": "extrude", "target": "[uuid]", - "distance": -0.361324026261472, + "distance": -0.39485618835389114, "faces": null, "opposite": "None" } @@ -834,7 +730,7 @@ description: Artifact commands bracket.kcl "command": { "type": "extrude", "target": "[uuid]", - "distance": -0.361324026261472, + "distance": -0.39485618835389114, "faces": null, "opposite": "None" } @@ -901,7 +797,7 @@ description: Artifact commands bracket.kcl "command": { "type": "extrude", "target": "[uuid]", - "distance": -0.361324026261472, + "distance": -0.39485618835389114, "faces": null, "opposite": "None" } @@ -976,8 +872,8 @@ description: Artifact commands bracket.kcl "type": "move_path_pen", "path": "[uuid]", "to": { - "x": 1.25, - "y": -1.0, + "x": 1.375, + "y": 0.9375, "z": 0.0 } } @@ -998,10 +894,10 @@ description: Artifact commands bracket.kcl "segment": { "type": "arc", "center": { - "x": 1.0, - "y": -1.0 + "x": 1.0625, + "y": 0.9375 }, - "radius": 0.25, + "radius": 0.3125, "start": { "unit": "degrees", "value": 0.0 @@ -1033,8 +929,8 @@ description: Artifact commands bracket.kcl [ { "translate": { - "x": 4.0, - "y": 0.0, + "x": 0.0, + "y": 3.125, "z": 0.0 }, "scale": { @@ -1080,7 +976,7 @@ description: Artifact commands bracket.kcl "command": { "type": "extrude", "target": "[uuid]", - "distance": -0.45132402626147194, + "distance": -0.4848561883538911, "faces": null, "opposite": "None" } @@ -1147,7 +1043,7 @@ description: Artifact commands bracket.kcl "command": { "type": "extrude", "target": "[uuid]", - "distance": -0.45132402626147194, + "distance": -0.4848561883538911, "faces": null, "opposite": "None" } @@ -1195,5 +1091,117 @@ description: Artifact commands bracket.kcl "edge_id": "[uuid]", "face_id": "[uuid]" } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_next_adjacent_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_get_opposite_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "face_id": "[uuid]" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_fillet_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "radius": 0.6348561883538911, + "tolerance": 0.0000001, + "cut_type": "fillet" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_fillet_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "radius": 0.25, + "tolerance": 0.0000001, + "cut_type": "fillet" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_fillet_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "radius": 0.5, + "tolerance": 0.0000001, + "cut_type": "fillet" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_fillet_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "radius": 0.5, + "tolerance": 0.0000001, + "cut_type": "fillet" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_fillet_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "radius": 0.5, + "tolerance": 0.0000001, + "cut_type": "fillet" + } + }, + { + "cmdId": "[uuid]", + "range": [], + "command": { + "type": "solid3d_fillet_edge", + "object_id": "[uuid]", + "edge_id": "[uuid]", + "radius": 0.5, + "tolerance": 0.0000001, + "cut_type": "fillet" + } } ] diff --git a/rust/kcl-lib/tests/kcl_samples/bracket/artifact_graph_flowchart.snap.md b/rust/kcl-lib/tests/kcl_samples/bracket/artifact_graph_flowchart.snap.md index 9e5dd235875..de1cd13b350 100644 --- a/rust/kcl-lib/tests/kcl_samples/bracket/artifact_graph_flowchart.snap.md +++ b/rust/kcl-lib/tests/kcl_samples/bracket/artifact_graph_flowchart.snap.md @@ -1,28 +1,28 @@ ```mermaid flowchart LR subgraph path2 [Path] - 2["Path
[1085, 1110, 0]"] - 3["Segment
[1116, 1169, 0]"] - 4["Segment
[1175, 1214, 0]"] - 5["Segment
[1220, 1262, 0]"] - 6["Segment
[1268, 1309, 0]"] - 7["Segment
[1315, 1354, 0]"] - 8["Segment
[1360, 1430, 0]"] - 9["Segment
[1436, 1443, 0]"] + 2["Path
[2001, 2026, 0]"] + 3["Segment
[2032, 2090, 0]"] + 4["Segment
[2096, 2135, 0]"] + 5["Segment
[2141, 2188, 0]"] + 6["Segment
[2194, 2240, 0]"] + 7["Segment
[2246, 2285, 0]"] + 8["Segment
[2291, 2361, 0]"] + 9["Segment
[2367, 2374, 0]"] 10[Solid2d] end - subgraph path38 [Path] - 38["Path
[1823, 1885, 0]"] - 39["Segment
[1823, 1885, 0]"] - 40[Solid2d] + subgraph path32 [Path] + 32["Path
[2512, 2702, 0]"] + 33["Segment
[2512, 2702, 0]"] + 34[Solid2d] end - subgraph path48 [Path] - 48["Path
[2112, 2171, 0]"] - 49["Segment
[2112, 2171, 0]"] - 50[Solid2d] + subgraph path42 [Path] + 42["Path
[3129, 3331, 0]"] + 43["Segment
[3129, 3331, 0]"] + 44[Solid2d] end - 1["Plane
[1062, 1079, 0]"] - 11["Sweep Extrusion
[1449, 1475, 0]"] + 1["Plane
[1978, 1995, 0]"] + 11["Sweep Extrusion
[2380, 2406, 0]"] 12[Wall] 13[Wall] 14[Wall] @@ -43,26 +43,26 @@ flowchart LR 29["SweepEdge Adjacent"] 30["SweepEdge Opposite"] 31["SweepEdge Adjacent"] - 32["EdgeCut Fillet
[1481, 1550, 0]"] - 33["EdgeCut Fillet
[1556, 1622, 0]"] - 34["EdgeCut Fillet
[1628, 1697, 0]"] - 35["EdgeCut Fillet
[1628, 1697, 0]"] - 36["EdgeCut Fillet
[1703, 1772, 0]"] - 37["EdgeCut Fillet
[1703, 1772, 0]"] - 41["Sweep Extrusion
[2024, 2061, 0]"] - 42[Wall] - 43["SweepEdge Opposite"] - 44["SweepEdge Adjacent"] - 45["Sweep Extrusion
[2024, 2061, 0]"] - 46["Sweep Extrusion
[2024, 2061, 0]"] - 47["Sweep Extrusion
[2024, 2061, 0]"] - 51["Sweep Extrusion
[2242, 2279, 0]"] - 52[Wall] - 53["SweepEdge Opposite"] - 54["SweepEdge Adjacent"] - 55["Sweep Extrusion
[2242, 2279, 0]"] - 56["StartSketchOnFace
[1786, 1817, 0]"] - 57["StartSketchOnFace
[2075, 2106, 0]"] + 35["Sweep Extrusion
[2988, 3025, 0]"] + 36[Wall] + 37["SweepEdge Opposite"] + 38["SweepEdge Adjacent"] + 39["Sweep Extrusion
[2988, 3025, 0]"] + 40["Sweep Extrusion
[2988, 3025, 0]"] + 41["Sweep Extrusion
[2988, 3025, 0]"] + 45["Sweep Extrusion
[3446, 3483, 0]"] + 46[Wall] + 47["SweepEdge Opposite"] + 48["SweepEdge Adjacent"] + 49["Sweep Extrusion
[3446, 3483, 0]"] + 50["EdgeCut Fillet
[3500, 3580, 0]"] + 51["EdgeCut Fillet
[3581, 3658, 0]"] + 52["EdgeCut Fillet
[3684, 3826, 0]"] + 53["EdgeCut Fillet
[3684, 3826, 0]"] + 54["EdgeCut Fillet
[3684, 3826, 0]"] + 55["EdgeCut Fillet
[3684, 3826, 0]"] + 56["StartSketchOnFace
[2473, 2506, 0]"] + 57["StartSketchOnFace
[3090, 3123, 0]"] 1 --- 2 2 --- 3 2 --- 4 @@ -79,7 +79,7 @@ flowchart LR 4 --- 13 4 --- 22 4 --- 23 - 4 --- 34 + 4 --- 52 5 --- 14 5 --- 24 5 --- 25 @@ -89,7 +89,7 @@ flowchart LR 7 --- 16 7 --- 28 7 --- 29 - 7 --- 36 + 7 --- 54 8 --- 17 8 --- 30 8 --- 31 @@ -113,30 +113,30 @@ flowchart LR 11 --- 29 11 --- 30 11 --- 31 - 14 --- 38 - 15 --- 48 - 25 <--x 32 - 31 <--x 33 - 22 <--x 35 - 28 <--x 37 - 38 --- 39 - 38 ---- 41 - 38 --- 40 - 39 --- 42 - 39 --- 43 - 39 --- 44 - 41 --- 42 - 41 --- 43 - 41 --- 44 - 48 --- 49 - 48 ---- 51 - 48 --- 50 - 49 --- 52 - 49 --- 53 - 49 --- 54 - 51 --- 52 - 51 --- 53 - 51 --- 54 + 14 --- 32 + 15 --- 42 + 32 --- 33 + 32 ---- 35 + 32 --- 34 + 33 --- 36 + 33 --- 37 + 33 --- 38 + 35 --- 36 + 35 --- 37 + 35 --- 38 + 42 --- 43 + 42 ---- 45 + 42 --- 44 + 43 --- 46 + 43 --- 47 + 43 --- 48 + 45 --- 46 + 45 --- 47 + 45 --- 48 + 25 <--x 50 + 31 <--x 51 + 22 <--x 53 + 28 <--x 55 14 <--x 56 15 <--x 57 ``` diff --git a/rust/kcl-lib/tests/kcl_samples/bracket/ast.snap b/rust/kcl-lib/tests/kcl_samples/bracket/ast.snap index 623e8ddcc58..70676d21098 100644 --- a/rust/kcl-lib/tests/kcl_samples/bracket/ast.snap +++ b/rust/kcl-lib/tests/kcl_samples/bracket/ast.snap @@ -35,11 +35,7 @@ description: Result of parsing bracket.kcl "end": 0, "kind": "const", "preComments": [ - "// Shelf Bracket", - "// This is a bracket that holds a shelf. It is made of aluminum and is designed to hold a force of 300 lbs. The bracket is 6 inches wide and the force is applied at the end of the shelf, 12 inches from the wall. The bracket has a factor of safety of 1.2. The legs of the bracket are 5 inches and 2 inches long. The thickness of the bracket is calculated from the constraints provided.", - "", - "", - "// Define constants" + "// Define parameters" ], "start": 0, "type": "VariableDeclaration", @@ -60,12 +56,12 @@ description: Result of parsing bracket.kcl "init": { "commentStart": 0, "end": 0, - "raw": "6", + "raw": "5.0", "start": 0, "type": "Literal", "type": "Literal", "value": { - "value": 6.0, + "value": 5.0, "suffix": "None" } }, @@ -119,7 +115,7 @@ description: Result of parsing bracket.kcl "id": { "commentStart": 0, "end": 0, - "name": "factorOfSafety", + "name": "fos", "start": 0, "type": "Identifier" }, @@ -152,14 +148,14 @@ description: Result of parsing bracket.kcl "id": { "commentStart": 0, "end": 0, - "name": "shelfMountL", + "name": "shelfMountLength", "start": 0, "type": "Identifier" }, "init": { "commentStart": 0, "end": 0, - "raw": "5", + "raw": "5.0", "start": 0, "type": "Literal", "type": "Literal", @@ -185,19 +181,19 @@ description: Result of parsing bracket.kcl "id": { "commentStart": 0, "end": 0, - "name": "wallMountL", + "name": "wallMountLength", "start": 0, "type": "Identifier" }, "init": { "commentStart": 0, "end": 0, - "raw": "2", + "raw": "2.25", "start": 0, "type": "Literal", "type": "Literal", "value": { - "value": 2.0, + "value": 2.25, "suffix": "None" } }, @@ -243,6 +239,72 @@ description: Result of parsing bracket.kcl "type": "VariableDeclaration", "type": "VariableDeclaration" }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "shelfMountingHoleDiameter", + "start": 0, + "type": "Identifier" + }, + "init": { + "commentStart": 0, + "end": 0, + "raw": ".50", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.5, + "suffix": "None" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "wallMountingHoleDiameter", + "start": 0, + "type": "Identifier" + }, + "init": { + "commentStart": 0, + "end": 0, + "raw": ".625", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.625, + "suffix": "None" + } + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, { "commentStart": 0, "declaration": { @@ -300,6 +362,11 @@ description: Result of parsing bracket.kcl }, "end": 0, "kind": "const", + "preComments": [ + "", + "", + "// Calculated parameters" + ], "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" @@ -351,7 +418,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "factorOfSafety", + "name": "fos", "start": 0, "type": "Identifier" }, @@ -453,9 +520,6 @@ description: Result of parsing bracket.kcl }, "end": 0, "kind": "const", - "preComments": [ - "// Calculate required thickness of bracket" - ], "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" @@ -468,14 +532,14 @@ description: Result of parsing bracket.kcl "id": { "commentStart": 0, "end": 0, - "name": "filletRadius", + "name": "bendRadius", "start": 0, "type": "Identifier" }, "init": { "commentStart": 0, "end": 0, - "raw": ".25", + "raw": "0.25", "start": 0, "type": "Literal", "type": "Literal", @@ -501,7 +565,7 @@ description: Result of parsing bracket.kcl "id": { "commentStart": 0, "end": 0, - "name": "extFilletRadius", + "name": "extBendRadius", "start": 0, "type": "Identifier" }, @@ -515,7 +579,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "filletRadius", + "name": "bendRadius", "start": 0, "type": "Identifier" }, @@ -562,14 +626,14 @@ description: Result of parsing bracket.kcl "id": { "commentStart": 0, "end": 0, - "name": "mountingHoleDiameter", + "name": "filletRadius", "start": 0, "type": "Identifier" }, "init": { "commentStart": 0, "end": 0, - "raw": "0.5", + "raw": ".5", "start": 0, "type": "Literal", "type": "Literal", @@ -595,149 +659,636 @@ description: Result of parsing bracket.kcl "id": { "commentStart": 0, "end": 0, - "name": "sketch001", + "name": "shelfMountingHolePlacementOffset", "start": 0, "type": "Identifier" }, "init": { - "body": [ - { - "arguments": [ - { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "XZ", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name", - "type": "Name" - } - ], - "callee": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "startSketchOn", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name" - }, + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, + "name": "shelfMountingHoleDiameter", "start": 0, - "type": "CallExpression", - "type": "CallExpression" + "type": "Identifier" }, - { - "arguments": [ - { - "commentStart": 0, - "elements": [ - { - "commentStart": 0, - "end": 0, - "raw": "0", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.0, - "suffix": "None" - } - }, - { - "commentStart": 0, - "end": 0, - "raw": "0", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.0, - "suffix": "None" - } - } - ], - "end": 0, - "start": 0, - "type": "ArrayExpression", - "type": "ArrayExpression" - }, - { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "PipeSubstitution", - "type": "PipeSubstitution" - } - ], - "callee": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "startProfileAt", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name" - }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "*", + "right": { + "commentStart": 0, + "end": 0, + "raw": "1.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.5, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "wallMountingHolePlacementOffset", + "start": 0, + "type": "Identifier" + }, + "init": { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, + "name": "wallMountingHoleDiameter", "start": 0, - "type": "CallExpression", - "type": "CallExpression" + "type": "Identifier" }, - { - "arguments": [ - { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "length", - "start": 0, - "type": "Identifier" - }, - "arg": { - "commentStart": 0, - "end": 0, - "left": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "shelfMountL", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name", - "type": "Name" - }, - "operator": "-", - "right": { - "abs_path": false, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "*", + "right": { + "commentStart": 0, + "end": 0, + "raw": "1.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.5, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "end": 0, + "expression": { + "arguments": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "wallMountLength", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "wallMountingHoleDiameter", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "*", + "right": { + "commentStart": 0, + "end": 0, + "raw": "3", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 3.0, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "\"Holes not possible. Either decrease hole diameter or increase wallMountLength\"", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": "Holes not possible. Either decrease hole diameter or increase wallMountLength" + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "assertGreaterThanOrEq", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpression", + "type": "CallExpression" + }, + "preComments": [ + "", + "", + "// Add checks to ensure bracket is possible. These make sure that there is adequate distance between holes and edges." + ], + "start": 0, + "type": "ExpressionStatement", + "type": "ExpressionStatement" + }, + { + "commentStart": 0, + "end": 0, + "expression": { + "arguments": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountLength", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountingHoleDiameter", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "*", + "right": { + "commentStart": 0, + "end": 0, + "raw": "5.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 5.5, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "\"wallMountLength must be longer for hole sizes to work. Either decrease mounting hole diameters or increase shelfMountLength\"", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": "wallMountLength must be longer for hole sizes to work. Either decrease mounting hole diameters or increase shelfMountLength" + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "assertGreaterThanOrEq", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpression", + "type": "CallExpression" + }, + "start": 0, + "type": "ExpressionStatement", + "type": "ExpressionStatement" + }, + { + "commentStart": 0, + "end": 0, + "expression": { + "arguments": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "width", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountingHoleDiameter", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "*", + "right": { + "commentStart": 0, + "end": 0, + "raw": "5.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 5.5, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "\"Holes not possible. Either decrease hole diameter or increase width\"", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": "Holes not possible. Either decrease hole diameter or increase width" + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "assertGreaterThanOrEq", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpression", + "type": "CallExpression" + }, + "start": 0, + "type": "ExpressionStatement", + "type": "ExpressionStatement" + }, + { + "commentStart": 0, + "end": 0, + "expression": { + "arguments": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "width", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "wallMountingHoleDiameter", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "*", + "right": { + "commentStart": 0, + "end": 0, + "raw": "5.5", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 5.5, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "\"Holes not possible. Either decrease hole diameter or increase width\"", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": "Holes not possible. Either decrease hole diameter or increase width" + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "assertGreaterThanOrEq", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpression", + "type": "CallExpression" + }, + "start": 0, + "type": "ExpressionStatement", + "type": "ExpressionStatement" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "bracketBody", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "XZ", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpression", + "type": "CallExpression" + }, + { + "arguments": [ + { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + }, + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startProfileAt", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpression", + "type": "CallExpression" + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountLength", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "-", + "right": { + "abs_path": false, "commentStart": 0, "end": 0, "name": { @@ -886,7 +1437,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "shelfMountL", + "name": "shelfMountLength", "start": 0, "type": "Identifier" }, @@ -963,7 +1514,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "wallMountL", + "name": "wallMountLength", "start": 0, "type": "Identifier" }, @@ -1223,7 +1774,173 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "close", + "name": "close", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpression", + "type": "CallExpression" + }, + { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "length", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "width", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extrude", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } + } + ], + "commentStart": 0, + "end": 0, + "nonCodeMeta": { + "nonCodeNodes": { + "9": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLineBlockComment", + "value": "Add mounting holes to mount to the shelf", + "style": "line" + } + } + ] + }, + "startNodes": [] + }, + "start": 0, + "type": "PipeExpression", + "type": "PipeExpression" + }, + "start": 0, + "type": "VariableDeclarator" + }, + "end": 0, + "kind": "const", + "preComments": [ + "", + "", + "// Create the body of the bracket" + ], + "start": 0, + "type": "VariableDeclaration", + "type": "VariableDeclaration" + }, + { + "commentStart": 0, + "declaration": { + "commentStart": 0, + "end": 0, + "id": { + "commentStart": 0, + "end": 0, + "name": "shelfMountingHoles", + "start": 0, + "type": "Identifier" + }, + "init": { + "body": [ + { + "arguments": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "bracketBody", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "seg03", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "startSketchOn", "start": 0, "type": "Identifier" }, @@ -1244,25 +1961,128 @@ description: Result of parsing bracket.kcl "label": { "commentStart": 0, "end": 0, - "name": "length", + "name": "center", "start": 0, "type": "Identifier" }, "arg": { - "abs_path": false, + "commentStart": 0, + "elements": [ + { + "argument": { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "bendRadius", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "+", + "right": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountingHolePlacementOffset", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountingHolePlacementOffset", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + }, + { + "type": "LabeledArg", + "label": { "commentStart": 0, "end": 0, - "name": { + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, "commentStart": 0, "end": 0, - "name": "width", + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountingHoleDiameter", + "start": 0, + "type": "Identifier" + }, + "path": [], "start": 0, - "type": "Identifier" + "type": "Name", + "type": "Name" + }, + "operator": "/", + "right": { + "commentStart": 0, + "end": 0, + "raw": "2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" + } }, - "path": [], "start": 0, - "type": "Name", - "type": "Name" + "type": "BinaryExpression", + "type": "BinaryExpression" } } ], @@ -1273,7 +2093,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "extrude", + "name": "circle", "start": 0, "type": "Identifier" }, @@ -1286,13 +2106,7 @@ description: Result of parsing bracket.kcl "start": 0, "type": "CallExpressionKw", "type": "CallExpressionKw", - "unlabeled": { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "PipeSubstitution", - "type": "PipeSubstitution" - } + "unlabeled": null }, { "arguments": [ @@ -1301,25 +2115,21 @@ description: Result of parsing bracket.kcl "label": { "commentStart": 0, "end": 0, - "name": "radius", + "name": "instances", "start": 0, "type": "Identifier" }, "arg": { - "abs_path": false, "commentStart": 0, "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "extFilletRadius", - "start": 0, - "type": "Identifier" - }, - "path": [], + "raw": "2", "start": 0, - "type": "Name", - "type": "Name" + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" + } } }, { @@ -1327,23 +2137,28 @@ description: Result of parsing bracket.kcl "label": { "commentStart": 0, "end": 0, - "name": "tags", + "name": "distance", "start": 0, "type": "Identifier" }, "arg": { "commentStart": 0, - "elements": [ - { - "arguments": [ - { + "end": 0, + "left": { + "commentStart": 0, + "end": 0, + "left": { + "argument": { + "commentStart": 0, + "end": 0, + "left": { "abs_path": false, "commentStart": 0, "end": 0, "name": { "commentStart": 0, "end": 0, - "name": "seg03", + "name": "extBendRadius", "start": 0, "type": "Identifier" }, @@ -1351,85 +2166,76 @@ description: Result of parsing bracket.kcl "start": 0, "type": "Name", "type": "Name" - } - ], - "callee": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { + }, + "operator": "+", + "right": { + "abs_path": false, "commentStart": 0, "end": 0, - "name": "getNextAdjacentEdge", + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountingHolePlacementOffset", + "start": 0, + "type": "Identifier" + }, + "path": [], "start": 0, - "type": "Identifier" + "type": "Name", + "type": "Name" }, - "path": [], "start": 0, - "type": "Name" + "type": "BinaryExpression", + "type": "BinaryExpression" }, "commentStart": 0, "end": 0, + "operator": "-", "start": 0, - "type": "CallExpression", - "type": "CallExpression" - } - ], - "end": 0, - "start": 0, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - } - ], - "callee": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "fillet", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name" - }, - "commentStart": 0, - "end": 0, - "start": 0, - "type": "CallExpressionKw", - "type": "CallExpressionKw", - "unlabeled": null - }, - { - "arguments": [ - { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "radius", - "start": 0, - "type": "Identifier" - }, - "arg": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + "operator": "+", + "right": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountLength", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + "operator": "-", + "right": { + "abs_path": false, "commentStart": 0, "end": 0, - "name": "filletRadius", + "name": { + "commentStart": 0, + "end": 0, + "name": "shelfMountingHolePlacementOffset", + "start": 0, + "type": "Identifier" + }, + "path": [], "start": 0, - "type": "Identifier" + "type": "Name", + "type": "Name" }, - "path": [], "start": 0, - "type": "Name", - "type": "Name" + "type": "BinaryExpression", + "type": "BinaryExpression" } }, { @@ -1437,7 +2243,7 @@ description: Result of parsing bracket.kcl "label": { "commentStart": 0, "end": 0, - "name": "tags", + "name": "axis", "start": 0, "type": "Identifier" }, @@ -1445,44 +2251,36 @@ description: Result of parsing bracket.kcl "commentStart": 0, "elements": [ { - "arguments": [ - { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "seg06", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name", - "type": "Name" - } - ], - "callee": { - "abs_path": false, + "argument": { "commentStart": 0, "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "getNextAdjacentEdge", - "start": 0, - "type": "Identifier" - }, - "path": [], + "raw": "1", "start": 0, - "type": "Name" + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } }, "commentStart": 0, "end": 0, + "operator": "-", "start": 0, - "type": "CallExpression", - "type": "CallExpression" + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } } ], "end": 0, @@ -1499,7 +2297,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "fillet", + "name": "patternLinear2d", "start": 0, "type": "Identifier" }, @@ -1521,25 +2319,21 @@ description: Result of parsing bracket.kcl "label": { "commentStart": 0, "end": 0, - "name": "radius", + "name": "instances", "start": 0, "type": "Identifier" }, "arg": { - "abs_path": false, "commentStart": 0, "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "filletRadius", - "start": 0, - "type": "Identifier" - }, - "path": [], + "raw": "2", "start": 0, - "type": "Name", - "type": "Name" + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" + } } }, { @@ -1547,21 +2341,41 @@ description: Result of parsing bracket.kcl "label": { "commentStart": 0, "end": 0, - "name": "tags", + "name": "distance", "start": 0, "type": "Identifier" }, "arg": { "commentStart": 0, - "elements": [ - { + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "width", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "-", + "right": { + "commentStart": 0, + "end": 0, + "left": { "abs_path": false, "commentStart": 0, "end": 0, "name": { "commentStart": 0, "end": 0, - "name": "seg02", + "name": "shelfMountingHolePlacementOffset", "start": 0, "type": "Identifier" }, @@ -1570,45 +2384,63 @@ description: Result of parsing bracket.kcl "type": "Name", "type": "Name" }, + "operator": "*", + "right": { + "commentStart": 0, + "end": 0, + "raw": "2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "axis", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ + { + "commentStart": 0, + "end": 0, + "raw": "0", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.0, + "suffix": "None" + } + }, { - "arguments": [ - { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "seg02", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name", - "type": "Name" - } - ], - "callee": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "getOppositeEdge", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name" - }, "commentStart": 0, "end": 0, + "raw": "1", "start": 0, - "type": "CallExpression", - "type": "CallExpression" + "type": "Literal", + "type": "Literal", + "value": { + "value": 1.0, + "suffix": "None" + } } ], "end": 0, @@ -1625,7 +2457,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "fillet", + "name": "patternLinear2d", "start": 0, "type": "Identifier" }, @@ -1647,100 +2479,53 @@ description: Result of parsing bracket.kcl "label": { "commentStart": 0, "end": 0, - "name": "radius", - "start": 0, - "type": "Identifier" - }, - "arg": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "filletRadius", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name", - "type": "Name" - } - }, - { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "tags", + "name": "length", "start": 0, "type": "Identifier" - }, - "arg": { - "commentStart": 0, - "elements": [ - { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "seg05", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name", - "type": "Name" - }, - { - "arguments": [ - { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "seg05", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name", - "type": "Name" - } - ], - "callee": { - "abs_path": false, + }, + "arg": { + "commentStart": 0, + "end": 0, + "left": { + "argument": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "getOppositeEdge", - "start": 0, - "type": "Identifier" - }, - "path": [], + "name": "thickness", "start": 0, - "type": "Name" + "type": "Identifier" }, - "commentStart": 0, - "end": 0, + "path": [], "start": 0, - "type": "CallExpression", - "type": "CallExpression" + "type": "Name", + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "operator": "-", + "start": 0, + "type": "UnaryExpression", + "type": "UnaryExpression" + }, + "operator": "-", + "right": { + "commentStart": 0, + "end": 0, + "raw": ".01", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 0.01, + "suffix": "None" } - ], - "end": 0, + }, "start": 0, - "type": "ArrayExpression", - "type": "ArrayExpression" + "type": "BinaryExpression", + "type": "BinaryExpression" } } ], @@ -1751,7 +2536,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "fillet", + "name": "extrude", "start": 0, "type": "Identifier" }, @@ -1764,11 +2549,35 @@ description: Result of parsing bracket.kcl "start": 0, "type": "CallExpressionKw", "type": "CallExpressionKw", - "unlabeled": null + "unlabeled": { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "PipeSubstitution", + "type": "PipeSubstitution" + } } ], "commentStart": 0, "end": 0, + "nonCodeMeta": { + "nonCodeNodes": { + "4": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLineBlockComment", + "value": "Add mounting holes to mount to the wall", + "style": "line" + } + } + ] + }, + "startNodes": [] + }, "start": 0, "type": "PipeExpression", "type": "PipeExpression" @@ -1790,7 +2599,7 @@ description: Result of parsing bracket.kcl "id": { "commentStart": 0, "end": 0, - "name": "sketch002", + "name": "wallMountingHoles", "start": 0, "type": "Identifier" }, @@ -1805,7 +2614,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "sketch001", + "name": "bracketBody", "start": 0, "type": "Identifier" }, @@ -1821,7 +2630,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "seg03", + "name": "seg04", "start": 0, "type": "Identifier" }, @@ -1867,157 +2676,90 @@ description: Result of parsing bracket.kcl "commentStart": 0, "elements": [ { - "argument": { + "commentStart": 0, + "end": 0, + "left": { "commentStart": 0, "end": 0, - "raw": "1.25", + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "wallMountLength", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "-", + "right": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "wallMountingHolePlacementOffset", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 1.25, - "suffix": "None" - } + "type": "BinaryExpression", + "type": "BinaryExpression" }, - "commentStart": 0, - "end": 0, "operator": "-", + "right": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "bendRadius", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, "start": 0, - "type": "UnaryExpression", - "type": "UnaryExpression" + "type": "BinaryExpression", + "type": "BinaryExpression" }, { + "abs_path": false, "commentStart": 0, "end": 0, - "raw": "1", + "name": { + "commentStart": 0, + "end": 0, + "name": "wallMountingHolePlacementOffset", + "start": 0, + "type": "Identifier" + }, + "path": [], "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 1.0, - "suffix": "None" - } + "type": "Name", + "type": "Name" } ], "end": 0, "start": 0, "type": "ArrayExpression", - "type": "ArrayExpression" - } - }, - { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "radius", - "start": 0, - "type": "Identifier" - }, - "arg": { - "commentStart": 0, - "end": 0, - "left": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "mountingHoleDiameter", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name", - "type": "Name" - }, - "operator": "/", - "right": { - "commentStart": 0, - "end": 0, - "raw": "2", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 2.0, - "suffix": "None" - } - }, - "start": 0, - "type": "BinaryExpression", - "type": "BinaryExpression" - } - } - ], - "callee": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "circle", - "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name" - }, - "commentStart": 0, - "end": 0, - "start": 0, - "type": "CallExpressionKw", - "type": "CallExpressionKw", - "unlabeled": null - }, - { - "arguments": [ - { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "instances", - "start": 0, - "type": "Identifier" - }, - "arg": { - "commentStart": 0, - "end": 0, - "raw": "2", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 2.0, - "suffix": "None" - } - } - }, - { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "distance", - "start": 0, - "type": "Identifier" - }, - "arg": { - "commentStart": 0, - "end": 0, - "raw": "2.5", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 2.5, - "suffix": "None" - } + "type": "ArrayExpression" } }, { @@ -2025,50 +2767,45 @@ description: Result of parsing bracket.kcl "label": { "commentStart": 0, "end": 0, - "name": "axis", + "name": "radius", "start": 0, "type": "Identifier" }, "arg": { "commentStart": 0, - "elements": [ - { - "argument": { - "commentStart": 0, - "end": 0, - "raw": "1", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 1.0, - "suffix": "None" - } - }, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "operator": "-", + "name": "wallMountingHoleDiameter", "start": 0, - "type": "UnaryExpression", - "type": "UnaryExpression" + "type": "Identifier" }, - { - "commentStart": 0, - "end": 0, - "raw": "0", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.0, - "suffix": "None" - } + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "/", + "right": { + "commentStart": 0, + "end": 0, + "raw": "2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" } - ], - "end": 0, + }, "start": 0, - "type": "ArrayExpression", - "type": "ArrayExpression" + "type": "BinaryExpression", + "type": "BinaryExpression" } } ], @@ -2079,7 +2816,7 @@ description: Result of parsing bracket.kcl "name": { "commentStart": 0, "end": 0, - "name": "patternLinear2d", + "name": "circle", "start": 0, "type": "Identifier" }, @@ -2130,14 +2867,62 @@ description: Result of parsing bracket.kcl "arg": { "commentStart": 0, "end": 0, - "raw": "4", + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "width", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "-", + "right": { + "commentStart": 0, + "end": 0, + "left": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "wallMountingHolePlacementOffset", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + "operator": "*", + "right": { + "commentStart": 0, + "end": 0, + "raw": "2", + "start": 0, + "type": "Literal", + "type": "Literal", + "value": { + "value": 2.0, + "suffix": "None" + } + }, + "start": 0, + "type": "BinaryExpression", + "type": "BinaryExpression" + }, "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 4.0, - "suffix": "None" - } + "type": "BinaryExpression", + "type": "BinaryExpression" } }, { @@ -2248,12 +3033,12 @@ description: Result of parsing bracket.kcl "right": { "commentStart": 0, "end": 0, - "raw": ".01", + "raw": "0.1", "start": 0, "type": "Literal", "type": "Literal", "value": { - "value": 0.01, + "value": 0.1, "suffix": "None" } }, @@ -2294,6 +3079,24 @@ description: Result of parsing bracket.kcl ], "commentStart": 0, "end": 0, + "nonCodeMeta": { + "nonCodeNodes": { + "3": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLineBlockComment", + "value": "Apply bends", + "style": "line" + } + } + ] + }, + "startNodes": [] + }, "start": 0, "type": "PipeExpression", "type": "PipeExpression" @@ -2309,147 +3112,189 @@ description: Result of parsing bracket.kcl }, { "commentStart": 0, - "declaration": { - "commentStart": 0, - "end": 0, - "id": { - "commentStart": 0, - "end": 0, - "name": "sketch003", - "start": 0, - "type": "Identifier" - }, - "init": { - "body": [ - { - "arguments": [ + "end": 0, + "expression": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "extBendRadius", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "tags", + "start": 0, + "type": "Identifier" + }, + "arg": { + "commentStart": 0, + "elements": [ { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { + "arguments": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "seg03", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "callee": { + "abs_path": false, "commentStart": 0, "end": 0, - "name": "sketch001", + "name": { + "commentStart": 0, + "end": 0, + "name": "getNextAdjacentEdge", + "start": 0, + "type": "Identifier" + }, + "path": [], "start": 0, - "type": "Identifier" + "type": "Name" }, - "path": [], - "start": 0, - "type": "Name", - "type": "Name" - }, - { - "abs_path": false, "commentStart": 0, "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "seg04", - "start": 0, - "type": "Identifier" - }, - "path": [], "start": 0, - "type": "Name", - "type": "Name" + "type": "CallExpression", + "type": "CallExpression" } ], - "callee": { - "abs_path": false, + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "fillet", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "bracketBody", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "ExpressionStatement", + "type": "ExpressionStatement" + }, + { + "commentStart": 0, + "end": 0, + "expression": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "startSketchOn", - "start": 0, - "type": "Identifier" - }, - "path": [], + "name": "bendRadius", "start": 0, - "type": "Name" + "type": "Identifier" }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "type": "LabeledArg", + "label": { "commentStart": 0, "end": 0, + "name": "tags", "start": 0, - "type": "CallExpression", - "type": "CallExpression" + "type": "Identifier" }, - { - "arguments": [ - { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "center", - "start": 0, - "type": "Identifier" - }, - "arg": { - "commentStart": 0, - "elements": [ - { - "commentStart": 0, - "end": 0, - "raw": "1", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 1.0, - "suffix": "None" - } - }, - { - "argument": { - "commentStart": 0, - "end": 0, - "raw": "1", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 1.0, - "suffix": "None" - } - }, - "commentStart": 0, - "end": 0, - "operator": "-", - "start": 0, - "type": "UnaryExpression", - "type": "UnaryExpression" - } - ], - "end": 0, - "start": 0, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - }, + "arg": { + "commentStart": 0, + "elements": [ { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "radius", - "start": 0, - "type": "Identifier" - }, - "arg": { - "commentStart": 0, - "end": 0, - "left": { + "arguments": [ + { "abs_path": false, "commentStart": 0, "end": 0, "name": { "commentStart": 0, "end": 0, - "name": "mountingHoleDiameter", + "name": "seg06", "start": 0, "type": "Identifier" }, @@ -2457,280 +3302,346 @@ description: Result of parsing bracket.kcl "start": 0, "type": "Name", "type": "Name" - }, - "operator": "/", - "right": { + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "raw": "2", + "name": "getNextAdjacentEdge", "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 2.0, - "suffix": "None" - } + "type": "Identifier" }, + "path": [], "start": 0, - "type": "BinaryExpression", - "type": "BinaryExpression" - } + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpression", + "type": "CallExpression" } ], - "callee": { - "abs_path": false, + "end": 0, + "start": 0, + "type": "ArrayExpression", + "type": "ArrayExpression" + } + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "fillet", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, + "commentStart": 0, + "end": 0, + "start": 0, + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "bracketBody", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + "start": 0, + "type": "ExpressionStatement", + "type": "ExpressionStatement" + }, + { + "commentStart": 0, + "end": 0, + "expression": { + "arguments": [ + { + "type": "LabeledArg", + "label": { + "commentStart": 0, + "end": 0, + "name": "radius", + "start": 0, + "type": "Identifier" + }, + "arg": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "circle", - "start": 0, - "type": "Identifier" - }, - "path": [], + "name": "filletRadius", "start": 0, - "type": "Name" + "type": "Identifier" }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + }, + { + "type": "LabeledArg", + "label": { "commentStart": 0, "end": 0, + "name": "tags", "start": 0, - "type": "CallExpressionKw", - "type": "CallExpressionKw", - "unlabeled": null + "type": "Identifier" }, - { - "arguments": [ - { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "instances", - "start": 0, - "type": "Identifier" - }, - "arg": { - "commentStart": 0, - "end": 0, - "raw": "2", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 2.0, - "suffix": "None" - } - } - }, + "arg": { + "commentStart": 0, + "elements": [ { - "type": "LabeledArg", - "label": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "name": "distance", + "name": "seg02", "start": 0, "type": "Identifier" }, - "arg": { - "commentStart": 0, - "end": 0, - "raw": "4", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 4.0, - "suffix": "None" - } - } + "path": [], + "start": 0, + "type": "Name", + "type": "Name" }, { - "type": "LabeledArg", - "label": { - "commentStart": 0, - "end": 0, - "name": "axis", - "start": 0, - "type": "Identifier" - }, - "arg": { - "commentStart": 0, - "elements": [ - { + "arguments": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "raw": "1", + "name": "seg02", "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 1.0, - "suffix": "None" - } + "type": "Identifier" }, - { - "commentStart": 0, - "end": 0, - "raw": "0", - "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.0, - "suffix": "None" - } - } - ], + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, "end": 0, - "start": 0, - "type": "ArrayExpression", - "type": "ArrayExpression" - } - } - ], - "callee": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { + "name": { + "commentStart": 0, + "end": 0, + "name": "getOppositeEdge", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name" + }, "commentStart": 0, "end": 0, - "name": "patternLinear2d", "start": 0, - "type": "Identifier" + "type": "CallExpression", + "type": "CallExpression" }, - "path": [], - "start": 0, - "type": "Name" - }, - "commentStart": 0, - "end": 0, - "start": 0, - "type": "CallExpressionKw", - "type": "CallExpressionKw", - "unlabeled": null - }, - { - "arguments": [ { - "type": "LabeledArg", - "label": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "name": "length", + "name": "seg05", "start": 0, "type": "Identifier" }, - "arg": { - "commentStart": 0, - "end": 0, - "left": { - "argument": { - "abs_path": false, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + }, + { + "arguments": [ + { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "name": { - "commentStart": 0, - "end": 0, - "name": "thickness", - "start": 0, - "type": "Identifier" - }, - "path": [], + "name": "seg05", "start": 0, - "type": "Name", - "type": "Name" + "type": "Identifier" }, - "commentStart": 0, - "end": 0, - "operator": "-", + "path": [], "start": 0, - "type": "UnaryExpression", - "type": "UnaryExpression" - }, - "operator": "-", - "right": { + "type": "Name", + "type": "Name" + } + ], + "callee": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { "commentStart": 0, "end": 0, - "raw": "0.1", + "name": "getOppositeEdge", "start": 0, - "type": "Literal", - "type": "Literal", - "value": { - "value": 0.1, - "suffix": "None" - } + "type": "Identifier" }, + "path": [], "start": 0, - "type": "BinaryExpression", - "type": "BinaryExpression" - } - } - ], - "callee": { - "abs_path": false, - "commentStart": 0, - "end": 0, - "name": { + "type": "Name" + }, "commentStart": 0, "end": 0, - "name": "extrude", "start": 0, - "type": "Identifier" - }, - "path": [], - "start": 0, - "type": "Name" - }, - "commentStart": 0, + "type": "CallExpression", + "type": "CallExpression" + } + ], "end": 0, "start": 0, - "type": "CallExpressionKw", - "type": "CallExpressionKw", - "unlabeled": { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "PipeSubstitution", - "type": "PipeSubstitution" - } + "type": "ArrayExpression", + "type": "ArrayExpression" } - ], + } + ], + "callee": { + "abs_path": false, "commentStart": 0, "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "fillet", + "start": 0, + "type": "Identifier" + }, + "path": [], "start": 0, - "type": "PipeExpression", - "type": "PipeExpression" + "type": "Name" }, + "commentStart": 0, + "end": 0, "start": 0, - "type": "VariableDeclarator" + "type": "CallExpressionKw", + "type": "CallExpressionKw", + "unlabeled": { + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "bracketBody", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" + } }, - "end": 0, - "kind": "const", + "preComments": [ + "", + "", + "// Apply corner fillets" + ], "start": 0, - "type": "VariableDeclaration", - "type": "VariableDeclaration" + "type": "ExpressionStatement", + "type": "ExpressionStatement" } ], "commentStart": 0, "end": 0, - "nonCodeMeta": { - "nonCodeNodes": { - "0": [ + "innerAttrs": [ + { + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "settings", + "start": 0, + "type": "Identifier" + }, + "preComments": [ + "// Shelf Bracket", + "// This is a bracket that holds a shelf. It is made of aluminum and is designed to hold a force of 300 lbs. The bracket is 6 inches wide and the force is applied at the end of the shelf, 12 inches from the wall. The bracket has a factor of safety of 1.2. The legs of the bracket are 5 inches and 2 inches long. The thickness of the bracket is calculated from the constraints provided.", + "", + "", + "// Set units" + ], + "properties": [ { "commentStart": 0, "end": 0, + "key": { + "commentStart": 0, + "end": 0, + "name": "defaultLengthUnit", + "start": 0, + "type": "Identifier" + }, "start": 0, - "type": "NonCodeNode", + "type": "ObjectProperty", "value": { - "type": "inlineComment", - "value": "psi (6061-T6 aluminum)", - "style": "line" + "abs_path": false, + "commentStart": 0, + "end": 0, + "name": { + "commentStart": 0, + "end": 0, + "name": "in", + "start": 0, + "type": "Identifier" + }, + "path": [], + "start": 0, + "type": "Name", + "type": "Name" } } ], - "1": [ + "start": 0, + "type": "Annotation" + } + ], + "nonCodeMeta": { + "nonCodeNodes": { + "0": [ { "commentStart": 0, "end": 0, @@ -2738,7 +3649,7 @@ description: Result of parsing bracket.kcl "type": "NonCodeNode", "value": { "type": "inlineComment", - "value": "inch", + "value": "psi (6061-T6 aluminum)", "style": "line" } } @@ -2764,33 +3675,7 @@ description: Result of parsing bracket.kcl "type": "NonCodeNode", "value": { "type": "inlineComment", - "value": "FOS of 1.2", - "style": "line" - } - } - ], - "4": [ - { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "NonCodeNode", - "value": { - "type": "inlineComment", - "value": "inches", - "style": "line" - } - } - ], - "5": [ - { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "NonCodeNode", - "value": { - "type": "inlineComment", - "value": "inches", + "value": "Factor of safety of 1.2", "style": "line" } } @@ -2803,12 +3688,12 @@ description: Result of parsing bracket.kcl "type": "NonCodeNode", "value": { "type": "inlineComment", - "value": "Shelf is 12 inches in depth from the wall", + "value": "Shelf is 12 inches deep from the wall", "style": "line" } } ], - "7": [ + "9": [ { "commentStart": 0, "end": 0, @@ -2816,21 +3701,12 @@ description: Result of parsing bracket.kcl "type": "NonCodeNode", "value": { "type": "inlineComment", - "value": "assume the force is applied at the end of the shelf to be conservative (lb-in)", + "value": "assume the force is applied at the end of the shelf", "style": "line" } - }, - { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "NonCodeNode", - "value": { - "type": "newLine" - } } ], - "8": [ + "10": [ { "commentStart": 0, "end": 0, @@ -2838,55 +3714,23 @@ description: Result of parsing bracket.kcl "type": "NonCodeNode", "value": { "type": "inlineComment", - "value": "this is the calculation of two brackets holding up the shelf (inches)", + "value": "required thickness for two brackets to hold up the shelf", "style": "line" } - }, - { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "NonCodeNode", - "value": { - "type": "newLine" - } - } - ], - "11": [ - { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "NonCodeNode", - "value": { - "type": "newLine" - } - } - ], - "12": [ - { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "NonCodeNode", - "value": { - "type": "newLine" - } - } - ], - "13": [ - { - "commentStart": 0, - "end": 0, - "start": 0, - "type": "NonCodeNode", - "value": { - "type": "newLine" - } } ] }, - "startNodes": [] + "startNodes": [ + { + "commentStart": 0, + "end": 0, + "start": 0, + "type": "NonCodeNode", + "value": { + "type": "newLine" + } + } + ] }, "start": 0 } diff --git a/rust/kcl-lib/tests/kcl_samples/bracket/ops.snap b/rust/kcl-lib/tests/kcl_samples/bracket/ops.snap index 36d9da38048..b0862683b8a 100644 --- a/rust/kcl-lib/tests/kcl_samples/bracket/ops.snap +++ b/rust/kcl-lib/tests/kcl_samples/bracket/ops.snap @@ -23,11 +23,11 @@ description: Operations executed bracket.kcl "length": { "value": { "type": "Number", - "value": 6.0, + "value": 5.0, "ty": { "type": "Default", "len": { - "type": "Mm" + "type": "Inches" }, "angle": { "type": "Degrees" @@ -52,38 +52,136 @@ description: Operations executed bracket.kcl }, { "labeledArgs": { - "radius": { + "data": { + "value": { + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + }, + "tag": { + "value": { + "type": "TagIdentifier", + "value": "seg03", + "artifact_id": "[uuid]" + }, + "sourceRange": [] + } + }, + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": null + }, + { + "labeledArgs": { + "length": { "value": { "type": "Number", - "value": 0.601324026261472, + "value": -0.39485618835389114, "ty": { "type": "Unknown" } }, "sourceRange": [] + } + }, + "name": "extrude", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": { + "value": { + "type": "Array", + "value": [ + { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + } + ] }, - "tags": { + "sourceRange": [] + } + }, + { + "labeledArgs": { + "data": { "value": { - "type": "Array", - "value": [ - { - "type": "Uuid", - "value": "[uuid]" - } - ] + "type": "Solid", + "value": { + "artifactId": "[uuid]" + } + }, + "sourceRange": [] + }, + "tag": { + "value": { + "type": "TagIdentifier", + "value": "seg04", + "artifact_id": "[uuid]" }, "sourceRange": [] } }, - "name": "fillet", + "name": "startSketchOn", + "sourceRange": [], + "type": "StdLibCall", + "unlabeledArg": null + }, + { + "labeledArgs": { + "length": { + "value": { + "type": "Number", + "value": -0.4848561883538911, + "ty": { + "type": "Unknown" + } + }, + "sourceRange": [] + } + }, + "name": "extrude", "sourceRange": [], "type": "StdLibCall", "unlabeledArg": { "value": { - "type": "Solid", - "value": { - "artifactId": "[uuid]" - } + "type": "Array", + "value": [ + { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + }, + { + "type": "Sketch", + "value": { + "artifactId": "[uuid]" + } + } + ] }, "sourceRange": [] } @@ -93,15 +191,9 @@ description: Operations executed bracket.kcl "radius": { "value": { "type": "Number", - "value": 0.25, + "value": 0.6348561883538911, "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } + "type": "Unknown" } }, "sourceRange": [] @@ -141,7 +233,7 @@ description: Operations executed bracket.kcl "ty": { "type": "Default", "len": { - "type": "Mm" + "type": "Inches" }, "angle": { "type": "Degrees" @@ -154,11 +246,6 @@ description: Operations executed bracket.kcl "value": { "type": "Array", "value": [ - { - "type": "TagIdentifier", - "value": "seg02", - "artifact_id": "[uuid]" - }, { "type": "Uuid", "value": "[uuid]" @@ -186,11 +273,11 @@ description: Operations executed bracket.kcl "radius": { "value": { "type": "Number", - "value": 0.25, + "value": 0.5, "ty": { "type": "Default", "len": { - "type": "Mm" + "type": "Inches" }, "angle": { "type": "Degrees" @@ -203,6 +290,15 @@ description: Operations executed bracket.kcl "value": { "type": "Array", "value": [ + { + "type": "TagIdentifier", + "value": "seg02", + "artifact_id": "[uuid]" + }, + { + "type": "Uuid", + "value": "[uuid]" + }, { "type": "TagIdentifier", "value": "seg05", @@ -229,141 +325,5 @@ description: Operations executed bracket.kcl }, "sourceRange": [] } - }, - { - "labeledArgs": { - "data": { - "value": { - "type": "Solid", - "value": { - "artifactId": "[uuid]" - } - }, - "sourceRange": [] - }, - "tag": { - "value": { - "type": "TagIdentifier", - "value": "seg03", - "artifact_id": "[uuid]" - }, - "sourceRange": [] - } - }, - "name": "startSketchOn", - "sourceRange": [], - "type": "StdLibCall", - "unlabeledArg": null - }, - { - "labeledArgs": { - "length": { - "value": { - "type": "Number", - "value": -0.361324026261472, - "ty": { - "type": "Unknown" - } - }, - "sourceRange": [] - } - }, - "name": "extrude", - "sourceRange": [], - "type": "StdLibCall", - "unlabeledArg": { - "value": { - "type": "Array", - "value": [ - { - "type": "Sketch", - "value": { - "artifactId": "[uuid]" - } - }, - { - "type": "Sketch", - "value": { - "artifactId": "[uuid]" - } - }, - { - "type": "Sketch", - "value": { - "artifactId": "[uuid]" - } - }, - { - "type": "Sketch", - "value": { - "artifactId": "[uuid]" - } - } - ] - }, - "sourceRange": [] - } - }, - { - "labeledArgs": { - "data": { - "value": { - "type": "Solid", - "value": { - "artifactId": "[uuid]" - } - }, - "sourceRange": [] - }, - "tag": { - "value": { - "type": "TagIdentifier", - "value": "seg04", - "artifact_id": "[uuid]" - }, - "sourceRange": [] - } - }, - "name": "startSketchOn", - "sourceRange": [], - "type": "StdLibCall", - "unlabeledArg": null - }, - { - "labeledArgs": { - "length": { - "value": { - "type": "Number", - "value": -0.45132402626147194, - "ty": { - "type": "Unknown" - } - }, - "sourceRange": [] - } - }, - "name": "extrude", - "sourceRange": [], - "type": "StdLibCall", - "unlabeledArg": { - "value": { - "type": "Array", - "value": [ - { - "type": "Sketch", - "value": { - "artifactId": "[uuid]" - } - }, - { - "type": "Sketch", - "value": { - "artifactId": "[uuid]" - } - } - ] - }, - "sourceRange": [] - } } ] diff --git a/rust/kcl-lib/tests/kcl_samples/bracket/program_memory.snap b/rust/kcl-lib/tests/kcl_samples/bracket/program_memory.snap index c1852f33df6..39ba66236c9 100644 --- a/rust/kcl-lib/tests/kcl_samples/bracket/program_memory.snap +++ b/rust/kcl-lib/tests/kcl_samples/bracket/program_memory.snap @@ -3,148 +3,20 @@ source: kcl-lib/src/simulation_tests.rs description: Variables in memory after executing bracket.kcl --- { - "extFilletRadius": { - "type": "Number", - "value": 0.6013, - "ty": { - "type": "Unknown" - } - }, - "factorOfSafety": { - "type": "Number", - "value": 1.2, - "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, - "filletRadius": { + "bendRadius": { "type": "Number", "value": 0.25, "ty": { "type": "Default", "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, - "moment": { - "type": "Number", - "value": 3600.0, - "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, - "mountingHoleDiameter": { - "type": "Number", - "value": 0.5, - "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, - "p": { - "type": "Number", - "value": 300.0, - "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, - "seg01": { - "type": "TagIdentifier", - "type": "TagIdentifier", - "value": "seg01" - }, - "seg02": { - "type": "TagIdentifier", - "type": "TagIdentifier", - "value": "seg02" - }, - "seg03": { - "type": "TagIdentifier", - "type": "TagIdentifier", - "value": "seg03" - }, - "seg04": { - "type": "TagIdentifier", - "type": "TagIdentifier", - "value": "seg04" - }, - "seg05": { - "type": "TagIdentifier", - "type": "TagIdentifier", - "value": "seg05" - }, - "seg06": { - "type": "TagIdentifier", - "type": "TagIdentifier", - "value": "seg06" - }, - "shelfDepth": { - "type": "Number", - "value": 12.0, - "ty": { - "type": "Default", - "len": { - "type": "Mm" + "type": "Inches" }, "angle": { "type": "Degrees" } } }, - "shelfMountL": { - "type": "Number", - "value": 5.0, - "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, - "sigmaAllow": { - "type": "Number", - "value": 35000.0, - "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, - "sketch001": { + "bracketBody": { "type": "Solid", "value": { "type": "Solid", @@ -156,9 +28,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, @@ -169,9 +41,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, @@ -182,9 +54,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, @@ -195,9 +67,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, @@ -208,9 +80,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, @@ -221,9 +93,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -244,19 +116,19 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, "to": [ - 4.6487, + 4.6151, 0.0 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -265,23 +137,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, + 4.6151, 0.0 ], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, "to": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -290,23 +162,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, "to": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -315,23 +187,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, "to": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -340,23 +212,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, "to": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -365,13 +237,13 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -381,7 +253,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -400,7 +272,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -430,7 +302,7 @@ description: Variables in memory after executing bracket.kcl "z": 0.0 }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { @@ -443,7 +315,7 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -480,62 +352,159 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": 6.0, + "height": 5.0, "startCapId": "[uuid]", "endCapId": "[uuid]", - "edgeCuts": [ - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.601324026261472, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - } - ], "units": { - "type": "Mm" + "type": "Inches" } } }, - "sketch002": { + "extBendRadius": { + "type": "Number", + "value": 0.6349, + "ty": { + "type": "Unknown" + } + }, + "filletRadius": { + "type": "Number", + "value": 0.5, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "fos": { + "type": "Number", + "value": 1.2, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "moment": { + "type": "Number", + "value": 3600.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "p": { + "type": "Number", + "value": 300.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "seg01": { + "type": "TagIdentifier", + "type": "TagIdentifier", + "value": "seg01" + }, + "seg02": { + "type": "TagIdentifier", + "type": "TagIdentifier", + "value": "seg02" + }, + "seg03": { + "type": "TagIdentifier", + "type": "TagIdentifier", + "value": "seg03" + }, + "seg04": { + "type": "TagIdentifier", + "type": "TagIdentifier", + "value": "seg04" + }, + "seg05": { + "type": "TagIdentifier", + "type": "TagIdentifier", + "value": "seg05" + }, + "seg06": { + "type": "TagIdentifier", + "type": "TagIdentifier", + "value": "seg06" + }, + "shelfDepth": { + "type": "Number", + "value": 12.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "shelfMountLength": { + "type": "Number", + "value": 5.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "shelfMountingHoleDiameter": { + "type": "Number", + "value": 0.5, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "shelfMountingHolePlacementOffset": { + "type": "Number", + "value": 0.75, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "shelfMountingHoles": { "type": "HomArray", "value": [ { @@ -564,22 +533,22 @@ description: Variables in memory after executing bracket.kcl }, "ccw": true, "center": [ - -1.25, - 1.0 + -1.0, + 0.75 ], "from": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "radius": 0.25, "tag": null, "to": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "type": "Circle", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -613,9 +582,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, @@ -626,9 +595,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, @@ -639,9 +608,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, @@ -652,9 +621,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, @@ -665,9 +634,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, @@ -678,9 +647,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -701,19 +670,19 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, "to": [ - 4.6487, + 4.6151, 0.0 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -722,23 +691,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, + 4.6151, 0.0 ], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, "to": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -747,23 +716,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, "to": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -772,23 +741,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, "to": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -797,23 +766,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, "to": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -822,13 +791,13 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -838,7 +807,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -857,7 +826,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -887,7 +856,7 @@ description: Variables in memory after executing bracket.kcl "z": 0.0 }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { @@ -900,7 +869,7 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -937,75 +906,31 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": 6.0, + "height": 5.0, "startCapId": "[uuid]", "endCapId": "[uuid]", - "edgeCuts": [ - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.601324026261472, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - } - ], "units": { - "type": "Mm" + "type": "Inches" } }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { "from": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "to": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -1016,14 +941,14 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": -0.361324026261472, + "height": -0.39485618835389114, "startCapId": null, "endCapId": null, "units": { - "type": "Mm" + "type": "Inches" } } }, @@ -1053,22 +978,22 @@ description: Variables in memory after executing bracket.kcl }, "ccw": true, "center": [ - -1.25, - 1.0 + -1.0, + 0.75 ], "from": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "radius": 0.25, "tag": null, "to": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "type": "Circle", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -1102,9 +1027,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, @@ -1115,9 +1040,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, @@ -1128,9 +1053,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, @@ -1141,9 +1066,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, @@ -1154,9 +1079,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, @@ -1167,9 +1092,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -1190,19 +1115,19 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, "to": [ - 4.6487, + 4.6151, 0.0 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1211,23 +1136,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, + 4.6151, 0.0 ], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, "to": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1236,23 +1161,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, "to": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1261,23 +1186,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, "to": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1286,23 +1211,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, "to": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1311,13 +1236,13 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -1327,7 +1252,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1346,7 +1271,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -1376,7 +1301,7 @@ description: Variables in memory after executing bracket.kcl "z": 0.0 }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { @@ -1389,7 +1314,7 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -1426,75 +1351,31 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": 6.0, + "height": 5.0, "startCapId": "[uuid]", "endCapId": "[uuid]", - "edgeCuts": [ - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.601324026261472, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - } - ], "units": { - "type": "Mm" + "type": "Inches" } }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { "from": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "to": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -1505,14 +1386,14 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": -0.361324026261472, + "height": -0.39485618835389114, "startCapId": null, "endCapId": null, "units": { - "type": "Mm" + "type": "Inches" } } }, @@ -1542,22 +1423,22 @@ description: Variables in memory after executing bracket.kcl }, "ccw": true, "center": [ - -1.25, - 1.0 + -1.0, + 0.75 ], "from": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "radius": 0.25, "tag": null, "to": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "type": "Circle", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -1591,9 +1472,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, @@ -1604,9 +1485,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, @@ -1617,9 +1498,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, @@ -1630,9 +1511,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, @@ -1643,9 +1524,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, @@ -1656,9 +1537,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -1679,19 +1560,19 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, "to": [ - 4.6487, + 4.6151, 0.0 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1700,23 +1581,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, + 4.6151, 0.0 ], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, "to": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1725,23 +1606,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, "to": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1750,23 +1631,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, "to": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1775,23 +1656,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, "to": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1800,13 +1681,13 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -1816,7 +1697,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -1835,7 +1716,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -1865,7 +1746,7 @@ description: Variables in memory after executing bracket.kcl "z": 0.0 }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { @@ -1878,7 +1759,7 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -1915,75 +1796,31 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": 6.0, + "height": 5.0, "startCapId": "[uuid]", "endCapId": "[uuid]", - "edgeCuts": [ - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.601324026261472, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - } - ], "units": { - "type": "Mm" + "type": "Inches" } }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { "from": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "to": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -1994,14 +1831,14 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": -0.361324026261472, + "height": -0.39485618835389114, "startCapId": null, "endCapId": null, "units": { - "type": "Mm" + "type": "Inches" } } }, @@ -2031,22 +1868,22 @@ description: Variables in memory after executing bracket.kcl }, "ccw": true, "center": [ - -1.25, - 1.0 + -1.0, + 0.75 ], "from": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "radius": 0.25, "tag": null, "to": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "type": "Circle", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -2080,9 +1917,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, @@ -2093,9 +1930,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, @@ -2106,9 +1943,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, @@ -2119,9 +1956,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, @@ -2132,9 +1969,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, @@ -2145,9 +1982,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -2168,19 +2005,19 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, "to": [ - 4.6487, + 4.6151, 0.0 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2189,23 +2026,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, + 4.6151, 0.0 ], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, "to": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2214,23 +2051,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, "to": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2239,23 +2076,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, "to": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2264,23 +2101,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, "to": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2289,13 +2126,13 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -2305,7 +2142,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2324,7 +2161,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -2354,7 +2191,7 @@ description: Variables in memory after executing bracket.kcl "z": 0.0 }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { @@ -2367,7 +2204,7 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -2404,75 +2241,31 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": 6.0, + "height": 5.0, "startCapId": "[uuid]", "endCapId": "[uuid]", - "edgeCuts": [ - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.601324026261472, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - } - ], "units": { - "type": "Mm" + "type": "Inches" } }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { "from": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "to": [ - -1.0, - 1.0 + -0.75, + 0.75 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -2483,20 +2276,79 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": -0.361324026261472, + "height": -0.39485618835389114, "startCapId": null, "endCapId": null, "units": { - "type": "Mm" + "type": "Inches" } } } ] }, - "sketch003": { + "sigmaAllow": { + "type": "Number", + "value": 35000.0, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "thickness": { + "type": "Number", + "value": 0.3849, + "ty": { + "type": "Unknown" + } + }, + "wallMountLength": { + "type": "Number", + "value": 2.25, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "wallMountingHoleDiameter": { + "type": "Number", + "value": 0.625, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "wallMountingHolePlacementOffset": { + "type": "Number", + "value": 0.9375, + "ty": { + "type": "Default", + "len": { + "type": "Inches" + }, + "angle": { + "type": "Degrees" + } + } + }, + "wallMountingHoles": { "type": "HomArray", "value": [ { @@ -2525,22 +2377,22 @@ description: Variables in memory after executing bracket.kcl }, "ccw": true, "center": [ - 1.0, - -1.0 + 1.0625, + 0.9375 ], "from": [ - 1.25, - -1.0 + 1.375, + 0.9375 ], - "radius": 0.25, + "radius": 0.3125, "tag": null, "to": [ - 1.25, - -1.0 + 1.375, + 0.9375 ], "type": "Circle", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -2574,9 +2426,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, @@ -2587,9 +2439,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, @@ -2600,9 +2452,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, @@ -2613,9 +2465,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, @@ -2626,9 +2478,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, @@ -2639,9 +2491,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -2662,19 +2514,19 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, "to": [ - 4.6487, + 4.6151, 0.0 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2683,23 +2535,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, + 4.6151, 0.0 ], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, "to": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2708,23 +2560,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, "to": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2733,23 +2585,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, "to": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2758,23 +2610,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, "to": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2783,13 +2635,13 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -2799,7 +2651,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -2818,7 +2670,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -2848,7 +2700,7 @@ description: Variables in memory after executing bracket.kcl "z": 0.0 }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { @@ -2861,7 +2713,7 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -2898,75 +2750,31 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": 6.0, + "height": 5.0, "startCapId": "[uuid]", "endCapId": "[uuid]", - "edgeCuts": [ - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.601324026261472, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - } - ], "units": { - "type": "Mm" + "type": "Inches" } }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { "from": [ - 1.25, - -1.0 + 1.375, + 0.9375 ], "to": [ - 1.25, - -1.0 + 1.375, + 0.9375 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -2977,14 +2785,14 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": -0.45132402626147194, + "height": -0.4848561883538911, "startCapId": null, "endCapId": null, "units": { - "type": "Mm" + "type": "Inches" } } }, @@ -3014,22 +2822,22 @@ description: Variables in memory after executing bracket.kcl }, "ccw": true, "center": [ - 1.0, - -1.0 + 1.0625, + 0.9375 ], "from": [ - 1.25, - -1.0 + 1.375, + 0.9375 ], - "radius": 0.25, + "radius": 0.3125, "tag": null, "to": [ - 1.25, - -1.0 + 1.375, + 0.9375 ], "type": "Circle", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -3063,9 +2871,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, @@ -3076,9 +2884,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, @@ -3089,9 +2897,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, @@ -3102,9 +2910,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, @@ -3115,9 +2923,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, @@ -3128,9 +2936,9 @@ description: Variables in memory after executing bracket.kcl "id": "[uuid]", "sourceRange": [], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -3151,19 +2959,19 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "tag": { - "commentStart": 1162, - "end": 1168, - "start": 1162, + "commentStart": 2083, + "end": 2089, + "start": 2083, "type": "TagDeclarator", "value": "seg01" }, "to": [ - 4.6487, + 4.6151, 0.0 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -3172,23 +2980,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, + 4.6151, 0.0 ], "tag": { - "commentStart": 1207, - "end": 1213, - "start": 1207, + "commentStart": 2128, + "end": 2134, + "start": 2128, "type": "TagDeclarator", "value": "seg02" }, "to": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -3197,23 +3005,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - 4.6487, - 0.3513 + 4.6151, + 0.3849 ], "tag": { - "commentStart": 1255, - "end": 1261, - "start": 1255, + "commentStart": 2181, + "end": 2187, + "start": 2181, "type": "TagDeclarator", "value": "seg03" }, "to": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -3222,23 +3030,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - 0.3513 + -0.3849, + 0.3849 ], "tag": { - "commentStart": 1302, - "end": 1308, - "start": 1302, + "commentStart": 2233, + "end": 2239, + "start": 2233, "type": "TagDeclarator", "value": "seg04" }, "to": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -3247,23 +3055,23 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.3513, - -1.6487 + -0.3849, + -1.8651 ], "tag": { - "commentStart": 1347, - "end": 1353, - "start": 1347, + "commentStart": 2278, + "end": 2284, + "start": 2278, "type": "TagDeclarator", "value": "seg05" }, "to": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -3272,13 +3080,13 @@ description: Variables in memory after executing bracket.kcl "sourceRange": [] }, "from": [ - -0.0, - -1.6487 + 0.0, + -1.8651 ], "tag": { - "commentStart": 1423, - "end": 1429, - "start": 1423, + "commentStart": 2354, + "end": 2360, + "start": 2354, "type": "TagDeclarator", "value": "seg06" }, @@ -3288,7 +3096,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } }, { @@ -3307,7 +3115,7 @@ description: Variables in memory after executing bracket.kcl ], "type": "ToPoint", "units": { - "type": "Mm" + "type": "Inches" } } ], @@ -3337,7 +3145,7 @@ description: Variables in memory after executing bracket.kcl "z": 0.0 }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { @@ -3350,7 +3158,7 @@ description: Variables in memory after executing bracket.kcl 0.0 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -3387,75 +3195,31 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": 6.0, + "height": 5.0, "startCapId": "[uuid]", "endCapId": "[uuid]", - "edgeCuts": [ - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.601324026261472, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - }, - { - "type": "fillet", - "id": "[uuid]", - "radius": 0.25, - "edgeId": "[uuid]", - "tag": null - } - ], "units": { - "type": "Mm" + "type": "Inches" } }, "units": { - "type": "Mm" + "type": "Inches" } }, "start": { "from": [ - 1.25, - -1.0 + 1.375, + 0.9375 ], "to": [ - 1.25, - -1.0 + 1.375, + 0.9375 ], "units": { - "type": "Mm" + "type": "Inches" }, "tag": null, "__geoMeta": { @@ -3466,46 +3230,26 @@ description: Variables in memory after executing bracket.kcl "artifactId": "[uuid]", "originalId": "[uuid]", "units": { - "type": "Mm" + "type": "Inches" } }, - "height": -0.45132402626147194, + "height": -0.4848561883538911, "startCapId": null, "endCapId": null, "units": { - "type": "Mm" + "type": "Inches" } } } ] }, - "thickness": { - "type": "Number", - "value": 0.3513, - "ty": { - "type": "Unknown" - } - }, - "wallMountL": { - "type": "Number", - "value": 2.0, - "ty": { - "type": "Default", - "len": { - "type": "Mm" - }, - "angle": { - "type": "Degrees" - } - } - }, "width": { "type": "Number", - "value": 6.0, + "value": 5.0, "ty": { "type": "Default", "len": { - "type": "Mm" + "type": "Inches" }, "angle": { "type": "Degrees" diff --git a/rust/kcl-lib/tests/kcl_samples/bracket/rendered_model.png b/rust/kcl-lib/tests/kcl_samples/bracket/rendered_model.png index 9623aaddf8a..cbb37657c85 100644 Binary files a/rust/kcl-lib/tests/kcl_samples/bracket/rendered_model.png and b/rust/kcl-lib/tests/kcl_samples/bracket/rendered_model.png differ diff --git a/src/lib/exampleKcl.ts b/src/lib/exampleKcl.ts index ec92a48fb52..76243131790 100644 --- a/src/lib/exampleKcl.ts +++ b/src/lib/exampleKcl.ts @@ -1,53 +1,6 @@ -export const bracket = `// Shelf Bracket -// This is a bracket that holds a shelf. It is made of aluminum and is designed to hold a force of 300 lbs. The bracket is 6 inches wide and the force is applied at the end of the shelf, 12 inches from the wall. The bracket has a factor of safety of 1.2. The legs of the bracket are 5 inches and 2 inches long. The thickness of the bracket is calculated from the constraints provided. +import bracket from '@public/kcl-samples/bracket/main.kcl?raw' - -// Define constants -sigmaAllow = 35000 // psi (6061-T6 aluminum) -width = 6 // inch -p = 300 // Force on shelf - lbs -factorOfSafety = 1.2 // FOS of 1.2 -shelfMountL = 5 // inches -wallMountL = 2 // inches -shelfDepth = 12 // Shelf is 12 inches in depth from the wall -moment = shelfDepth * p // assume the force is applied at the end of the shelf to be conservative (lb-in) - -// Calculate required thickness of bracket -thickness = sqrt(moment * factorOfSafety * 6 / (sigmaAllow * width)) // this is the calculation of two brackets holding up the shelf (inches) - -filletRadius = .25 -extFilletRadius = filletRadius + thickness -mountingHoleDiameter = 0.5 - -sketch001 = startSketchOn(XZ) - |> startProfileAt([0, 0], %) - |> xLine(length = shelfMountL - thickness, tag = $seg01) - |> yLine(length = thickness, tag = $seg02) - |> xLine(length = -shelfMountL, tag = $seg03) - |> yLine(length = -wallMountL, tag = $seg04) - |> xLine(length = thickness, tag = $seg05) - |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg06) - |> close() - -extrude001 = extrude(sketch001, length = width) - |> fillet(radius = extFilletRadius, tags = [getNextAdjacentEdge(seg03)]) - |> fillet(radius = filletRadius, tags = [getNextAdjacentEdge(seg06)]) - |> fillet(radius = filletRadius, tags = [seg02, getOppositeEdge(seg02)]) - |> fillet(radius = filletRadius, tags = [seg05, getOppositeEdge(seg05)]) - -sketch002 = startSketchOn(extrude001, seg03) - |> circle(center = [-1.25, 1], radius = mountingHoleDiameter / 2) - |> patternLinear2d(instances = 2, distance = 2.5, axis = [-1, 0]) - |> patternLinear2d(instances = 2, distance = 4, axis = [0, 1]) - -extrude002 = extrude(sketch002, length = -thickness - .01) - -sketch003 = startSketchOn(extrude002, seg04) - |> circle(center = [1, -1], radius = mountingHoleDiameter / 2) - |> patternLinear2d(instances = 2, distance = 4, axis = [1, 0]) - -extrude003 = extrude(sketch003, length = -thickness - 0.1) -` +export { bracket } /** * @throws Error if the search text is not found in the example code. @@ -70,7 +23,6 @@ function findLineInExampleCode({ } return lineNumber } - export const bracketWidthConstantLine = findLineInExampleCode({ searchText: 'width =', }) diff --git a/tsconfig.json b/tsconfig.json index d379580d98b..aa8aaa0a00b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,6 +11,7 @@ "@rust/*": ["./rust/*"], "@e2e/*": ["./e2e/*"], "@src/*": ["./src/*"], + "@public/*": ["./public/*"], "@root/*": ["./*"] }, "types": [ diff --git a/vite.config.ts b/vite.config.ts index beef0bbb499..ba923f83e66 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -65,6 +65,7 @@ const config = defineConfig({ '@rust': '/rust', '@e2e': '/e2e', '@src': '/src', + '@public': '/public', '@root': '/', }, },