Compare commits

..

13 Commits

Author SHA1 Message Date
3e08a4fa60 Fix test
Combination of two issues:
 - Test was wrong
 - Library code for removing constraints from sketch lines was wrong,
   was not properly recognizing when kw calls were absolute or relative
   because they only considered the function name, not its parameters
   (and parameters like 'length' or 'endAbsolute' determine if a call
   is actually relative/absolute, not just the function name)
2025-02-27 12:53:50 -06:00
e54ba22cd4 More places need to know how to tell if a call is absolute, and map it to a tooltip if so 2025-02-26 22:40:29 -06:00
f948be474a Update tests that still use positional data
Cases where the application/library code was correct, but the test code
was wrong.
2025-02-26 22:40:29 -06:00
83008f85af Update switch of all kwarg sketch fns to understand x/yLine 2025-02-26 15:08:50 -06:00
b501fab80c Update KCL samples branch 2025-02-25 19:35:10 -06:00
b509c86559 Update codemod for yLine 2025-02-25 18:42:02 -06:00
5b48c42827 Update tests 2025-02-25 16:17:05 -06:00
aa6dd18f93 Redo docs 2025-02-25 15:48:28 -06:00
49d6e079ff Update KCL snippets 2025-02-25 15:44:56 -06:00
1b5f8ecdc2 Update codemods now that xLine/To is kwarg 2025-02-25 15:44:56 -06:00
64c636fcc0 Fix parsing test 2025-02-25 15:44:55 -06:00
97af37bb33 Redo docs 2025-02-25 15:44:55 -06:00
a3540833cf Rust only: migrate xLine/xLineTo to kwargs 2025-02-25 15:44:55 -06:00
102 changed files with 11288 additions and 14639 deletions

2
.gitignore vendored
View File

@ -24,7 +24,7 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
.idea .idea
# .vscode .vscode
.helix .helix
src/wasm-lib/.idea src/wasm-lib/.idea
src/wasm-lib/.vscode src/wasm-lib/.vscode

View File

@ -1,5 +0,0 @@
{
"rust-analyzer.linkedProjects": [
"src/wasm-lib/Cargo.toml"
]
}

View File

@ -36,7 +36,7 @@ sketch001 = startSketchOn('XZ')
angle = angleToMatchLengthY(seg01, 15, %), angle = angleToMatchLengthY(seg01, 15, %),
length = 5 length = 5
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
extrusion = extrude(sketch001, length = 5) extrusion = extrude(sketch001, length = 5)

View File

@ -31,10 +31,10 @@ angledLine(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
```js ```js
exampleSketch = startSketchOn('XZ') exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLineTo(15, %) |> yLine(endAbsolute = 15)
|> angledLine({ angle = 30, length = 15 }, %) |> angledLine({ angle = 30, length = 15 }, %)
|> line(end = [8, -10]) |> line(end = [8, -10])
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,7 @@ sketch001 = startSketchOn('XZ')
angle = toDegrees(asin(0.5)), angle = toDegrees(asin(0.5)),
length = 20 length = 20
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
extrude001 = extrude(sketch001, length = 5) extrude001 = extrude(sketch001, length = 5)

View File

@ -37,7 +37,7 @@ sketch001 = startSketchOn('XZ')
angle = toDegrees(atan(1.25)), angle = toDegrees(atan(1.25)),
length = 20 length = 20
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
extrude001 = extrude(sketch001, length = 5) extrude001 = extrude(sketch001, length = 5)

View File

@ -38,7 +38,7 @@ sketch001 = startSketchOn('XZ')
angle = toDegrees(atan2(1.25, 2)), angle = toDegrees(atan2(1.25, 2)),
length = 20 length = 20
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
extrude001 = extrude(sketch001, length = 5) extrude001 = extrude(sketch001, length = 5)

View File

@ -35,7 +35,7 @@ sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line(endAbsolute = [12, 10]) |> line(endAbsolute = [12, 10])
|> line(end = [ceil(7.02986), 0]) |> line(end = [ceil(7.02986), 0])
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
extrude001 = extrude(sketch001, length = 5) extrude001 = extrude(sketch001, length = 5)

View File

@ -21,7 +21,7 @@ exampleSketch = startSketchOn("XZ")
angle = 30, angle = 30,
length = 2 * E ^ 2, length = 2 * E ^ 2,
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)

View File

@ -21,7 +21,7 @@ exampleSketch = startSketchOn("XZ")
angle = 50, angle = 50,
length = 10 * TAU, length = 10 * TAU,
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

View File

@ -31,7 +31,7 @@ e() -> number
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle = 30, length = 2 * e() ^ 2 }, %) |> angledLine({ angle = 30, length = 2 * e() ^ 2 }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 10) example = extrude(exampleSketch, length = 10)

View File

@ -35,7 +35,7 @@ sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line(endAbsolute = [12, 10]) |> line(endAbsolute = [12, 10])
|> line(end = [floor(7.02986), 0]) |> line(end = [floor(7.02986), 0])
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
extrude001 = extrude(sketch001, length = 5) extrude001 = extrude(sketch001, length = 5)

View File

@ -111,9 +111,7 @@ layout: manual
* [`toDegrees`](kcl/toDegrees) * [`toDegrees`](kcl/toDegrees)
* [`toRadians`](kcl/toRadians) * [`toRadians`](kcl/toRadians)
* [`xLine`](kcl/xLine) * [`xLine`](kcl/xLine)
* [`xLineTo`](kcl/xLineTo)
* [`yLine`](kcl/yLine) * [`yLine`](kcl/yLine)
* [`yLineTo`](kcl/yLineTo)
* [`yd`](kcl/yd) * [`yd`](kcl/yd)
* **`std::math`** * **`std::math`**
* [`E`](kcl/const_std-math-E) * [`E`](kcl/const_std-math-E)

View File

@ -35,7 +35,7 @@ pow(num: number, pow: number) -> number
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle = 50, length = pow(5, 2) }, %) |> angledLine({ angle = 50, length = pow(5, 2) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

View File

@ -35,7 +35,7 @@ sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line(endAbsolute = [12, 10]) |> line(endAbsolute = [12, 10])
|> line(end = [round(7.02986), 0]) |> line(end = [round(7.02986), 0])
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
extrude001 = extrude(sketch001, length = 5) extrude001 = extrude(sketch001, length = 5)

View File

@ -34,7 +34,7 @@ sqrt(num: number) -> number
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle = 50, length = sqrt(2500) }, %) |> angledLine({ angle = 50, length = sqrt(2500) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

View File

@ -134,9 +134,9 @@ a1 = startSketchOn({
}) })
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line(end = [100.0, 0]) |> line(end = [100.0, 0])
|> yLine(-100.0, %) |> yLine(length = -100.0)
|> xLine(-100.0, %) |> xLine(length = -100.0)
|> yLine(100.0, %) |> yLine(length = 100.0)
|> close() |> close()
|> extrude(length = 3.14) |> extrude(length = 3.14)
``` ```

View File

@ -33,7 +33,7 @@ exampleSketch = startSketchOn("XZ")
angle = 30, angle = 30,
length = 3 / cos(toRadians(30)), length = 3 / cos(toRadians(30)),
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

View File

@ -33,7 +33,7 @@ exampleSketch = startSketchOn("XZ")
angle = 50, angle = 50,
length = 15 / sin(toDegrees(135)), length = 15 / sin(toDegrees(135)),
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

View File

@ -33,7 +33,7 @@ exampleSketch = startSketchOn("XZ")
angle = 50, angle = 50,
length = 50 * tan(1/2), length = 50 * tan(1/2),
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@ tau() -> number
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle = 50, length = 10 * tau() }, %) |> angledLine({ angle = 50, length = 10 * tau() }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

View File

@ -37,7 +37,7 @@ exampleSketch = startSketchOn("XZ")
angle = 50, angle = 50,
length = 70 * cos(toDegrees(pi() / 4)) length = 70 * cos(toDegrees(pi() / 4))
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

View File

@ -37,7 +37,7 @@ exampleSketch = startSketchOn("XZ")
angle = 50, angle = 50,
length = 70 * cos(toRadians(45)) length = 70 * cos(toRadians(45))
}, %) }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -65,7 +65,7 @@ async function doBasicSketch(
if (openPanes.includes('code')) { if (openPanes.includes('code')) {
await expect(u.codeLocator) await expect(u.codeLocator)
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001) .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|> xLine(${commonPoints.num1}, %)`) |> xLine(length = ${commonPoints.num1})`)
} }
await page.waitForTimeout(500) await page.waitForTimeout(500)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
@ -74,8 +74,8 @@ async function doBasicSketch(
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(${commonPoints.num1}, %) |> xLine(length = ${commonPoints.num1})
|> yLine(${commonPoints.num1 + 0.01}, %)`) |> yLine(length = ${commonPoints.num1 + 0.01})`)
} else { } else {
await page.waitForTimeout(500) await page.waitForTimeout(500)
} }
@ -86,9 +86,9 @@ async function doBasicSketch(
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(${commonPoints.num1}, %) |> xLine(length = ${commonPoints.num1})
|> yLine(${commonPoints.num1 + 0.01}, %) |> yLine(length = ${commonPoints.num1 + 0.01})
|> xLine(${commonPoints.num2 * -1}, %)`) |> xLine(length = ${commonPoints.num2 * -1})`)
} }
// deselect line tool // deselect line tool
@ -146,9 +146,9 @@ async function doBasicSketch(
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(${commonPoints.num1}, %, $seg01) |> xLine(length = ${commonPoints.num1}, tag = $seg01)
|> yLine(${commonPoints.num1 + 0.01}, %) |> yLine(length = ${commonPoints.num1 + 0.01})
|> xLine(-segLen(seg01), %)`) |> xLine(length = -segLen(seg01))`)
} }
test.describe('Basic sketch', { tag: ['@skipWin'] }, () => { test.describe('Basic sketch', { tag: ['@skipWin'] }, () => {

View File

@ -16,7 +16,7 @@ test.describe('Command bar tests', { tag: ['@skipWin'] }, () => {
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> xLine(-20, %) |> xLine(length = -20)
|> close() |> close()
` `
) )

View File

@ -817,7 +817,7 @@ test.describe('Editor tests', { tag: ['@skipWin'] }, () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ') .toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt([3.14, 12], %) |> startProfileAt([3.14, 12], %)
|> xLine(5, %) // lin`) |> xLine(length = 5) // lin`)
// expect there to be no KCL errors // expect there to be no KCL errors
await expect(page.locator('.cm-lint-marker-error')).toHaveCount(0) await expect(page.locator('.cm-lint-marker-error')).toHaveCount(0)
@ -890,7 +890,7 @@ test.describe('Editor tests', { tag: ['@skipWin'] }, () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ') .toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt([3.14, 12], %) |> startProfileAt([3.14, 12], %)
|> xLine(5, %) // lin`) |> xLine(length = 5) // lin`)
}) })
}) })
test('Can undo a click and point extrude with ctrl+z', async ({ test('Can undo a click and point extrude with ctrl+z', async ({

View File

@ -8,7 +8,7 @@ const FEATURE_TREE_EXAMPLE_CODE = `export fn timesFive(x) {
export fn triangle() { export fn triangle() {
return startSketchOn('XZ') return startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(10, %) |> xLine(length = 10)
|> line(end = [-10, -5]) |> line(end = [-10, -5])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -28,7 +28,7 @@ plane001 = offsetPlane('XY', offset = 10)
sketch002 = startSketchOn(plane001) sketch002 = startSketchOn(plane001)
|> startProfileAt([-20, 0], %) |> startProfileAt([-20, 0], %)
|> line(end = [5, -15]) |> line(end = [5, -15])
|> xLine(-10, %) |> xLine(length = -10)
|> line(endAbsolute = [-40, 0]) |> line(endAbsolute = [-40, 0])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()

View File

@ -101,8 +101,7 @@ export class AuthenticatedTronApp {
// running against electron applications. // running against electron applications.
// The timeline is still broken but failure screenshots work again. // The timeline is still broken but failure screenshots work again.
this.context = context this.context = context
// TODO: try to get this to work again for screenshots, but it messed with test ends when enabled Object.assign(this.browserContext, this.context)
// Object.assign(this.browserContext, this.context)
this.electronApp = electronApp this.electronApp = electronApp
this.dir = dir this.dir = dir

View File

@ -524,7 +524,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
const expectedCodeSnippets = { const expectedCodeSnippets = {
sketchOnXzPlane: `sketch001 = startSketchOn('XZ')`, sketchOnXzPlane: `sketch001 = startSketchOn('XZ')`,
pointAtOrigin: `startProfileAt([${originSloppy.kcl[0]}, ${originSloppy.kcl[1]}], sketch001)`, pointAtOrigin: `startProfileAt([${originSloppy.kcl[0]}, ${originSloppy.kcl[1]}], sketch001)`,
segmentOnXAxis: `xLine(${xAxisSloppy.kcl[0]}, %)`, segmentOnXAxis: `xLine(length = ${xAxisSloppy.kcl[0]})`,
afterSegmentDraggedOffYAxis: `startProfileAt([${offYAxis.kcl[0]}, ${offYAxis.kcl[1]}], sketch001)`, afterSegmentDraggedOffYAxis: `startProfileAt([${offYAxis.kcl[0]}, ${offYAxis.kcl[1]}], sketch001)`,
afterSegmentDraggedOnYAxis: `startProfileAt([${yAxisSloppy.kcl[0]}, ${yAxisSloppy.kcl[1]}], sketch001)`, afterSegmentDraggedOnYAxis: `startProfileAt([${yAxisSloppy.kcl[0]}, ${yAxisSloppy.kcl[1]}], sketch001)`,
} }
@ -585,7 +585,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002)
openSketch = startSketchOn('XY') openSketch = startSketchOn('XY')
|> startProfileAt([-5, 0], %) |> startProfileAt([-5, 0], %)
|> line(endAbsolute = [0, 5]) |> line(endAbsolute = [0, 5])
|> xLine(5, %) |> xLine(length = 5)
|> tangentialArcTo([10, 0], %) |> tangentialArcTo([10, 0], %)
` `
const viewPortSize = { width: 1000, height: 500 } const viewPortSize = { width: 1000, height: 500 }
@ -1350,7 +1350,7 @@ loft001 = loft([sketch001, sketch002])
}, %) }, %)
sketch002 = startSketchOn('XZ') sketch002 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(-500, %) |> xLine(length = -500)
|> tangentialArcTo([-2000, 500], %) |> tangentialArcTo([-2000, 500], %)
` `
await context.addInitScript((initialCode) => { await context.addInitScript((initialCode) => {
@ -1444,7 +1444,7 @@ sketch002 = startSketchOn('XZ')
}, %) }, %)
sketch002 = startSketchOn('XZ') sketch002 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(-500, %) |> xLine(length = -500)
|> line(endAbsolute = [-2000, 500]) |> line(endAbsolute = [-2000, 500])
` `
await context.addInitScript((initialCode) => { await context.addInitScript((initialCode) => {
@ -2365,9 +2365,9 @@ chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)])
}) => { }) => {
const initialCode = `sketch001 = startSketchOn('XY') const initialCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-20, 20], %) |> startProfileAt([-20, 20], %)
|> xLine(40, %) |> xLine(length = 40)
|> yLine(-60, %) |> yLine(length = -60)
|> xLine(-40, %) |> xLine(length = -40)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(sketch001, length = 40) extrude001 = extrude(sketch001, length = 40)
@ -2383,7 +2383,7 @@ extrude001 = extrude(sketch001, length = 40)
const testPoint = { x: 580, y: 180 } const testPoint = { x: 580, y: 180 }
const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y) const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y)
const [clickOnWall] = scene.makeMouseHelpers(testPoint.x, testPoint.y + 70) const [clickOnWall] = scene.makeMouseHelpers(testPoint.x, testPoint.y + 70)
const mutatedCode = 'xLine(-40, %, $seg01)' const mutatedCode = 'xLine(length = -40, tag = $seg01)'
const shellDeclaration = const shellDeclaration =
"shell001 = shell(extrude001, faces = ['end', seg01], thickness = 5)" "shell001 = shell(extrude001, faces = ['end', seg01], thickness = 5)"
@ -2549,9 +2549,9 @@ extrude002 = extrude(sketch002, length = 50)
}) => { }) => {
const sketchCode = `sketch001 = startSketchOn('XY') const sketchCode = `sketch001 = startSketchOn('XY')
profile001 = startProfileAt([-20, 20], sketch001) profile001 = startProfileAt([-20, 20], sketch001)
|> xLine(40, %) |> xLine(length = 40)
|> yLine(-60, %) |> yLine(length = -60)
|> xLine(-40, %) |> xLine(length = -40)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
` `
@ -2637,7 +2637,7 @@ profile001 = startProfileAt([-20, 20], sketch001)
}, %) }, %)
sketch002 = startSketchOn('XZ') sketch002 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(-2000, %) |> xLine(length = -2000)
sweep001 = sweep(sketch001, path = sketch002) sweep001 = sweep(sketch001, path = sketch002)
` `
await context.addInitScript((initialCode) => { await context.addInitScript((initialCode) => {
@ -2798,7 +2798,7 @@ radius = 8.69
const initialCode = ` const initialCode = `
sketch002 = startSketchOn('XY') sketch002 = startSketchOn('XY')
|> startProfileAt([-2.02, 1.79], %) |> startProfileAt([-2.02, 1.79], %)
|> xLine(2.6, %) |> xLine(length = 2.6)
sketch001 = startSketchOn('-XY') sketch001 = startSketchOn('-XY')
|> startProfileAt([-0.48, 1.25], %) |> startProfileAt([-0.48, 1.25], %)
|> angledLine([0, 2.38], %, $rectangleSegmentA001) |> angledLine([0, 2.38], %, $rectangleSegmentA001)
@ -2830,7 +2830,7 @@ radius = 8.69
await page.getByText(codeToSelecton).click() await page.getByText(codeToSelecton).click()
await toolbar.revolveButton.click() await toolbar.revolveButton.click()
await page.getByText('Edge', { exact: true }).click() await page.getByText('Edge', { exact: true }).click()
const lineCodeToSelection = `|> xLine(2.6, %)` const lineCodeToSelection = `|> xLine(length = 2.6)`
await page.getByText(lineCodeToSelection).click() await page.getByText(lineCodeToSelection).click()
await cmdBar.progressCmdBar() await cmdBar.progressCmdBar()

View File

@ -13,9 +13,9 @@ profile001 = startProfileAt([57.81, 250.51], sketch001)
extrude001 = extrude(profile001, length = 200) extrude001 = extrude(profile001, length = 200)
sketch002 = startSketchOn('XZ') sketch002 = startSketchOn('XZ')
|> startProfileAt([-73.64, -42.89], %) |> startProfileAt([-73.64, -42.89], %)
|> xLine(173.71, %) |> xLine(length = 173.71)
|> line(end = [-22.12, -94.4]) |> line(end = [-22.12, -94.4])
|> xLine(-156.98, %) |> xLine(length = -156.98)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude002 = extrude(sketch002, length = 50) extrude002 = extrude(sketch002, length = 50)

View File

@ -248,7 +248,7 @@ extrude001 = extrude(sketch001, length = 50)
`exampleSketch = startSketchOn("XZ") `exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle: 50, length: 45 }, %) |> angledLine({ angle: 50, length: 45 }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
|> |>
@ -304,7 +304,7 @@ extrude001 = extrude(sketch001, length = 50)
.toContainText(`exampleSketch = startSketchOn("XZ") .toContainText(`exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle: 50, length: 45 }, %) |> angledLine({ angle: 50, length: 45 }, %)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
thing: "blah"`) thing: "blah"`)

View File

@ -48,26 +48,26 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => {
part001 = startSketchOn('XY') part001 = startSketchOn('XY')
${startProfileAt2} ${startProfileAt2}
|> xLine(width * .5, %) |> xLine(length = width * .5)
|> yLine(height, %) |> yLine(length = height)
|> xLine(-width * .5, %) |> xLine(length = -width * .5)
|> close() |> close()
|> hole(screwHole, %) |> hole(screwHole, %)
|> extrude(length = thickness) |> extrude(length = thickness)
part002 = startSketchOn('-XZ') part002 = startSketchOn('-XZ')
${startProfileAt3} ${startProfileAt3}
|> xLine(width / 4, %) |> xLine(length = width / 4)
|> tangentialArcTo([width / 2, 0], %) |> tangentialArcTo([width / 2, 0], %)
|> xLine(-width / 4 + wireRadius, %) |> xLine(length = -width / 4 + wireRadius)
|> yLine(wireOffset, %) |> yLine(length = wireOffset)
|> arc({ |> arc({
radius = wireRadius, radius = wireRadius,
angleStart = 0, angleStart = 0,
angleEnd = 180 angleEnd = 180
}, %) }, %)
|> yLine(-wireOffset, %) |> yLine(length = -wireOffset)
|> xLine(-width / 4, %) |> xLine(length = -width / 4)
|> close() |> close()
|> extrude(length = -height) |> extrude(length = -height)
` `
@ -111,7 +111,7 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => {
'persistCode', 'persistCode',
`sketch001 = startSketchOn('XZ') `sketch001 = startSketchOn('XZ')
|> startProfileAt([2.61, -4.01], %) |> startProfileAt([2.61, -4.01], %)
|> xLine(8.73, %) |> xLine(length = 8.73)
|> tangentialArcTo([8.33, -1.31], %)` |> tangentialArcTo([8.33, -1.31], %)`
) )
}) })
@ -157,7 +157,7 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => {
await expect.poll(u.normalisedEditorCode, { timeout: 1000 }) await expect.poll(u.normalisedEditorCode, { timeout: 1000 })
.toBe(`sketch002 = startSketchOn('XZ') .toBe(`sketch002 = startSketchOn('XZ')
sketch001 = startProfileAt([12.34, -12.34], sketch002) sketch001 = startProfileAt([12.34, -12.34], sketch002)
|> yLine(12.34, %) |> yLine(length = 12.34)
`) `)
}).toPass({ timeout: 5_000, intervals: [1_000] }) }).toPass({ timeout: 5_000, intervals: [1_000] })
@ -693,15 +693,15 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
await click00r(50, 0) await click00r(50, 0)
await page.waitForTimeout(100) await page.waitForTimeout(100)
codeStr += ` |> xLine(${toU(50, 0)[0]}, %)` codeStr += ` |> xLine(length = ${toU(50, 0)[0]})`
await expect(u.codeLocator).toHaveText(codeStr) await expect(u.codeLocator).toHaveText(codeStr)
await click00r(0, 50) await click00r(0, 50)
codeStr += ` |> yLine(${toU(0, 50)[1]}, %)` codeStr += ` |> yLine(length = ${toU(0, 50)[1]})`
await expect(u.codeLocator).toHaveText(codeStr) await expect(u.codeLocator).toHaveText(codeStr)
await click00r(-50, 0) await click00r(-50, 0)
codeStr += ` |> xLine(${toU(-50, 0)[0]}, %)` codeStr += ` |> xLine(length = ${toU(-50, 0)[0]})`
await expect(u.codeLocator).toHaveText(codeStr) await expect(u.codeLocator).toHaveText(codeStr)
// exit the sketch, reset relative clicker // exit the sketch, reset relative clicker
@ -730,15 +730,15 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
// TODO: I couldn't use `toSU` here because of some rounding error causing // TODO: I couldn't use `toSU` here because of some rounding error causing
// it to be off by 0.01 // it to be off by 0.01
await click00r(30, 0) await click00r(30, 0)
codeStr += ` |> xLine(2.04, %)` codeStr += ` |> xLine(length = 2.04)`
await expect(u.codeLocator).toHaveText(codeStr) await expect(u.codeLocator).toHaveText(codeStr)
await click00r(0, 30) await click00r(0, 30)
codeStr += ` |> yLine(-2.03, %)` codeStr += ` |> yLine(length = -2.03)`
await expect(u.codeLocator).toHaveText(codeStr) await expect(u.codeLocator).toHaveText(codeStr)
await click00r(-30, 0) await click00r(-30, 0)
codeStr += ` |> xLine(-2.04, %)` codeStr += ` |> xLine(length = -2.04)`
await expect(u.codeLocator).toHaveText(codeStr) await expect(u.codeLocator).toHaveText(codeStr)
await click00r(undefined, undefined) await click00r(undefined, undefined)
@ -763,8 +763,8 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002)
profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff( profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff(
scale * 34.8 scale * 34.8
)}], sketch001) )}], sketch001)
|> xLine(${roundOff(scale * 139.19)}, %) |> xLine(length = ${roundOff(scale * 139.19)})
|> yLine(-${roundOff(scale * 139.2)}, %) |> yLine(length = -${roundOff(scale * 139.2)})
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()` |> close()`
@ -1020,7 +1020,7 @@ profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff(
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> xLine(-20, %) |> xLine(length = -20)
`) `)
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
@ -1096,8 +1096,8 @@ profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff(
lugSketch = startSketchOn(plane) lugSketch = startSketchOn(plane)
|> startProfileAt([origin[0] + lugDiameter / 2, origin[1]], %) |> startProfileAt([origin[0] + lugDiameter / 2, origin[1]], %)
|> angledLineOfYLength({ angle = 60, length = lugHeadLength }, %) |> angledLineOfYLength({ angle = 60, length = lugHeadLength }, %)
|> xLineTo(0 + .001, %) |> xLine(endAbsolute = 0 + .001)
|> yLineTo(0, %) |> yLine(endAbsolute = 0)
|> close() |> close()
|> revolve({ axis = "Y" }, %) |> revolve({ axis = "Y" }, %)
@ -1370,7 +1370,7 @@ profile001 = startProfileAt([121.52, 168.25], sketch001)
|> close() |> close()
profile002 = startProfileAt([117.2, 56.08], sketch001) profile002 = startProfileAt([117.2, 56.08], sketch001)
|> line(end = [166.82, 25.89]) |> line(end = [166.82, 25.89])
|> yLine(-107.86, %) |> yLine(length = -107.86)
` `
) )
@ -1456,9 +1456,9 @@ profile002 = startProfileAt([117.2, 56.08], sketch001)
'persistCode', 'persistCode',
`sketch001 = startSketchOn('XZ') `sketch001 = startSketchOn('XZ')
profile002 = startProfileAt([40.68, 87.67], sketch001) profile002 = startProfileAt([40.68, 87.67], sketch001)
|> xLine(239.17, %) |> xLine(length = 239.17)
profile003 = startProfileAt([206.63, -56.73], sketch001) profile003 = startProfileAt([206.63, -56.73], sketch001)
|> xLine(-156.32, %) |> xLine(length = -156.32)
` `
) )
}) })
@ -2316,7 +2316,7 @@ profile003 = startProfileAt([3.19, 13.3], sketch002)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
profile004 = startProfileAt([3.15, 9.39], sketch002) profile004 = startProfileAt([3.15, 9.39], sketch002)
|> xLine(6.92, %) |> xLine(length = 6.92)
|> line(end = [-7.41, -2.85]) |> line(end = [-7.41, -2.85])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -2552,7 +2552,7 @@ profile001 = startProfileAt([34, 42.66], sketch001)
plane001 = offsetPlane('XZ', offset = 50) plane001 = offsetPlane('XZ', offset = 50)
sketch002 = startSketchOn(plane001) sketch002 = startSketchOn(plane001)
profile002 = startProfileAt([39.43, 172.21], sketch002) profile002 = startProfileAt([39.43, 172.21], sketch002)
|> xLine(183.99, %) |> xLine(length = 183.99)
|> line(end = [-77.95, -145.93]) |> line(end = [-77.95, -145.93])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -2605,7 +2605,7 @@ profile001 = startProfileAt([34, 42.66], sketch001)
plane001 = offsetPlane('XZ', offset = 50) plane001 = offsetPlane('XZ', offset = 50)
sketch002 = startSketchOn(plane001) sketch002 = startSketchOn(plane001)
profile002 = startProfileAt([39.43, 172.21], sketch002) profile002 = startProfileAt([39.43, 172.21], sketch002)
|> xLine(183.99, %) |> xLine(length = 183.99)
|> line(end = [-77.95, -145.93]) |> line(end = [-77.95, -145.93])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()

View File

@ -71,14 +71,14 @@ armThick = 0.5
totalLen = 9.5 totalLen = 9.5
part001 = startSketchOn('-XZ') part001 = startSketchOn('-XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLine(baseHeight, %) |> yLine(length = baseHeight)
|> xLine(baseLen, %) |> xLine(length = baseLen)
|> angledLineToY({ |> angledLineToY({
angle = topAng, angle = topAng,
to = totalHeightHalf, to = totalHeightHalf,
}, %, $seg04) }, %, $seg04)
|> xLineTo(totalLen, %, $seg03) |> xLine(endAbsolute = totalLen, tag = $seg03)
|> yLine(-armThick, %, $seg01) |> yLine(length = -armThick, tag = $seg01)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle = HALF_TURN, angle = HALF_TURN,
offset = -armThick, offset = -armThick,
@ -89,15 +89,15 @@ part001 = startSketchOn('-XZ')
angle = -bottomAng, angle = -bottomAng,
to = -totalHeightHalf - armThick, to = -totalHeightHalf - armThick,
}, %, $seg02) }, %, $seg02)
|> xLineTo(segEndX(seg03, %) + 0, %) |> xLine(length = endAbsolute = segEndX(seg03) + 0)
|> yLine(-segLen(seg01, %), %) |> yLine(length = -segLen(seg01, %))
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle = HALF_TURN, angle = HALF_TURN,
offset = -armThick, offset = -armThick,
intersectTag = seg02 intersectTag = seg02
}, %) }, %)
|> angledLineToY([segAng(seg02, %) + 180, -baseHeight], %) |> angledLineToY([segAng(seg02, %) + 180, -baseHeight], %)
|> xLineTo(ZERO, %) |> xLine(endAbsolute = ZERO)
|> close() |> close()
|> extrude(length = 4)` |> extrude(length = 4)`
) )
@ -461,7 +461,7 @@ test(
await page.waitForTimeout(100) await page.waitForTimeout(100)
code += ` code += `
|> xLine(7.25, %)` |> xLine(length = 7.25)`
await expect(page.locator('.cm-content')).toHaveText(code) await expect(page.locator('.cm-content')).toHaveText(code)
await page await page
@ -653,7 +653,7 @@ test.describe(
await page.waitForTimeout(100) await page.waitForTimeout(100)
code += ` code += `
|> xLine(7.25, %)` |> xLine(length = 7.25)`
await expect(u.codeLocator).toHaveText(code) await expect(u.codeLocator).toHaveText(code)
await page await page
@ -761,7 +761,7 @@ test.describe(
await page.waitForTimeout(100) await page.waitForTimeout(100)
code += ` code += `
|> xLine(184.3, %)` |> xLine(length = 184.3)`
await expect(u.codeLocator).toHaveText(code) await expect(u.codeLocator).toHaveText(code)
await page await page

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

@ -79,9 +79,9 @@ export const TEST_CODE_GIZMO = `part001 = startSketchOn('XZ')
|> line(end = [7.13, 4 + 0]) |> line(end = [7.13, 4 + 0])
|> angledLine({ angle: 3 + 0, length: 3.14 + 0 }, %) |> angledLine({ angle: 3 + 0, length: 3.14 + 0 }, %)
|> line(endAbsolute = [20.14 + 0, -0.14 + 0]) |> line(endAbsolute = [20.14 + 0, -0.14 + 0])
|> xLineTo(29 + 0, %) |> xLine(endAbsolute = 29 + 0)
|> yLine(-3.14 + 0, %, $a) |> yLine(length = -3.14 + 0, tag = $a)
|> xLine(1.63, %) |> xLine(length = 1.63)
|> angledLineOfXLength({ angle: 3 + 0, length: 3.14 }, %) |> angledLineOfXLength({ angle: 3 + 0, length: 3.14 }, %)
|> angledLineOfYLength({ angle: 30, length: 3 + 0 }, %) |> angledLineOfYLength({ angle: 30, length: 3 + 0 }, %)
|> angledLineToX({ angle: 22.14 + 0, to: 12 }, %) |> angledLineToX({ angle: 22.14 + 0, to: 12 }, %)
@ -146,7 +146,7 @@ sketch001 = startSketchOn(box, revolveAxis)
sketch001 = startSketchOn('XZ') sketch001 = startSketchOn('XZ')
|> startProfileAt([0.0, 0.0], %) |> startProfileAt([0.0, 0.0], %)
|> xLine(0.0, %) |> xLine(length = 0.0)
|> close() |> close()
` `

View File

@ -122,7 +122,7 @@ test.describe('Test network and connection issues', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001) .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|> xLine(${commonPoints.num1}, %)`) |> xLine(length = ${commonPoints.num1})`)
// Expect the network to be up // Expect the network to be up
await expect(networkToggle).toContainText('Connected') await expect(networkToggle).toContainText('Connected')
@ -215,7 +215,7 @@ test.describe('Test network and connection issues', () => {
await expect.poll(u.normalisedEditorCode) await expect.poll(u.normalisedEditorCode)
.toBe(`sketch001 = startSketchOn('XZ') .toBe(`sketch001 = startSketchOn('XZ')
profile001 = startProfileAt([12.34, -12.34], sketch001) profile001 = startProfileAt([12.34, -12.34], sketch001)
|> xLine(12.34, %) |> xLine(length = 12.34)
|> line(end = [-12.34, 12.34]) |> line(end = [-12.34, 12.34])
`) `)
@ -225,9 +225,9 @@ profile001 = startProfileAt([12.34, -12.34], sketch001)
await expect.poll(u.normalisedEditorCode) await expect.poll(u.normalisedEditorCode)
.toBe(`sketch001 = startSketchOn('XZ') .toBe(`sketch001 = startSketchOn('XZ')
profile001 = startProfileAt([12.34, -12.34], sketch001) profile001 = startProfileAt([12.34, -12.34], sketch001)
|> xLine(12.34, %) |> xLine(length = 12.34)
|> line(end = [-12.34, 12.34]) |> line(end = [-12.34, 12.34])
|> xLine(-12.34, %) |> xLine(length = -12.34)
`) `)

View File

@ -18,7 +18,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> xLine(-20, %) |> xLine(length = -20)
` `
) )
}) })
@ -57,7 +57,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
.click() .click()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`length001 = 20sketch001 = startSketchOn('XY') |> startProfileAt([-10, -10], %) |> line(end = [20, 0]) |> angledLine([90, length001], %) |> xLine(-20, %)` `length001 = 20sketch001 = startSketchOn('XY') |> startProfileAt([-10, -10], %) |> line(end = [20, 0]) |> angledLine([90, length001], %) |> xLine(length = -20)`
) )
// Make sure we didn't pop out of sketch mode. // Make sure we didn't pop out of sketch mode.
@ -89,9 +89,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
|> line(end = [41.19, 58.97 + 5]) |> line(end = [41.19, 58.97 + 5])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 120], %) |> startProfileAt([299.05, 120], %)
|> xLine(-385.34, %, $seg_what) |> xLine(length = -385.34, tag = $seg_what)
|> yLine(-170.06, %) |> yLine(length = -170.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
}) })
@ -153,9 +153,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
|> line(end = [51.19, 48.97]) |> line(end = [51.19, 48.97])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(length = -425.34, tag = $seg_what)
|> yLine(-264.06, %) |> yLine(length = -264.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
@ -285,9 +285,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
|> line(end = [51.19, 48.97]) |> line(end = [51.19, 48.97])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(length = -425.34, tag = $seg_what)
|> yLine(-264.06, %) |> yLine(length = -264.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
}) })
@ -395,9 +395,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
|> line(end = [51.19, 48.97]) |> line(end = [51.19, 48.97])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(length = -425.34, tag = $seg_what)
|> yLine(-264.06, %) |> yLine(length = -264.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
}) })
@ -508,9 +508,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
|> line(end = [51.19, 48.97]) |> line(end = [51.19, 48.97])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(length = -425.34, tag = $seg_what)
|> yLine(-264.06, %) |> yLine(length = -264.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
}) })
@ -610,9 +610,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => {
|> line(end = [51.19, 48.97]) |> line(end = [51.19, 48.97])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(length = -425.34, tag = $seg_what)
|> yLine(-264.06, %) |> yLine(length = -264.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
}) })
@ -696,9 +696,9 @@ part001 = startSketchOn('XZ')
|> line(end = [51.19, 48.97]) |> line(end = [51.19, 48.97])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(length = -425.34, tag = $seg_what)
|> yLine(-264.06, %) |> yLine(length = -264.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
}) })
@ -748,16 +748,16 @@ part002 = startSketchOn('XZ')
{ {
constraintName: 'Vertical', constraintName: 'Vertical',
codeAfter: [ codeAfter: [
`|> yLine(130.4, %)`, `|> yLine(length = 130.4)`,
`|> yLine(77.79, %)`, `|> yLine(length = 77.79)`,
`|> yLine(48.97, %)`, `|> yLine(length = 48.97)`,
], ],
}, },
{ {
codeAfter: [ codeAfter: [
`|> xLine(74.36, %)`, `|> xLine(length = 74.36)`,
`|> xLine(9.16, %)`, `|> xLine(length = 9.16)`,
`|> xLine(51.19, %)`, `|> xLine(length = 51.19)`,
], ],
constraintName: 'Horizontal', constraintName: 'Horizontal',
}, },
@ -776,9 +776,9 @@ part002 = startSketchOn('XZ')
|> line(end = [51.19, 48.97]) |> line(end = [51.19, 48.97])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(length = -425.34, tag = $seg_what)
|> yLine(-264.06, %) |> yLine(length = -264.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
}) })
@ -876,9 +876,9 @@ part002 = startSketchOn('XZ')
|> line(end = [9.16, 77.79]) |> line(end = [9.16, 77.79])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(length = -425.34, tag = $seg_what)
|> yLine(-264.06, %) |> yLine(length = -264.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
}) })
@ -957,9 +957,9 @@ part002 = startSketchOn('XZ')
|> line(end = [9.16, 77.79]) |> line(end = [9.16, 77.79])
part002 = startSketchOn('XZ') part002 = startSketchOn('XZ')
|> startProfileAt([299.05, 231.45], %) |> startProfileAt([299.05, 231.45], %)
|> xLine(-425.34, %, $seg_what) |> xLine(length = -425.34, tag = $seg_what)
|> yLine(-264.06, %) |> yLine(length = -264.06)
|> xLine(segLen(seg_what), %) |> xLine(length = segLen(seg_what))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])` |> line(endAbsolute = [profileStartX(%), profileStartY(%)])`
) )
}) })
@ -1061,7 +1061,7 @@ part002 = startSketchOn('XZ')
await pollEditorLinesSelectedLength(page, 1) await pollEditorLinesSelectedLength(page, 1)
let activeLinesContent = await page.locator('.cm-activeLine').all() let activeLinesContent = await page.locator('.cm-activeLine').all()
await expect(activeLinesContent[0]).toHaveText(`|> xLine(3.13, %)`) await expect(activeLinesContent[0]).toHaveText(`|> xLine(length = 3.13)`)
// Wait for code editor to settle. // Wait for code editor to settle.
await page.waitForTimeout(2000) await page.waitForTimeout(2000)
@ -1105,7 +1105,9 @@ part002 = startSketchOn('XZ')
await pollEditorLinesSelectedLength(page, 1) await pollEditorLinesSelectedLength(page, 1)
activeLinesContent = await page.locator('.cm-activeLine').all() activeLinesContent = await page.locator('.cm-activeLine').all()
await expect(activeLinesContent[0]).toHaveText(`|> xLine(length001, %)`) await expect(activeLinesContent[0]).toHaveText(
`|> xLine(length = length001)`
)
// checking the count of the overlays is a good proxy check that the client sketch scene is in a good state // checking the count of the overlays is a good proxy check that the client sketch scene is in a good state
await expect(page.getByTestId('segment-overlay')).toHaveCount(2) await expect(page.getByTestId('segment-overlay')).toHaveCount(2)

View File

@ -212,10 +212,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|> line(end = [0.5, -14 + 0]) |> line(end = [0.5, -14 + 0])
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|> line(endAbsolute = [5 + 33, 20 + 11.5 + 0]) |> line(endAbsolute = [5 + 33, 20 + 11.5 + 0])
|> xLineTo(5 + 9 - 5, %) |> xLine(endAbsolute = 5 + 9 - 5)
|> yLineTo(20 + -10.77, %, $a) |> yLine(endAbsolute = 20 + -10.77, tag = $a)
|> xLine(26.04, %) |> xLine(length = 26.04)
|> yLine(21.14 + 0, %) |> yLine(length = 21.14 + 0)
|> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %)
|> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %)
|> angledLineToX({ angle = 3 + 0, to = 5 + 26 }, %) |> angledLineToX({ angle = 3 + 0, to = 5 + 26 }, %)
@ -239,7 +239,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()
await page.getByText('xLineTo(5 + 9 - 5, %)').click() await page.getByText('xLine(endAbsolute = 5 + 9 - 5)').click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
await page.waitForTimeout(500) await page.waitForTimeout(500)
@ -358,9 +358,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await clickConstrained({ await clickConstrained({
hoverPos: { x: xLineTo.x, y: xLineTo.y }, hoverPos: { x: xLineTo.x, y: xLineTo.y },
constraintType: 'xAbsolute', constraintType: 'xAbsolute',
expectBeforeUnconstrained: 'xLineTo(5 + 9 - 5, %)', expectBeforeUnconstrained: 'xLine(endAbsolute = 5 + 9 - 5)',
expectAfterUnconstrained: 'xLineTo(9, %)', expectAfterUnconstrained: 'xLine(endAbsolute = 9)',
expectFinal: 'xLineTo(xAbs002, %)', expectFinal: 'xLine(endAbsolute = xAbs002)',
ang: ang + 180, ang: ang + 180,
steps: 8, steps: 8,
locator: '[data-overlay-toolbar-index="3"]', locator: '[data-overlay-toolbar-index="3"]',
@ -386,10 +386,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|> line(end = [0.5, yRel001]) |> line(end = [0.5, yRel001])
|> angledLine({ angle = angle001, length = len001 }, %) |> angledLine({ angle = angle001, length = len001 }, %)
|> line(endAbsolute = [33, yAbs001]) |> line(endAbsolute = [33, yAbs001])
|> xLineTo(xAbs002, %) |> xLine(endAbsolute = xAbs002)
|> yLineTo(-10.77, %, $a) |> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(26.04, %) |> xLine(length = 26.04)
|> yLine(21.14 + 0, %) |> yLine(length = 21.14 + 0)
|> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %)
` `
) )
@ -404,7 +404,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()
await page.getByText('xLine(26.04, %)').click() await page.getByText('xLine(length = 26.04)').click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
await page.waitForTimeout(500) await page.waitForTimeout(500)
@ -424,9 +424,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await clickUnconstrained({ await clickUnconstrained({
hoverPos: { x: yLineTo.x, y: yLineTo.y - 200 }, hoverPos: { x: yLineTo.x, y: yLineTo.y - 200 },
constraintType: 'yAbsolute', constraintType: 'yAbsolute',
expectBeforeUnconstrained: 'yLineTo(-10.77, %, $a)', expectBeforeUnconstrained: 'yLine(endAbsolute = -10.77, tag = $a)',
expectAfterUnconstrained: 'yLineTo(yAbs002, %, $a)', expectAfterUnconstrained: 'yLine(endAbsolute = yAbs002, tag = $a)',
expectFinal: 'yLineTo(-10.77, %, $a)', expectFinal: 'yLine(endAbsolute = -10.77, tag = $a)',
ang: ang + 180, ang: ang + 180,
locator: '[data-overlay-toolbar-index="4"]', locator: '[data-overlay-toolbar-index="4"]',
}) })
@ -437,9 +437,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await clickUnconstrained({ await clickUnconstrained({
hoverPos: { x: xLine.x, y: xLine.y }, hoverPos: { x: xLine.x, y: xLine.y },
constraintType: 'xRelative', constraintType: 'xRelative',
expectBeforeUnconstrained: 'xLine(26.04, %)', expectBeforeUnconstrained: 'xLine(length = 26.04)',
expectAfterUnconstrained: 'xLine(xRel002, %)', expectAfterUnconstrained: 'xLine(length = xRel002)',
expectFinal: 'xLine(26.04, %)', expectFinal: 'xLine(length = 26.04)',
steps: 10, steps: 10,
ang: ang + 180, ang: ang + 180,
locator: '[data-overlay-toolbar-index="5"]', locator: '[data-overlay-toolbar-index="5"]',
@ -459,10 +459,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|> line(end = [0.5, -14 + 0]) |> line(end = [0.5, -14 + 0])
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|> line(endAbsolute = [33, 11.5 + 0]) |> line(endAbsolute = [33, 11.5 + 0])
|> xLineTo(9 - 5, %) |> xLine(endAbsolute = 9 - 5)
|> yLineTo(-10.77, %, $a) |> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(26.04, %) |> xLine(length = 26.04)
|> yLine(21.14 + 0, %) |> yLine(length = 21.14 + 0)
|> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %)
|> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %)
|> angledLineToX({ angle = 3 + 0, to = 26 }, %) |> angledLineToX({ angle = 3 + 0, to = 26 }, %)
@ -488,7 +488,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await u.closeDebugPanel() await u.closeDebugPanel()
await page.waitForTimeout(500) await page.waitForTimeout(500)
await page.getByText('xLineTo(9 - 5, %)').click() await page.getByText('xLine(endAbsolute = 9 - 5)').click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
await page.waitForTimeout(500) await page.waitForTimeout(500)
@ -506,9 +506,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await clickConstrained({ await clickConstrained({
hoverPos: { x: yLine.x, y: yLine.y }, hoverPos: { x: yLine.x, y: yLine.y },
constraintType: 'yRelative', constraintType: 'yRelative',
expectBeforeUnconstrained: 'yLine(21.14 + 0, %)', expectBeforeUnconstrained: 'yLine(length = 21.14 + 0)',
expectAfterUnconstrained: 'yLine(21.14, %)', expectAfterUnconstrained: 'yLine(length = 21.14)',
expectFinal: 'yLine(yRel001, %)', expectFinal: 'yLine(length = yRel001)',
ang: ang + 180, ang: ang + 180,
locator: '[data-overlay-toolbar-index="6"]', locator: '[data-overlay-toolbar-index="6"]',
}) })
@ -591,10 +591,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|> line(end = [0.5, -14 + 0]) |> line(end = [0.5, -14 + 0])
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|> line(endAbsolute = [33, 11.5 + 0]) |> line(endAbsolute = [33, 11.5 + 0])
|> xLineTo(9 - 5, %) |> xLine(endAbsolute = 9 - 5)
|> yLineTo(-10.77, %, $a) |> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(26.04, %) |> xLine(length = 26.04)
|> yLine(21.14 + 0, %) |> yLine(length = 21.14 + 0)
|> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %)
|> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %)
|> angledLineToX({ angle = 3 + 0, to = 26 }, %) |> angledLineToX({ angle = 3 + 0, to = 26 }, %)
@ -619,7 +619,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()
await page.getByText('xLineTo(9 - 5, %)').click() await page.getByText('xLine(endAbsolute = 9 - 5)').click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
await page.waitForTimeout(500) await page.waitForTimeout(500)
@ -755,10 +755,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|> line(end = [0.5, -14 + 0]) |> line(end = [0.5, -14 + 0])
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|> line(endAbsolute = [33, 11.5 + 0]) |> line(endAbsolute = [33, 11.5 + 0])
|> xLineTo(9 - 5, %) |> xLine(endAbsolute = 9 - 5)
|> yLineTo(-10.77, %, $a) |> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(26.04, %) |> xLine(length = 26.04)
|> yLine(21.14 + 0, %) |> yLine(length = 21.14 + 0)
|> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %)
|> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %)
|> angledLineToX({ angle = 3 + 0, to = 26 }, %) |> angledLineToX({ angle = 3 + 0, to = 26 }, %)
@ -783,7 +783,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()
await page.getByText('xLineTo(9 - 5, %)').click() await page.getByText('xLine(endAbsolute = 9 - 5)').click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
await page.waitForTimeout(500) await page.waitForTimeout(500)
@ -947,10 +947,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
|> line(end = [0.5, -14 + 0]) |> line(end = [0.5, -14 + 0])
|> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %)
|> line(endAbsolute = [33, 11.5 + 0]) |> line(endAbsolute = [33, 11.5 + 0])
|> xLineTo(9 - 5, %) |> xLine(endAbsolute = 9 - 5)
|> yLineTo(-10.77, %, $a) |> yLine(endAbsolute = -10.77, tag = $a)
|> xLine(26.04, %) |> xLine(length = 26.04)
|> yLine(21.14 + 0, %) |> yLine(length = 21.14 + 0)
|> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %)
|> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %)
|> angledLineToX({ angle = 3 + 0, to = 26 }, %) |> angledLineToX({ angle = 3 + 0, to = 26 }, %)
@ -976,7 +976,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()
await page.getByText('xLineTo(9 - 5, %)').click() await page.getByText('xLine(endAbsolute = 9 - 5)').click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
await page.waitForTimeout(500) await page.waitForTimeout(500)
@ -1060,7 +1060,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
ang = await u.getAngle(`[data-overlay-index="${6}"]`) ang = await u.getAngle(`[data-overlay-index="${6}"]`)
await deleteSegmentSequence({ await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'yLine(21.14 + 0, %)', codeToBeDeleted: 'yLine(length = 21.14 + 0)',
stdLibFnName: 'yLine', stdLibFnName: 'yLine',
ang: ang + 180, ang: ang + 180,
locator: '[data-overlay-toolbar-index="6"]', locator: '[data-overlay-toolbar-index="6"]',
@ -1070,7 +1070,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
ang = await u.getAngle(`[data-overlay-index="${5}"]`) ang = await u.getAngle(`[data-overlay-index="${5}"]`)
await deleteSegmentSequence({ await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'xLine(26.04, %)', codeToBeDeleted: 'xLine(length = 26.04)',
stdLibFnName: 'xLine', stdLibFnName: 'xLine',
ang: ang + 180, ang: ang + 180,
locator: '[data-overlay-toolbar-index="5"]', locator: '[data-overlay-toolbar-index="5"]',
@ -1080,7 +1080,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
ang = await u.getAngle(`[data-overlay-index="${4}"]`) ang = await u.getAngle(`[data-overlay-index="${4}"]`)
await deleteSegmentSequence({ await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'yLineTo(-10.77, %, $a)', codeToBeDeleted: 'yLine(endAbsolute = -10.77, tag = $a)',
stdLibFnName: 'yLineTo', stdLibFnName: 'yLineTo',
ang: ang + 180, ang: ang + 180,
locator: '[data-overlay-toolbar-index="4"]', locator: '[data-overlay-toolbar-index="4"]',
@ -1090,7 +1090,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
ang = await u.getAngle(`[data-overlay-index="${3}"]`) ang = await u.getAngle(`[data-overlay-index="${3}"]`)
await deleteSegmentSequence({ await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'xLineTo(9 - 5, %)', codeToBeDeleted: 'xLine(endAbsolute = 9 - 5)',
stdLibFnName: 'xLineTo', stdLibFnName: 'xLineTo',
ang: ang + 180, ang: ang + 180,
locator: '[data-overlay-toolbar-index="3"]', locator: '[data-overlay-toolbar-index="3"]',
@ -1155,10 +1155,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
const cases = [ const cases = [
'line(end = [22, 2], tag = $seg01)', 'line(end = [22, 2], tag = $seg01)',
'angledLine([5, 23.03], %, $seg01)', 'angledLine([5, 23.03], %, $seg01)',
'xLine(23, %, $seg01)', 'xLine(length = 23, tag = $seg01)',
'yLine(-8, %, $seg01)', 'yLine(length = -8, tag = $seg01)',
'xLineTo(30, %, $seg01)', 'xLine(endAbsolute = 30, tag = $seg01)',
'yLineTo(-4, %, $seg01)', 'yLine(endAbsolute = -4, tag = $seg01)',
'angledLineOfXLength([3, 30], %, $seg01)', 'angledLineOfXLength([3, 30], %, $seg01)',
'angledLineOfXLength({ angle = 3, length = 30 }, %, $seg01)', 'angledLineOfXLength({ angle = 3, length = 30 }, %, $seg01)',
'angledLineOfYLength([3, 1.5], %, $seg01)', 'angledLineOfYLength([3, 1.5], %, $seg01)',
@ -1298,19 +1298,19 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => {
after: `line(end = [22.94, 2.01], tag = $seg01)`, after: `line(end = [22.94, 2.01], tag = $seg01)`,
}, },
{ {
before: `xLine(23 + 0, %, $seg01)`, before: `xLine(length = 23 + 0, tag = $seg01)`,
after: `line(end = [23, 0], tag = $seg01)`, after: `line(end = [23, 0], tag = $seg01)`,
}, },
{ {
before: `yLine(-8 + 0, %, $seg01)`, before: `yLine(length = -8 + 0, tag = $seg01)`,
after: `line(end = [0, -8], tag = $seg01)`, after: `line(end = [0, -8], tag = $seg01)`,
}, },
{ {
before: `xLineTo(30 + 0, %, $seg01)`, before: `xLine(endAbsolute = 30 + 0, tag = $seg01)`,
after: `line(end = [25, 0], tag = $seg01)`, after: `line(end = [25, 0], tag = $seg01)`,
}, },
{ {
before: `yLineTo(-4 + 0, %, $seg01)`, before: `yLine(endAbsolute = -4 + 0, tag = $seg01)`,
after: `line(end = [0, -10], tag = $seg01)`, after: `line(end = [0, -10], tag = $seg01)`,
}, },
{ {

View File

@ -75,7 +75,7 @@ test.describe('Testing selections', { tag: ['@skipWin'] }, () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001) .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001)
|> xLine(${commonPoints.num1}, %)`) |> xLine(length = ${commonPoints.num1})`)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20)
@ -83,17 +83,17 @@ test.describe('Testing selections', { tag: ['@skipWin'] }, () => {
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(${commonPoints.num1}, %) |> xLine(length = ${commonPoints.num1})
|> yLine(${commonPoints.num1 + 0.01}, %)`) |> yLine(length = ${commonPoints.num1 + 0.01})`)
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.mouse.click(startXPx, 500 - PUR * 20) await page.mouse.click(startXPx, 500 - PUR * 20)
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${
commonPoints.startAt commonPoints.startAt
}, sketch001) }, sketch001)
|> xLine(${commonPoints.num1}, %) |> xLine(length = ${commonPoints.num1})
|> yLine(${commonPoints.num1 + 0.01}, %) |> yLine(length = ${commonPoints.num1 + 0.01})
|> xLine(${commonPoints.num2 * -1}, %)`) |> xLine(length = ${commonPoints.num2 * -1})`)
// deselect line tool // deselect line tool
await page.getByRole('button', { name: 'line Line', exact: true }).click() await page.getByRole('button', { name: 'line Line', exact: true }).click()
@ -158,7 +158,9 @@ test.describe('Testing selections', { tag: ['@skipWin'] }, () => {
// check the same selection again by putting cursor in code first then selecting axis // check the same selection again by putting cursor in code first then selecting axis
await test.step(`Same selection but code selection then axis`, async () => { await test.step(`Same selection but code selection then axis`, async () => {
await page.getByText(` |> xLine(${commonPoints.num2 * -1}, %)`).click() await page
.getByText(` |> xLine(length = ${commonPoints.num2 * -1})`)
.click()
await page.keyboard.down('Shift') await page.keyboard.down('Shift')
await constrainButton.click() await constrainButton.click()
await expect(absXButton).toBeDisabled() await expect(absXButton).toBeDisabled()
@ -182,7 +184,9 @@ test.describe('Testing selections', { tag: ['@skipWin'] }, () => {
process.platform === 'linux' ? 'Control' : 'Meta' process.platform === 'linux' ? 'Control' : 'Meta'
) )
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByText(` |> xLine(${commonPoints.num2 * -1}, %)`).click() await page
.getByText(` |> xLine(length = ${commonPoints.num2 * -1})`)
.click()
await expect(page.locator('.cm-cursor')).toHaveCount(2) await expect(page.locator('.cm-cursor')).toHaveCount(2)
await page.waitForTimeout(500) await page.waitForTimeout(500)
@ -536,9 +540,9 @@ profile003 = startProfileAt([40.16, -120.48], sketch006)
|> line(end = [7.13, 4 + 0]) |> line(end = [7.13, 4 + 0])
|> angledLine({ angle = 3 + 0, length = 3.14 + 0 }, %) |> angledLine({ angle = 3 + 0, length = 3.14 + 0 }, %)
|> line(endAbsolute = [20.14 + 0, -0.14 + 0]) |> line(endAbsolute = [20.14 + 0, -0.14 + 0])
|> xLineTo(29 + 0, %) |> xLine(endAbsolute = 29 + 0)
|> yLine(-3.14 + 0, %, $a) |> yLine(length = -3.14 + 0, tag = $a)
|> xLine(1.63, %) |> xLine(length = 1.63)
|> angledLineOfXLength({ angle = 3 + 0, length = 3.14 }, %) |> angledLineOfXLength({ angle = 3 + 0, length = 3.14 }, %)
|> angledLineOfYLength({ angle = 30, length = 3 + 0 }, %) |> angledLineOfYLength({ angle = 30, length = 3 + 0 }, %)
|> angledLineToX({ angle = 22.14 + 0, to = 12 }, %) |> angledLineToX({ angle = 22.14 + 0, to = 12 }, %)

View File

@ -52,14 +52,14 @@ armThick = 0.5
totalLen = 9.5 totalLen = 9.5
part001 = startSketchOn('-XZ') part001 = startSketchOn('-XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLine(baseHeight, %) |> yLine(length = baseHeight)
|> xLine(baseLen, %) |> xLine(length = baseLen)
|> angledLineToY({ |> angledLineToY({
angle = topAng, angle = topAng,
to = totalHeightHalf, to = totalHeightHalf,
}, %, $seg04) }, %, $seg04)
|> xLineTo(totalLen, %, $seg03) |> xLine(endAbsolute = totalLen, tag = $seg03)
|> yLine(-armThick, %, $seg01) |> yLine(length = -armThick, tag = $seg01)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle = HALF_TURN, angle = HALF_TURN,
offset = -armThick, offset = -armThick,
@ -70,15 +70,15 @@ part001 = startSketchOn('-XZ')
angle = -bottomAng, angle = -bottomAng,
to = -totalHeightHalf - armThick, to = -totalHeightHalf - armThick,
}, %, $seg02) }, %, $seg02)
|> xLineTo(segEndX(seg03) + 0, %) |> xLine(endAbsolute = segEndX(seg03) + 0)
|> yLine(-segLen(seg01), %) |> yLine(length = -segLen(seg01))
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle = HALF_TURN, angle = HALF_TURN,
offset = -armThick, offset = -armThick,
intersectTag = seg02 intersectTag = seg02
}, %) }, %)
|> angledLineToY([segAng(seg02) + 180, -baseHeight], %) |> angledLineToY([segAng(seg02) + 180, -baseHeight], %)
|> xLineTo(ZERO, %) |> xLine(endAbsolute = ZERO)
|> close() |> close()
|> extrude(length = 4)` |> extrude(length = 4)`
) )

View File

@ -91,7 +91,7 @@
"fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages", "fmt-check": "prettier --check ./src *.ts *.json *.js ./e2e ./packages",
"fetch:wasm": "./scripts/get-latest-wasm-bundle.sh", "fetch:wasm": "./scripts/get-latest-wasm-bundle.sh",
"fetch:wasm:windows": "./scripts/get-latest-wasm-bundle.ps1", "fetch:wasm:windows": "./scripts/get-latest-wasm-bundle.ps1",
"fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/next/manifest.json", "fetch:samples": "echo \"Fetching latest KCL samples...\" && curl -o public/kcl-samples-manifest-fallback.json https://raw.githubusercontent.com/KittyCAD/achalmers/kw-args-xylineto/manifest.json",
"build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt", "build:wasm-dev": "yarn wasm-prep && (cd src/wasm-lib && wasm-pack build --dev --target web --out-dir pkg && cargo test -p kcl-lib export_bindings) && yarn isomorphic-copy-wasm && yarn fmt",
"build:wasm:nocopy": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings", "build:wasm:nocopy": "yarn wasm-prep && cd src/wasm-lib && wasm-pack build --release --target web --out-dir pkg && cargo test -p kcl-lib export_bindings",
"build:wasm": "yarn build:wasm:nocopy && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt", "build:wasm": "yarn build:wasm:nocopy && cp src/wasm-lib/pkg/wasm_lib_bg.wasm public && yarn fmt",

View File

@ -12,6 +12,7 @@ import child_process from 'node:child_process'
const DIR_KCL_SAMPLES = 'kcl-samples' const DIR_KCL_SAMPLES = 'kcl-samples'
const URL_GIT_KCL_SAMPLES = 'https://github.com/KittyCAD/kcl-samples.git' const URL_GIT_KCL_SAMPLES = 'https://github.com/KittyCAD/kcl-samples.git'
const BRANCH = 'achalmers/kw-args-xylineto'
interface KclSampleFile { interface KclSampleFile {
file: string file: string
@ -32,7 +33,7 @@ child_process.spawnSync('git', [
'clone', 'clone',
'--single-branch', '--single-branch',
'--branch', '--branch',
'next', BRANCH,
URL_GIT_KCL_SAMPLES, URL_GIT_KCL_SAMPLES,
DIR_KCL_SAMPLES, DIR_KCL_SAMPLES,
]) ])

View File

@ -592,10 +592,10 @@ ${!replace1 ? ` |> ${line}\n` : ''} |> angledLine([-65, ${
'line(endAbsolute = [306.21, 198.85], tag = $a)', 'line(endAbsolute = [306.21, 198.85], tag = $a)',
['110.48', '119.73'], ['110.48', '119.73'],
], ],
['yLine', 'yLine(198.85, %, $a)', ['198.85', '90']], ['yLine', 'yLine(length = 198.85, tag = $a)', ['198.85', '90']],
['xLine', 'xLine(198.85, %, $a)', ['198.85', '0']], ['xLine', 'xLine(length = 198.85, tag = $a)', ['198.85', '0']],
['yLineTo', 'yLineTo(198.85, %, $a)', ['95.94', '90']], ['yLineTo', 'yLine(endAbsolute = 198.85, tag = $a)', ['95.94', '90']],
['xLineTo', 'xLineTo(198.85, %, $a)', ['162.14', '180']], ['xLineTo', 'xLine(endAbsolute = 198.85, tag = $a)', ['162.14', '180']],
[ [
'angledLine', 'angledLine',
'angledLine({ angle: 45.5, length: 198.85 }, %, $a)', 'angledLine({ angle: 45.5, length: 198.85 }, %, $a)',
@ -658,10 +658,10 @@ describe('Testing removeSingleConstraintInfo', () => {
|> line(end = [3 + 0, 4 + 0]) |> line(end = [3 + 0, 4 + 0])
|> angledLine({ angle = 3 + 0, length = 3.14 + 0 }, %) |> angledLine({ angle = 3 + 0, length = 3.14 + 0 }, %)
|> line(endAbsolute = [6.14 + 0, 3.14 + 0]) |> line(endAbsolute = [6.14 + 0, 3.14 + 0])
|> xLineTo(8 + 0, %) |> xLine(endAbsolute = 8 + 0)
|> yLineTo(5 + 0, %) |> yLine(endAbsolute = 5 + 0)
|> yLine(3.14 + 0, %, $a) |> yLine(length = 3.14 + 0, tag = $a)
|> xLine(3.14 + 0, %) |> xLine(length = 3.14 + 0)
|> angledLineOfXLength({ angle = 3 + 0, length = 3.14 + 0 }, %) |> angledLineOfXLength({ angle = 3 + 0, length = 3.14 + 0 }, %)
|> angledLineOfYLength({ angle = 30 + 0, length = 3 + 0 }, %) |> angledLineOfYLength({ angle = 30 + 0, length = 3 + 0 }, %)
|> angledLineToX({ angle = 12.14 + 0, to = 12 + 0 }, %) |> angledLineToX({ angle = 12.14 + 0, to = 12 + 0 }, %)
@ -679,11 +679,11 @@ describe('Testing removeSingleConstraintInfo', () => {
'objectProperty', 'objectProperty',
'angle', 'angle',
], ],
['line(endAbsolute = [6.14 + 0, 3.14 + 0])', 'arrayIndex', 0], ['line(endAbsolute = [6.14, 3.14 + 0])', 'arrayIndex', 0],
['xLineTo(8, %)', '', ''], ['xLine(endAbsolute = 8)', '', ''],
['yLineTo(5, %)', '', ''], ['yLine(endAbsolute = 5)', '', ''],
['yLine(3.14, %, $a)', '', ''], ['yLine(length = 3.14, tag = $a)', '', ''],
['xLine(3.14, %)', '', ''], ['xLine(length = 3.14)', '', ''],
[ [
'angledLineOfXLength({ angle = 3, length = 3.14 + 0 }, %)', 'angledLineOfXLength({ angle = 3, length = 3.14 + 0 }, %)',
'objectProperty', 'objectProperty',
@ -718,11 +718,13 @@ describe('Testing removeSingleConstraintInfo', () => {
const ast = assertParse(code) const ast = assertParse(code)
const execState = await enginelessExecutor(ast) const execState = await enginelessExecutor(ast)
const lineOfInterest = expectedFinish.split('(')[0] + '(' const lineOfInterest =
const range = topLevelRange( expectedFinish.indexOf('=') >= 0 && expectedFinish.indexOf('{') === -1
code.indexOf(lineOfInterest) + 1, ? expectedFinish.split('=')[0]
code.indexOf(lineOfInterest) + lineOfInterest.length : expectedFinish.split('(')[0] + '('
) const start = code.indexOf(lineOfInterest)
expect(start).toBeGreaterThanOrEqual(0)
const range = topLevelRange(start + 1, start + lineOfInterest.length)
const pathToNode = getNodePathFromSourceRange(ast, range) const pathToNode = getNodePathFromSourceRange(ast, range)
let argPosition: SimplifiedArgDetails let argPosition: SimplifiedArgDetails
if (key === 'arrayIndex' && typeof value === 'number') { if (key === 'arrayIndex' && typeof value === 'number') {

View File

@ -51,8 +51,8 @@ objExpShouldNotBeIncluded = { a: 1, b: 2, c: 3 }
part001 = startSketchOn('XY') part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLineTo(1, %) |> yLine(endAbsolute = 1)
|> xLine(3.84, %) // selection-range-7ish-before-this |> xLine(length = 3.84) // selection-range-7ish-before-this
variableBelowShouldNotBeIncluded = 3 variableBelowShouldNotBeIncluded = 3
` `
@ -690,25 +690,25 @@ describe('Testing specific sketch getNodeFromPath workflow', () => {
it('should parse the code', () => { it('should parse the code', () => {
const openSketch = `sketch001 = startSketchOn('XZ') const openSketch = `sketch001 = startSketchOn('XZ')
|> startProfileAt([0.02, 0.22], %) |> startProfileAt([0.02, 0.22], %)
|> xLine(0.39, %) |> xLine(length = 0.39)
|> line([0.02, -0.17], %) |> line([0.02, -0.17], %)
|> yLine(-0.15, %) |> yLine(length = -0.15)
|> line([-0.21, -0.02], %) |> line([-0.21, -0.02], %)
|> xLine(-0.15, %) |> xLine(length = -0.15)
|> line([-0.02, 0.21], %) |> line([-0.02, 0.21], %)
|> line([-0.08, 0.05], %)` |> line([-0.08, 0.05], %)`
const ast = assertParse(openSketch) const ast = assertParse(openSketch)
expect(ast.start).toEqual(0) expect(ast.start).toEqual(0)
expect(ast.end).toEqual(227) expect(ast.end).toEqual(245)
}) })
it('should find the location to add new lineTo', () => { it('should find the location to add new lineTo', () => {
const openSketch = `sketch001 = startSketchOn('XZ') const openSketch = `sketch001 = startSketchOn('XZ')
|> startProfileAt([0.02, 0.22], %) |> startProfileAt([0.02, 0.22], %)
|> xLine(0.39, %) |> xLine(length = 0.39)
|> line([0.02, -0.17], %) |> line([0.02, -0.17], %)
|> yLine(-0.15, %) |> yLine(length = -0.15)
|> line([-0.21, -0.02], %) |> line([-0.21, -0.02], %)
|> xLine(-0.15, %) |> xLine(length = -0.15)
|> line([-0.02, 0.21], %) |> line([-0.02, 0.21], %)
|> line([-0.08, 0.05], %)` |> line([-0.08, 0.05], %)`
const ast = assertParse(openSketch) const ast = assertParse(openSketch)
@ -744,11 +744,11 @@ describe('Testing specific sketch getNodeFromPath workflow', () => {
const recasted = recast(modifiedAst) const recasted = recast(modifiedAst)
const expectedCode = `sketch001 = startSketchOn('XZ') const expectedCode = `sketch001 = startSketchOn('XZ')
|> startProfileAt([0.02, 0.22], %) |> startProfileAt([0.02, 0.22], %)
|> xLine(0.39, %) |> xLine(length = 0.39)
|> line([0.02, -0.17], %) |> line([0.02, -0.17], %)
|> yLine(-0.15, %) |> yLine(length = -0.15)
|> line([-0.21, -0.02], %) |> line([-0.21, -0.02], %)
|> xLine(-0.15, %) |> xLine(length = -0.15)
|> line([-0.02, 0.21], %) |> line([-0.02, 0.21], %)
|> line([-0.08, 0.05], %) |> line([-0.08, 0.05], %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
@ -758,11 +758,11 @@ describe('Testing specific sketch getNodeFromPath workflow', () => {
it('it should find the location to add close', () => { it('it should find the location to add close', () => {
const openSketch = `sketch001 = startSketchOn('XZ') const openSketch = `sketch001 = startSketchOn('XZ')
|> startProfileAt([0.02, 0.22], %) |> startProfileAt([0.02, 0.22], %)
|> xLine(0.39, %) |> xLine(length = 0.39)
|> line([0.02, -0.17], %) |> line([0.02, -0.17], %)
|> yLine(-0.15, %) |> yLine(length = -0.15)
|> line([-0.21, -0.02], %) |> line([-0.21, -0.02], %)
|> xLine(-0.15, %) |> xLine(length = -0.15)
|> line([-0.02, 0.21], %) |> line([-0.02, 0.21], %)
|> line([-0.08, 0.05], %) |> line([-0.08, 0.05], %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)
@ -784,11 +784,11 @@ describe('Testing specific sketch getNodeFromPath workflow', () => {
const recasted = recast(modifiedAst) const recasted = recast(modifiedAst)
const expectedCode = `sketch001 = startSketchOn('XZ') const expectedCode = `sketch001 = startSketchOn('XZ')
|> startProfileAt([0.02, 0.22], %) |> startProfileAt([0.02, 0.22], %)
|> xLine(0.39, %) |> xLine(length = 0.39)
|> line([0.02, -0.17], %) |> line([0.02, -0.17], %)
|> yLine(-0.15, %) |> yLine(length = -0.15)
|> line([-0.21, -0.02], %) |> line([-0.21, -0.02], %)
|> xLine(-0.15, %) |> xLine(length = -0.15)
|> line([-0.02, 0.21], %) |> line([-0.02, 0.21], %)
|> line([-0.08, 0.05], %) |> line([-0.08, 0.05], %)
|> lineTo([profileStartX(%), profileStartY(%)], %) |> lineTo([profileStartX(%), profileStartY(%)], %)

View File

@ -334,10 +334,10 @@ describe('testing getConstraintInfo', () => {
length = 3.14, length = 3.14,
}, %) }, %)
|> line(endAbsolute = [6.14, 3.14]) |> line(endAbsolute = [6.14, 3.14])
|> xLineTo(8, %) |> xLine(endAbsolute = 8)
|> yLineTo(5, %) |> yLine(endAbsolute = 5)
|> yLine(3.14, %, $a) |> yLine(length = 3.14, tag = $a)
|> xLine(3.14, %) |> xLine(length = 3.14)
|> angledLineOfXLength({ |> angledLineOfXLength({
angle = 3.14, angle = 3.14,
length = 3.14, length = 3.14,
@ -431,12 +431,12 @@ describe('testing getConstraintInfo', () => {
], ],
], ],
[ [
'xLineTo', 'xLine(endAbsolute',
[ [
{ {
type: 'horizontal', type: 'horizontal',
isConstrained: true, isConstrained: true,
value: 'xLineTo', value: 'xLine',
sourceRange: [expect.any(Number), expect.any(Number), 0], sourceRange: [expect.any(Number), expect.any(Number), 0],
argPosition: undefined, argPosition: undefined,
pathToNode: expect.any(Array), pathToNode: expect.any(Array),
@ -454,12 +454,12 @@ describe('testing getConstraintInfo', () => {
], ],
], ],
[ [
'yLineTo', 'yLine(endAbsolute',
[ [
{ {
type: 'vertical', type: 'vertical',
isConstrained: true, isConstrained: true,
value: 'yLineTo', value: 'yLine',
sourceRange: [expect.any(Number), expect.any(Number), 0], sourceRange: [expect.any(Number), expect.any(Number), 0],
argPosition: undefined, argPosition: undefined,
pathToNode: expect.any(Array), pathToNode: expect.any(Array),
@ -477,7 +477,7 @@ describe('testing getConstraintInfo', () => {
], ],
], ],
[ [
'yLine(', 'yLine(length',
[ [
{ {
type: 'vertical', type: 'vertical',
@ -500,7 +500,7 @@ describe('testing getConstraintInfo', () => {
], ],
], ],
[ [
'xLine(', 'xLine(length',
[ [
{ {
type: 'horizontal', type: 'horizontal',
@ -683,10 +683,9 @@ describe('testing getConstraintInfo', () => {
], ],
])('testing %s when inputs are unconstrained', (functionName, expected) => { ])('testing %s when inputs are unconstrained', (functionName, expected) => {
const ast = assertParse(code) const ast = assertParse(code)
const sourceRange = topLevelRange( const start = code.indexOf(functionName)
code.indexOf(functionName), expect(start).toBeGreaterThanOrEqual(0)
code.indexOf(functionName) + functionName.length const sourceRange = topLevelRange(start, start + functionName.length)
)
if (err(ast)) return ast if (err(ast)) return ast
const pathToNode = getNodePathFromSourceRange(ast, sourceRange) const pathToNode = getNodePathFromSourceRange(ast, sourceRange)
const callExp = getNodeFromPath<Node<CallExpression | CallExpressionKw>>( const callExp = getNodeFromPath<Node<CallExpression | CallExpressionKw>>(
@ -708,10 +707,10 @@ describe('testing getConstraintInfo', () => {
|> line(end = [3, 4]) |> line(end = [3, 4])
|> angledLine([3.14, 3.14], %) |> angledLine([3.14, 3.14], %)
|> line(endAbsolute = [6.14, 3.14]) |> line(endAbsolute = [6.14, 3.14])
|> xLineTo(8, %) |> xLine(endAbsolute = 8)
|> yLineTo(5, %) |> yLine(endAbsolute = 5)
|> yLine(3.14, %, $a) |> yLine(length = 3.14, tag = $a)
|> xLine(3.14, %) |> xLine(length = 3.14)
|> angledLineOfXLength([3.14, 3.14], %) |> angledLineOfXLength([3.14, 3.14], %)
|> angledLineOfYLength([30, 3], %) |> angledLineOfYLength([30, 3], %)
|> angledLineToX([12, 12], %) |> angledLineToX([12, 12], %)
@ -865,10 +864,10 @@ describe('testing getConstraintInfo', () => {
|> line(end = [3 + 0, 4 + 0]) |> line(end = [3 + 0, 4 + 0])
|> angledLine({ angle = 3.14 + 0, length = 3.14 + 0 }, %) |> angledLine({ angle = 3.14 + 0, length = 3.14 + 0 }, %)
|> line(endAbsolute = [6.14 + 0, 3.14 + 0]) |> line(endAbsolute = [6.14 + 0, 3.14 + 0])
|> xLineTo(8 + 0, %) |> xLine(endAbsolute = 8 + 0)
|> yLineTo(5 + 0, %) |> yLine(endAbsolute = 5 + 0)
|> yLine(3.14 + 0, %, $a) |> yLine(length = 3.14 + 0, tag = $a)
|> xLine(3.14 + 0, %) |> xLine(length = 3.14 + 0)
|> angledLineOfXLength({ angle = 3.14 + 0, length = 3.14 + 0 }, %) |> angledLineOfXLength({ angle = 3.14 + 0, length = 3.14 + 0 }, %)
|> angledLineOfYLength({ angle = 30 + 0, length = 3 + 0 }, %) |> angledLineOfYLength({ angle = 30 + 0, length = 3 + 0 }, %)
|> angledLineToX({ angle = 12.14 + 0, to = 12 + 0 }, %) |> angledLineToX({ angle = 12.14 + 0, to = 12 + 0 }, %)
@ -950,12 +949,12 @@ describe('testing getConstraintInfo', () => {
], ],
], ],
[ [
'xLineTo', 'xLine(endAbsolute',
[ [
{ {
type: 'horizontal', type: 'horizontal',
isConstrained: true, isConstrained: true,
value: 'xLineTo', value: 'xLine',
sourceRange: [expect.any(Number), expect.any(Number), 0], sourceRange: [expect.any(Number), expect.any(Number), 0],
argPosition: undefined, argPosition: undefined,
pathToNode: expect.any(Array), pathToNode: expect.any(Array),
@ -973,12 +972,12 @@ describe('testing getConstraintInfo', () => {
], ],
], ],
[ [
'yLineTo', 'yLine(endAbsolute',
[ [
{ {
type: 'vertical', type: 'vertical',
isConstrained: true, isConstrained: true,
value: 'yLineTo', value: 'yLine',
sourceRange: [expect.any(Number), expect.any(Number), 0], sourceRange: [expect.any(Number), expect.any(Number), 0],
argPosition: undefined, argPosition: undefined,
pathToNode: expect.any(Array), pathToNode: expect.any(Array),
@ -996,7 +995,7 @@ describe('testing getConstraintInfo', () => {
], ],
], ],
[ [
'yLine(', 'yLine(length',
[ [
{ {
type: 'vertical', type: 'vertical',
@ -1019,7 +1018,7 @@ describe('testing getConstraintInfo', () => {
], ],
], ],
[ [
'xLine(', 'xLine(length',
[ [
{ {
type: 'horizontal', type: 'horizontal',

View File

@ -16,6 +16,7 @@ import {
VariableMap, VariableMap,
} from 'lang/wasm' } from 'lang/wasm'
import { import {
ARG_INDEX_FIELD,
getNodeFromPath, getNodeFromPath,
getNodeFromPathCurry, getNodeFromPathCurry,
getObjExprProperty, getObjExprProperty,
@ -76,6 +77,7 @@ import {
export const ARG_TAG = 'tag' export const ARG_TAG = 'tag'
export const ARG_END = 'end' export const ARG_END = 'end'
export const ARG_LENGTH = 'length'
export const ARG_END_ABSOLUTE = 'endAbsolute' export const ARG_END_ABSOLUTE = 'endAbsolute'
const STRAIGHT_SEGMENT_ERR = new Error( const STRAIGHT_SEGMENT_ERR = new Error(
@ -123,12 +125,7 @@ export function createFirstArg(
intersectTag: val[2], intersectTag: val[2],
}) })
} else { } else {
if ( if (['startSketchAt'].includes(sketchFn)) return val
['startSketchAt', 'xLine', 'xLineTo', 'yLine', 'yLineTo'].includes(
sketchFn
)
)
return val
} }
return new Error('Missing sketch line type') return new Error('Missing sketch line type')
} }
@ -207,7 +204,9 @@ const commonConstraintInfoHelper = (
case 'CallExpression': case 'CallExpression':
return 0 return 0
case 'CallExpressionKw': case 'CallExpressionKw':
return findKwArgAnyIndex([ARG_END, ARG_END_ABSOLUTE], callExp) const arg = findKwArgAnyIndex([ARG_END, ARG_END_ABSOLUTE], callExp)
if (arg === undefined) return undefined
return arg.argIndex
} }
})() })()
if (argIndex === undefined) { if (argIndex === undefined) {
@ -299,8 +298,8 @@ const commonConstraintInfoHelper = (
return constraints return constraints
} }
const horzVertConstraintInfoHelper = ( const horzVertConstraintInfoHelperKw = (
callExp: CallExpression, callExp: CallExpressionKw,
inputConstrainTypes: [ConstrainInfo['type'], ConstrainInfo['type']], inputConstrainTypes: [ConstrainInfo['type'], ConstrainInfo['type']],
stdLibFnName: ConstrainInfo['stdLibFnName'], stdLibFnName: ConstrainInfo['stdLibFnName'],
abbreviatedInput: AbbreviatedInput, abbreviatedInput: AbbreviatedInput,
@ -308,15 +307,24 @@ const horzVertConstraintInfoHelper = (
pathToNode: PathToNode, pathToNode: PathToNode,
filterValue?: string filterValue?: string
) => { ) => {
if (callExp.type !== 'CallExpression') return [] if (callExp.type !== 'CallExpressionKw') return []
const firstArg = callExp.arguments?.[0]
const callee = callExp.callee const callee = callExp.callee
const pathToFirstArg: PathToNode = [ const relevantArg = findKwArgAnyIndex(
[ARG_END_ABSOLUTE, ARG_END, ARG_LENGTH],
callExp
)
if (relevantArg === undefined) return []
const { argIndex, expr: relevantArgExpr } = relevantArg
const pathToRelevantArg: PathToNode = [
...pathToNode, ...pathToNode,
['arguments', 'CallExpression'], ['arguments', 'CallExpressionKw'],
[0, 'index'], [argIndex, ARG_INDEX_FIELD],
['arg', LABELED_ARG_FIELD],
]
const pathToCallee: PathToNode = [
...pathToNode,
['callee', 'CallExpressionKw'],
] ]
const pathToCallee: PathToNode = [...pathToNode, ['callee', 'CallExpression']]
return [ return [
constrainInfo( constrainInfo(
inputConstrainTypes[0], inputConstrainTypes[0],
@ -329,12 +337,12 @@ const horzVertConstraintInfoHelper = (
), ),
constrainInfo( constrainInfo(
inputConstrainTypes[1], inputConstrainTypes[1],
isNotLiteralArrayOrStatic(callExp.arguments?.[0]), isNotLiteralArrayOrStatic(relevantArgExpr),
code.slice(firstArg.start, firstArg.end), code.slice(relevantArgExpr.start, relevantArgExpr.end),
stdLibFnName, stdLibFnName,
abbreviatedInput, abbreviatedInput,
topLevelRange(firstArg.start, firstArg.end), topLevelRange(relevantArgExpr.start, relevantArgExpr.end),
pathToFirstArg pathToRelevantArg
), ),
] ]
} }
@ -401,7 +409,6 @@ export const line: SketchLineHelperKw = {
const callExp = createCallExpressionStdLibKw( const callExp = createCallExpressionStdLibKw(
'line', 'line',
null, // Assumes this is being called in a pipeline, so the first arg is optional and if not given, will become pipeline substitution. null, // Assumes this is being called in a pipeline, so the first arg is optional and if not given, will become pipeline substitution.
// TODO: ADAM: This should have a tag sometimes.
[createLabeledArg(ARG_END, createArrayExpression([newXVal, newYVal]))] [createLabeledArg(ARG_END, createArrayExpression([newXVal, newYVal]))]
) )
const pathToNodeIndex = pathToNode.findIndex( const pathToNodeIndex = pathToNode.findIndex(
@ -651,7 +658,7 @@ export const lineTo: SketchLineHelperKw = {
), ),
} }
export const xLineTo: SketchLineHelper = { export const xLineTo: SketchLineHelperKw = {
add: ({ node, pathToNode, segmentInput, replaceExistingCallback }) => { add: ({ node, pathToNode, segmentInput, replaceExistingCallback }) => {
if (segmentInput.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR if (segmentInput.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR
const { to } = segmentInput const { to } = segmentInput
@ -681,9 +688,8 @@ export const xLineTo: SketchLineHelper = {
valueUsedInTransform, valueUsedInTransform,
} }
} }
const callExp = createCallExpression('xLineTo', [ const callExp = createCallExpressionStdLibKw('xLine', newVal, [
newVal, createLabeledArg(ARG_END_ABSOLUTE, newVal),
createPipeSubstitution(),
]) ])
pipe.body = [...pipe.body, callExp] pipe.body = [...pipe.body, callExp]
return { return {
@ -695,24 +701,20 @@ export const xLineTo: SketchLineHelper = {
if (input.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR if (input.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR
const { to } = input const { to } = input
const _node = { ...node } const _node = { ...node }
const nodeMeta = getNodeFromPath<CallExpression>(_node, pathToNode) const nodeMeta = getNodeFromPath<CallExpressionKw>(_node, pathToNode)
if (err(nodeMeta)) return nodeMeta if (err(nodeMeta)) return nodeMeta
const { node: callExpression } = nodeMeta const { node: callExpression } = nodeMeta
const newX = createLiteral(roundOff(to[0], 2)) const newX = createLiteral(roundOff(to[0], 2))
if (isLiteralArrayOrStatic(callExpression.arguments?.[0])) { mutateKwArg(ARG_END_ABSOLUTE, callExpression, newX)
callExpression.arguments[0] = newX
} else {
mutateObjExpProp(callExpression.arguments?.[0], newX, 'to')
}
return { return {
modifiedAst: _node, modifiedAst: _node,
pathToNode, pathToNode,
} }
}, },
getTag: getTag(), getTag: getTagKwArg(),
addTag: addTag(), addTag: addTagKw(),
getConstraintInfo: (callExp, ...args) => getConstraintInfo: (callExp, ...args) =>
horzVertConstraintInfoHelper( horzVertConstraintInfoHelperKw(
callExp, callExp,
['horizontal', 'xAbsolute'], ['horizontal', 'xAbsolute'],
'xLineTo', 'xLineTo',
@ -721,7 +723,7 @@ export const xLineTo: SketchLineHelper = {
), ),
} }
export const yLineTo: SketchLineHelper = { export const yLineTo: SketchLineHelperKw = {
add: ({ node, pathToNode, segmentInput, replaceExistingCallback }) => { add: ({ node, pathToNode, segmentInput, replaceExistingCallback }) => {
if (segmentInput.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR if (segmentInput.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR
const { to } = segmentInput const { to } = segmentInput
@ -751,9 +753,8 @@ export const yLineTo: SketchLineHelper = {
valueUsedInTransform, valueUsedInTransform,
} }
} }
const callExp = createCallExpression('yLineTo', [ const callExp = createCallExpressionStdLibKw('yLine', newVal, [
newVal, createLabeledArg(ARG_END_ABSOLUTE, newVal),
createPipeSubstitution(),
]) ])
pipe.body = [...pipe.body, callExp] pipe.body = [...pipe.body, callExp]
return { return {
@ -765,24 +766,20 @@ export const yLineTo: SketchLineHelper = {
if (input.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR if (input.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR
const { to } = input const { to } = input
const _node = { ...node } const _node = { ...node }
const nodeMeta = getNodeFromPath<CallExpression>(_node, pathToNode) const nodeMeta = getNodeFromPath<CallExpressionKw>(_node, pathToNode)
if (err(nodeMeta)) return nodeMeta if (err(nodeMeta)) return nodeMeta
const { node: callExpression } = nodeMeta const { node: callExpression } = nodeMeta
const newY = createLiteral(roundOff(to[1], 2)) const newY = createLiteral(roundOff(to[1], 2))
if (isLiteralArrayOrStatic(callExpression.arguments?.[0])) { mutateKwArg(ARG_END_ABSOLUTE, callExpression, newY)
callExpression.arguments[0] = newY
} else {
mutateObjExpProp(callExpression.arguments?.[0], newY, 'to')
}
return { return {
modifiedAst: _node, modifiedAst: _node,
pathToNode, pathToNode,
} }
}, },
getTag: getTag(), getTag: getTagKwArg(),
addTag: addTag(), addTag: addTagKw(),
getConstraintInfo: (callExp, ...args) => getConstraintInfo: (callExp, ...args) =>
horzVertConstraintInfoHelper( horzVertConstraintInfoHelperKw(
callExp, callExp,
['vertical', 'yAbsolute'], ['vertical', 'yAbsolute'],
'yLineTo', 'yLineTo',
@ -791,7 +788,7 @@ export const yLineTo: SketchLineHelper = {
), ),
} }
export const xLine: SketchLineHelper = { export const xLine: SketchLineHelperKw = {
add: ({ node, pathToNode, segmentInput, replaceExistingCallback }) => { add: ({ node, pathToNode, segmentInput, replaceExistingCallback }) => {
if (segmentInput.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR if (segmentInput.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR
const { from, to } = segmentInput const { from, to } = segmentInput
@ -826,9 +823,8 @@ export const xLine: SketchLineHelper = {
} }
} }
const newLine = createCallExpression('xLine', [ const newLine = createCallExpressionStdLibKw('xLine', null, [
newVal, createLabeledArg(ARG_LENGTH, newVal),
createPipeSubstitution(),
]) ])
if (dec.init.type === 'PipeExpression') { if (dec.init.type === 'PipeExpression') {
dec.init.body = [...dec.init.body, newLine] dec.init.body = [...dec.init.body, newLine]
@ -841,24 +837,20 @@ export const xLine: SketchLineHelper = {
if (input.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR if (input.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR
const { to, from } = input const { to, from } = input
const _node = { ...node } const _node = { ...node }
const nodeMeta = getNodeFromPath<CallExpression>(_node, pathToNode) const nodeMeta = getNodeFromPath<CallExpressionKw>(_node, pathToNode)
if (err(nodeMeta)) return nodeMeta if (err(nodeMeta)) return nodeMeta
const { node: callExpression } = nodeMeta const { node: callExpression } = nodeMeta
const newX = createLiteral(roundOff(to[0] - from[0], 2)) const newX = createLiteral(roundOff(to[0] - from[0], 2))
if (isLiteralArrayOrStatic(callExpression.arguments?.[0])) { mutateKwArg(ARG_LENGTH, callExpression, newX)
callExpression.arguments[0] = newX
} else {
mutateObjExpProp(callExpression.arguments?.[0], newX, 'length')
}
return { return {
modifiedAst: _node, modifiedAst: _node,
pathToNode, pathToNode,
} }
}, },
getTag: getTag(), getTag: getTagKwArg(),
addTag: addTag(), addTag: addTagKw(),
getConstraintInfo: (callExp, ...args) => getConstraintInfo: (callExp, ...args) =>
horzVertConstraintInfoHelper( horzVertConstraintInfoHelperKw(
callExp, callExp,
['horizontal', 'xRelative'], ['horizontal', 'xRelative'],
'xLine', 'xLine',
@ -867,7 +859,7 @@ export const xLine: SketchLineHelper = {
), ),
} }
export const yLine: SketchLineHelper = { export const yLine: SketchLineHelperKw = {
add: ({ node, pathToNode, segmentInput, replaceExistingCallback }) => { add: ({ node, pathToNode, segmentInput, replaceExistingCallback }) => {
if (segmentInput.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR if (segmentInput.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR
const { from, to } = segmentInput const { from, to } = segmentInput
@ -900,9 +892,8 @@ export const yLine: SketchLineHelper = {
} }
} }
const newLine = createCallExpression('yLine', [ const newLine = createCallExpressionStdLibKw('yLine', null, [
newVal, createLabeledArg(ARG_LENGTH, newVal),
createPipeSubstitution(),
]) ])
if (dec.init.type === 'PipeExpression') { if (dec.init.type === 'PipeExpression') {
dec.init.body = [...dec.init.body, newLine] dec.init.body = [...dec.init.body, newLine]
@ -915,24 +906,20 @@ export const yLine: SketchLineHelper = {
if (input.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR if (input.type !== 'straight-segment') return STRAIGHT_SEGMENT_ERR
const { to, from } = input const { to, from } = input
const _node = { ...node } const _node = { ...node }
const nodeMeta = getNodeFromPath<CallExpression>(_node, pathToNode) const nodeMeta = getNodeFromPath<CallExpressionKw>(_node, pathToNode)
if (err(nodeMeta)) return nodeMeta if (err(nodeMeta)) return nodeMeta
const { node: callExpression } = nodeMeta const { node: callExpression } = nodeMeta
const newY = createLiteral(roundOff(to[1] - from[1], 2)) const newY = createLiteral(roundOff(to[1] - from[1], 2))
if (isLiteralArrayOrStatic(callExpression.arguments?.[0])) { mutateKwArg(ARG_LENGTH, callExpression, newY)
callExpression.arguments[0] = newY
} else {
mutateObjExpProp(callExpression.arguments?.[0], newY, 'length')
}
return { return {
modifiedAst: _node, modifiedAst: _node,
pathToNode, pathToNode,
} }
}, },
getTag: getTag(), getTag: getTagKwArg(),
addTag: addTag(), addTag: addTagKw(),
getConstraintInfo: (callExp, ...args) => getConstraintInfo: (callExp, ...args) =>
horzVertConstraintInfoHelper( horzVertConstraintInfoHelperKw(
callExp, callExp,
['vertical', 'yRelative'], ['vertical', 'yRelative'],
'yLine', 'yLine',
@ -2284,10 +2271,6 @@ export const updateStartProfileAtArgs: SketchLineHelper['updateArgs'] = ({
} }
export const sketchLineHelperMap: { [key: string]: SketchLineHelper } = { export const sketchLineHelperMap: { [key: string]: SketchLineHelper } = {
xLine,
yLine,
xLineTo,
yLineTo,
angledLine, angledLine,
angledLineOfXLength, angledLineOfXLength,
angledLineOfYLength, angledLineOfYLength,
@ -2302,6 +2285,10 @@ export const sketchLineHelperMapKw: { [key: string]: SketchLineHelperKw } = {
line, line,
lineTo, lineTo,
circleThreePoint, circleThreePoint,
xLine,
xLineTo,
yLine,
yLineTo,
} as const } as const
export function changeSketchArguments( export function changeSketchArguments(
@ -2382,6 +2369,32 @@ export function getConstraintInfo(
) )
} }
/* Keyword functions like 'line' could be absolute or relative, depending on their parameters.
But tooltips like 'line' or 'lineTo' are either relative or absolute. Not both.
So, map (line, absolute) to lineTo, and (line, relative) to line. Etc.
*/
export function sketchFnNameToTooltip(
fnName: string,
isAbsolute: boolean
): ToolTip | undefined {
switch (fnName) {
case 'line':
return isAbsolute ? 'lineTo' : fnName
case 'xLine':
return isAbsolute ? 'xLineTo' : fnName
case 'yLine':
return isAbsolute ? 'yLineTo' : fnName
}
}
export function sketchFnIsAbsolute(callExpression: CallExpressionKw): boolean {
const fnName = callExpression.callee.name
return (
fnName === 'circleThreePoint' ||
findKwArg('endAbsolute', callExpression) !== undefined
)
}
export function getConstraintInfoKw( export function getConstraintInfoKw(
callExpression: Node<CallExpressionKw>, callExpression: Node<CallExpressionKw>,
code: string, code: string,
@ -2389,11 +2402,12 @@ export function getConstraintInfoKw(
filterValue?: string filterValue?: string
): ConstrainInfo[] { ): ConstrainInfo[] {
const fnName = callExpression?.callee?.name || '' const fnName = callExpression?.callee?.name || ''
const isAbsolute = const isAbsolute = sketchFnIsAbsolute(callExpression)
fnName === 'circleThreePoint' || const correctFnName = sketchFnNameToTooltip(fnName, isAbsolute)
findKwArg('endAbsolute', callExpression) !== undefined if (correctFnName === undefined) {
if (!(fnName in sketchLineHelperMapKw)) return [] return []
const correctFnName = fnName === 'line' && isAbsolute ? 'lineTo' : fnName }
if (!(correctFnName in sketchLineHelperMapKw)) return []
return sketchLineHelperMapKw[correctFnName].getConstraintInfo( return sketchLineHelperMapKw[correctFnName].getConstraintInfo(
callExpression, callExpression,
code, code,
@ -2465,13 +2479,14 @@ export function addNewSketchLn({
pathToNode, pathToNode,
'PipeExpression' 'PipeExpression'
) )
return add({ const result = add({
node, node,
variables, variables,
pathToNode, pathToNode,
segmentInput, segmentInput,
spliceBetween, spliceBetween,
}) })
return result
} }
export function addCallExpressionsToPipe({ export function addCallExpressionsToPipe({
@ -2939,6 +2954,7 @@ function getFirstArgValuesForAngleFns(callExpression: CallExpression):
return new Error('expected ArrayExpression or ObjectExpression') return new Error('expected ArrayExpression or ObjectExpression')
} }
// This only works for positional calls. Do not use this with keyword args.
function getFirstArgValuesForXYLineFns(callExpression: CallExpression): { function getFirstArgValuesForXYLineFns(callExpression: CallExpression): {
val: Expr val: Expr
tag?: Expr tag?: Expr
@ -2949,10 +2965,7 @@ function getFirstArgValuesForXYLineFns(callExpression: CallExpression): {
return { val: firstArg } return { val: firstArg }
} }
const tag = firstArg.properties.find((p) => p.key.name === 'tag')?.value const tag = firstArg.properties.find((p) => p.key.name === 'tag')?.value
const secondArgName = ['xLineTo', 'yLineTo', 'startSketchAt'].includes( const secondArgName = ['startSketchAt'].includes(callExpression?.callee?.name)
// const secondArgName = ['xLineTo', 'yLineTo', 'angledLineToX', 'angledLineToY'].includes(
callExpression?.callee?.name
)
? 'to' ? 'to'
: 'length' : 'length'
const length = firstArg.properties.find( const length = firstArg.properties.find(
@ -3032,8 +3045,29 @@ export function isAbsoluteLine(lineCall: CallExpressionKw): boolean | Error {
return true return true
} }
return new Error( return new Error(
`line call has neither ${ARG_END} nor ${ARG_END_ABSOLUTE} params` `${name} call has neither ${ARG_END} nor ${ARG_END_ABSOLUTE} params`
) )
case 'xLine':
if (findKwArg(ARG_LENGTH, lineCall) !== undefined) {
return false
}
if (findKwArg(ARG_END_ABSOLUTE, lineCall) !== undefined) {
return true
}
return new Error(
`${name} call has neither ${ARG_LENGTH} nor ${ARG_END_ABSOLUTE} params`
)
case 'yLine':
if (findKwArg(ARG_LENGTH, lineCall) !== undefined) {
return false
}
if (findKwArg(ARG_END_ABSOLUTE, lineCall) !== undefined) {
return true
}
return new Error(
`${name} call has neither ${ARG_LENGTH} nor ${ARG_END_ABSOLUTE} params`
)
case 'circleThreePoint': case 'circleThreePoint':
return false return false
} }
@ -3050,16 +3084,25 @@ export function getArgForEnd(lineCall: CallExpressionKw):
} }
| Error { | Error {
const name = lineCall?.callee?.name const name = lineCall?.callee?.name
let arg switch (name) {
if (name === 'line') { case 'line': {
arg = findKwArgAny([ARG_END, ARG_END_ABSOLUTE], lineCall) const arg = findKwArgAny([ARG_END, ARG_END_ABSOLUTE], lineCall)
} else { if (arg === undefined) {
return new Error('cannot find end of line function: ' + name) return new Error("no end of the line was found in fn '" + name + "'")
}
return getValuesForXYFns(arg)
}
case 'xLine':
case 'yLine': {
const arg = findKwArgAny([ARG_LENGTH, ARG_END_ABSOLUTE], lineCall)
if (arg === undefined) {
return new Error("no end of the line was found in fn '" + name + "'")
}
return { val: arg }
}
default:
return new Error('unknown sketch keyword function ' + name)
} }
if (arg === undefined) {
return new Error("no end of the line was found in fn '" + name + "'")
}
return getValuesForXYFns(arg)
} }
export function getFirstArg(callExp: CallExpression): export function getFirstArg(callExp: CallExpression):
@ -3080,9 +3123,6 @@ export function getFirstArg(callExp: CallExpression):
) { ) {
return getFirstArgValuesForAngleFns(callExp) return getFirstArgValuesForAngleFns(callExp)
} }
if (['xLine', 'yLine', 'xLineTo', 'yLineTo'].includes(name)) {
return getFirstArgValuesForXYLineFns(callExp)
}
if (['startSketchAt'].includes(name)) { if (['startSketchAt'].includes(name)) {
return getFirstArgValuesForXYLineFns(callExp) return getFirstArgValuesForXYLineFns(callExp)
} }

View File

@ -80,10 +80,10 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
` |> angledLineOfYLength({ angle = 104, length = 1.58 }, %, $abc5)`, ` |> angledLineOfYLength({ angle = 104, length = 1.58 }, %, $abc5)`,
` |> angledLineToX({ angle = 55, to = -2.89 }, %, $abc6)`, ` |> angledLineToX({ angle = 55, to = -2.89 }, %, $abc6)`,
` |> angledLineToY({ angle = 330, to = 2.53 }, %, $abc7)`, ` |> angledLineToY({ angle = 330, to = 2.53 }, %, $abc7)`,
` |> xLine(1.47, %, $abc8)`, ` |> xLine(length = 1.47, tag = $abc8)`,
` |> yLine(1.57, %, $abc9)`, ` |> yLine(length = 1.57, tag = $abc9)`,
` |> xLineTo(1.49, %, $abc10)`, ` |> xLine(endAbsolute = 1.49, tag = $abc10)`,
` |> yLineTo(2.64, %, $abc11)`, ` |> yLine(endAbsolute = 2.64, tag = $abc11)`,
` |> line(endAbsolute = [2.55, 3.58]) // lineTo`, ` |> line(endAbsolute = [2.55, 3.58]) // lineTo`,
` |> line(end = [0.73, -0.75])`, ` |> line(end = [0.73, -0.75])`,
` |> angledLine([63, 1.38], %) // angledLine`, ` |> angledLine([63, 1.38], %) // angledLine`,
@ -91,15 +91,15 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
` |> angledLineOfYLength([50, 1.35], %) // angledLineOfYLength`, ` |> angledLineOfYLength([50, 1.35], %) // angledLineOfYLength`,
` |> angledLineToX([291, 6.66], %) // angledLineToX`, ` |> angledLineToX([291, 6.66], %) // angledLineToX`,
` |> angledLineToY([228, 2.14], %) // angledLineToY`, ` |> angledLineToY([228, 2.14], %) // angledLineToY`,
` |> xLine(-1.33, %)`, ` |> xLine(length = -1.33)`,
` |> yLine(-1.07, %)`, ` |> yLine(length = -1.07)`,
` |> xLineTo(3.27, %)`, ` |> xLine(endAbsolute = 3.27)`,
` |> yLineTo(2.14, %)`, ` |> yLine(endAbsolute = 2.14)`,
] ]
const bigExample = bigExampleArr.join('\n') const bigExample = bigExampleArr.join('\n')
it('line with tag converts to xLine', async () => { it('line with tag converts to xLine', async () => {
const callToSwap = 'line(end = [-2.04, -0.7], tag = $abc2)' const callToSwap = 'line(end = [-2.04, -0.7], tag = $abc2)'
const expectedLine = 'xLine(-2.04, %, $abc2)' const expectedLine = 'xLine(length = -2.04, tag = $abc2)'
const { newCode, originalRange } = await testingSwapSketchFnCall({ const { newCode, originalRange } = await testingSwapSketchFnCall({
inputCode: bigExample, inputCode: bigExample,
callToSwap, callToSwap,
@ -111,7 +111,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
}) })
it('line w/o tag converts to xLine', async () => { it('line w/o tag converts to xLine', async () => {
const callToSwap = 'line(end = [0.73, -0.75])' const callToSwap = 'line(end = [0.73, -0.75])'
const expectedLine = 'xLine(0.73, %)' const expectedLine = 'xLine(length = 0.73)'
const { newCode, originalRange } = await testingSwapSketchFnCall({ const { newCode, originalRange } = await testingSwapSketchFnCall({
inputCode: bigExample, inputCode: bigExample,
callToSwap, callToSwap,
@ -127,7 +127,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'line(endAbsolute = [1, 1], tag = $abc1)', callToSwap: 'line(endAbsolute = [1, 1], tag = $abc1)',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLineTo(1, %, $abc1)' const expectedLine = 'xLine(endAbsolute = 1, tag = $abc1)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -138,7 +138,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'line(endAbsolute = [2.55, 3.58])', callToSwap: 'line(endAbsolute = [2.55, 3.58])',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLineTo(2.55, %) // lineTo' const expectedLine = 'xLine(endAbsolute = 2.55) // lineTo'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -149,7 +149,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'angledLine({ angle = 157, length = 1.69 }, %, $abc3)', callToSwap: 'angledLine({ angle = 157, length = 1.69 }, %, $abc3)',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLine(-1.56, %, $abc3)' const expectedLine = 'xLine(length = -1.56, tag = $abc3)'
console.log(newCode) console.log(newCode)
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
@ -161,7 +161,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'angledLine([63, 1.38], %)', callToSwap: 'angledLine([63, 1.38], %)',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLine(0.63, %) // angledLine' const expectedLine = 'xLine(length = 0.63) // angledLine'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -173,7 +173,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
'angledLineOfXLength({ angle = 217, length = 0.86 }, %, $abc4)', 'angledLineOfXLength({ angle = 217, length = 0.86 }, %, $abc4)',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLine(-0.86, %, $abc4)' const expectedLine = 'xLine(length = -0.86, tag = $abc4)'
// hmm "-0.86" is correct since the angle is 104, but need to make sure this is compatible `-myVar` // hmm "-0.86" is correct since the angle is 104, but need to make sure this is compatible `-myVar`
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
@ -185,7 +185,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'angledLineOfXLength([319, 1.15], %)', callToSwap: 'angledLineOfXLength([319, 1.15], %)',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLine(1.15, %) // angledLineOfXLength' const expectedLine = 'xLine(length = 1.15) // angledLineOfXLength'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -197,7 +197,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
'angledLineOfYLength({ angle = 104, length = 1.58 }, %, $abc5)', 'angledLineOfYLength({ angle = 104, length = 1.58 }, %, $abc5)',
constraintType: 'vertical', constraintType: 'vertical',
}) })
const expectedLine = 'yLine(1.58, %, $abc5)' const expectedLine = 'yLine(length = 1.58, tag = $abc5)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -208,7 +208,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'angledLineOfYLength([50, 1.35], %)', callToSwap: 'angledLineOfYLength([50, 1.35], %)',
constraintType: 'vertical', constraintType: 'vertical',
}) })
const expectedLine = 'yLine(1.35, %) // angledLineOfYLength' const expectedLine = 'yLine(length = 1.35) // angledLineOfYLength'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -219,7 +219,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'angledLineToX({ angle = 55, to = -2.89 }, %, $abc6)', callToSwap: 'angledLineToX({ angle = 55, to = -2.89 }, %, $abc6)',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLineTo(-2.89, %, $abc6)' const expectedLine = 'xLine(endAbsolute = -2.89, tag = $abc6)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -230,7 +230,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'angledLineToX([291, 6.66], %)', callToSwap: 'angledLineToX([291, 6.66], %)',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLineTo(6.66, %) // angledLineToX' const expectedLine = 'xLine(endAbsolute = 6.66) // angledLineToX'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -241,7 +241,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'angledLineToY({ angle = 330, to = 2.53 }, %, $abc7)', callToSwap: 'angledLineToY({ angle = 330, to = 2.53 }, %, $abc7)',
constraintType: 'vertical', constraintType: 'vertical',
}) })
const expectedLine = 'yLineTo(2.53, %, $abc7)' const expectedLine = 'yLine(endAbsolute = 2.53, tag = $abc7)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -252,7 +252,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => {
callToSwap: 'angledLineToY([228, 2.14], %)', callToSwap: 'angledLineToY([228, 2.14], %)',
constraintType: 'vertical', constraintType: 'vertical',
}) })
const expectedLine = 'yLineTo(2.14, %) // angledLineToY' const expectedLine = 'yLine(endAbsolute = 2.14) // angledLineToY'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -289,7 +289,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo while keeping var
callToSwap: 'line(end = [lineX, 2.13])', callToSwap: 'line(end = [lineX, 2.13])',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLine(lineX, %)' const expectedLine = 'xLine(length = lineX)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -300,7 +300,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo while keeping var
callToSwap: 'line(endAbsolute = [lineToX, 2.85])', callToSwap: 'line(endAbsolute = [lineToX, 2.85])',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLineTo(lineToX, %)' const expectedLine = 'xLine(endAbsolute = lineToX)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -311,7 +311,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo while keeping var
callToSwap: 'angledLineOfXLength([329, angledLineOfXLengthX], %)', callToSwap: 'angledLineOfXLength([329, angledLineOfXLengthX], %)',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLine(angledLineOfXLengthX, %)' const expectedLine = 'xLine(length = angledLineOfXLengthX)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -322,7 +322,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo while keeping var
callToSwap: 'angledLineOfYLength([222, angledLineOfYLengthY], %)', callToSwap: 'angledLineOfYLength([222, angledLineOfYLengthY], %)',
constraintType: 'vertical', constraintType: 'vertical',
}) })
const expectedLine = 'yLine(-angledLineOfYLengthY, %)' const expectedLine = 'yLine(length = -angledLineOfYLengthY)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -333,7 +333,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo while keeping var
callToSwap: 'angledLineToX([330, angledLineToXx], %)', callToSwap: 'angledLineToX([330, angledLineToXx], %)',
constraintType: 'horizontal', constraintType: 'horizontal',
}) })
const expectedLine = 'xLineTo(angledLineToXx, %)' const expectedLine = 'xLine(endAbsolute = angledLineToXx)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -344,7 +344,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo while keeping var
callToSwap: 'angledLineToY([217, angledLineToYy], %)', callToSwap: 'angledLineToY([217, angledLineToYy], %)',
constraintType: 'vertical', constraintType: 'vertical',
}) })
const expectedLine = 'yLineTo(angledLineToYy, %)' const expectedLine = 'yLine(endAbsolute = angledLineToYy)'
expect(newCode).toContain(expectedLine) expect(newCode).toContain(expectedLine)
// new line should start at the same place as the old line // new line should start at the same place as the old line
expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) expect(originalRange[0]).toBe(newCode.indexOf(expectedLine))
@ -366,9 +366,9 @@ describe('testing getSketchSegmentIndexFromSourceRange', () => {
part001 = startSketchOn('XY') part001 = startSketchOn('XY')
|> startProfileAt([0, 0.04], %) // segment-in-start |> startProfileAt([0, 0.04], %) // segment-in-start
|> line(end = [0, 0.4]) |> line(end = [0, 0.4])
|> xLine(3.48, %) |> xLine(length = 3.48)
|> line(end = [2.14, 1.35]) // normal-segment |> line(end = [2.14, 1.35]) // normal-segment
|> xLine(3.54, %)` |> xLine(length = 3.54)`
it('normal case works', async () => { it('normal case works', async () => {
const execState = await enginelessExecutor(assertParse(code)) const execState = await enginelessExecutor(assertParse(code))
const index = code.indexOf('// normal-segment') - 7 const index = code.indexOf('// normal-segment') - 7

View File

@ -94,10 +94,10 @@ export function isSketchVariablesLinked(
to check or it finds a match. to check or it finds a match.
that way it can find fn calls that are linked to each other through variables eg: that way it can find fn calls that are linked to each other through variables eg:
const part001 = startSketchAt([0, 0]) const part001 = startSketchAt([0, 0])
|> xLineTo(1.69, %) |> xLine(endAbsolute = 1.69)
|> line(end = [myVar, 0.38]) // ❗️ <- cursor in this fn call (the primary) |> line(end = [myVar, 0.38]) // ❗️ <- cursor in this fn call (the primary)
|> line(end = [0.41, baz]) |> line(end = [0.41, baz])
|> xLine(0.91, %) |> xLine(length = 0.91)
|> angledLine([37, 2], %) |> angledLine([37, 2], %)
const yo = line(end = [myVar, 0.38], tag = part001) const yo = line(end = [myVar, 0.38], tag = part001)
|> line(end = [1, 1]) |> line(end = [1, 1])

View File

@ -21,7 +21,12 @@ import { err } from 'lib/trap'
import { enginelessExecutor } from '../../lib/testHelpers' import { enginelessExecutor } from '../../lib/testHelpers'
import { codeRefFromRange } from './artifactGraph' import { codeRefFromRange } from './artifactGraph'
import { findKwArg } from 'lang/util' import { findKwArg } from 'lang/util'
import { ARG_END, ARG_END_ABSOLUTE } from './sketch' import {
ARG_END,
ARG_END_ABSOLUTE,
sketchFnIsAbsolute,
sketchFnNameToTooltip,
} from './sketch'
beforeAll(async () => { beforeAll(async () => {
await initPromise await initPromise
@ -59,16 +64,16 @@ describe('testing getConstraintType', () => {
}) })
const helper2 = getConstraintTypeFromSourceHelper2 const helper2 = getConstraintTypeFromSourceHelper2
it('testing xLine', () => { it('testing xLine', () => {
expect(helper2(`xLine(5, %)`)).toBe('yRelative') expect(helper2(`xLine(length = 5)`)).toBe('yRelative')
}) })
it('testing yLine', () => { it('testing yLine', () => {
expect(helper2(`yLine(5, %)`)).toBe('xRelative') expect(helper2(`yLine(length = 5)`)).toBe('xRelative')
}) })
it('testing xLineTo', () => { it('testing xLineTo', () => {
expect(helper2(`xLineTo(5, %)`)).toBe('yAbsolute') expect(helper2(`xLine(endAbsolute = 5)`)).toBe('yAbsolute')
}) })
it('testing yLineTo', () => { it('testing yLineTo', () => {
expect(helper2(`yLineTo(5, %)`)).toBe('xAbsolute') expect(helper2(`yLine(endAbsolute = 5)`)).toBe('xAbsolute')
}) })
}) })
@ -124,9 +129,14 @@ function getConstraintTypeFromSourceHelper2(
): ReturnType<typeof getConstraintType> | Error { ): ReturnType<typeof getConstraintType> | Error {
const ast = assertParse(code) const ast = assertParse(code)
const arg = (ast.body[0] as any).expression.arguments[0] as Expr const call = (ast.body[0] as any).expression
const fnName = (ast.body[0] as any).expression.callee.name as ToolTip const arg = call.arguments[0] as Expr
return getConstraintType(arg, fnName, false) const fnName = call.callee.name as ToolTip
const correctFnName = sketchFnNameToTooltip(fnName, sketchFnIsAbsolute(call))
if (correctFnName === undefined) {
return new Error(`could not map this ${fnName} call to a tooltip`)
}
return getConstraintType(arg, correctFnName, false)
} }
function makeSelections( function makeSelections(
@ -254,10 +264,10 @@ part001 = startSketchOn('XY')
|> angledLineOfYLength([myAng, 0.7], %) // ln-angledLineOfYLength-angle should become angledLine |> angledLineOfYLength([myAng, 0.7], %) // ln-angledLineOfYLength-angle should become angledLine
|> angledLineOfYLength([35, myVar], %) // ln-angledLineOfYLength-yRelative use legAngY |> angledLineOfYLength([35, myVar], %) // ln-angledLineOfYLength-yRelative use legAngY
|> angledLineOfYLength([305, myVar], %) // ln-angledLineOfYLength-yRelative with angle > 90 use binExp |> angledLineOfYLength([305, myVar], %) // ln-angledLineOfYLength-yRelative with angle > 90 use binExp
|> xLine(1.03, %) // ln-xLine-free should sub in segLen |> xLine(length = 1.03) // ln-xLine-free should sub in segLen
|> yLine(1.04, %) // ln-yLine-free should sub in segLen |> yLine(length = 1.04) // ln-yLine-free should sub in segLen
|> xLineTo(30, %) // ln-xLineTo-free should convert to xLine |> xLine(endAbsolute = 30) // ln-xLineTo-free should convert to xLine
|> yLineTo(20, %) // ln-yLineTo-free should convert to yLine |> yLine(endAbsolute = 20) // ln-yLineTo-free should convert to yLine
` `
const expectModifiedScript = `myVar = 3 const expectModifiedScript = `myVar = 3
myVar2 = 5 myVar2 = 5
@ -326,10 +336,10 @@ part001 = startSketchOn('XY')
270 + legAngY(segLen(seg01), myVar), 270 + legAngY(segLen(seg01), myVar),
min(segLen(seg01), myVar) min(segLen(seg01), myVar)
], %) // ln-angledLineOfYLength-yRelative with angle > 90 use binExp ], %) // ln-angledLineOfYLength-yRelative with angle > 90 use binExp
|> xLine(segLen(seg01), %) // ln-xLine-free should sub in segLen |> xLine(length = segLen(seg01)) // ln-xLine-free should sub in segLen
|> yLine(segLen(seg01), %) // ln-yLine-free should sub in segLen |> yLine(length = segLen(seg01)) // ln-yLine-free should sub in segLen
|> xLine(segLen(seg01), %) // ln-xLineTo-free should convert to xLine |> xLine(length = segLen(seg01)) // ln-xLineTo-free should convert to xLine
|> yLine(segLen(seg01), %) // ln-yLineTo-free should convert to yLine |> yLine(length = segLen(seg01)) // ln-yLineTo-free should convert to yLine
` `
it('should transform the ast', async () => { it('should transform the ast', async () => {
const ast = assertParse(inputScript) const ast = assertParse(inputScript)
@ -400,25 +410,25 @@ myVar3 = -10
part001 = startSketchOn('XY') part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line(endAbsolute = [1, 1]) |> line(endAbsolute = [1, 1])
|> xLine(-6.28, %) // select for horizontal constraint 1 |> xLine(length = -6.28) // select for horizontal constraint 1
|> line(end = [-1.07, myVar]) // select for vertical constraint 1 |> line(end = [-1.07, myVar]) // select for vertical constraint 1
|> xLine(myVar, %) // select for horizontal constraint 2 |> xLine(length = myVar) // select for horizontal constraint 2
|> line(end = [6.35, -1.12]) // select for vertical constraint 2 |> line(end = [6.35, -1.12]) // select for vertical constraint 2
|> xLineTo(5, %) // select for horizontal constraint 3 |> xLine(endAbsolute = 5) // select for horizontal constraint 3
|> line(endAbsolute = [3, 11]) // select for vertical constraint 3 |> line(endAbsolute = [3, 11]) // select for vertical constraint 3
|> xLineTo(myVar2, %) // select for horizontal constraint 4 |> xLine(endAbsolute = myVar2) // select for horizontal constraint 4
|> line(endAbsolute = [4.08, myVar2]) // select for vertical constraint 4 |> line(endAbsolute = [4.08, myVar2]) // select for vertical constraint 4
|> xLine(-1.22, %) // select for horizontal constraint 5 |> xLine(length = -1.22) // select for horizontal constraint 5
|> angledLine([103, 1.44], %) // select for vertical constraint 5 |> angledLine([103, 1.44], %) // select for vertical constraint 5
|> xLine(-myVar, %) // select for horizontal constraint 6 |> xLine(length = -myVar) // select for horizontal constraint 6
|> angledLine([129, myVar], %) // select for vertical constraint 6 |> angledLine([129, myVar], %) // select for vertical constraint 6
|> xLine(-1.05, %) // select for horizontal constraint 7 |> xLine(length = -1.05) // select for horizontal constraint 7
|> angledLineOfYLength([196, 1.11], %) // select for vertical constraint 7 |> angledLineOfYLength([196, 1.11], %) // select for vertical constraint 7
|> xLine(-myVar, %) // select for horizontal constraint 8 |> xLine(length = -myVar) // select for horizontal constraint 8
|> angledLineOfYLength([248, myVar], %) // select for vertical constraint 8 |> angledLineOfYLength([248, myVar], %) // select for vertical constraint 8
|> xLineTo(-10.92, %) // select for horizontal constraint 9 |> xLine(endAbsolute = -10.92) // select for horizontal constraint 9
|> angledLineToY([223, 7.68], %) // select for vertical constraint 9 |> angledLineToY([223, 7.68], %) // select for vertical constraint 9
|> xLineTo(myVar3, %) // select for horizontal constraint 10 |> xLine(endAbsolute = myVar3) // select for horizontal constraint 10
|> angledLineToY([301, myVar], %) // select for vertical constraint 10 |> angledLineToY([301, myVar], %) // select for vertical constraint 10
` `
const ast = assertParse(inputScript) const ast = assertParse(inputScript)
@ -461,25 +471,25 @@ part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line(endAbsolute = [1, 1]) |> line(endAbsolute = [1, 1])
|> line(end = [-6.28, 1.4]) // select for horizontal constraint 1 |> line(end = [-6.28, 1.4]) // select for horizontal constraint 1
|> yLine(myVar, %) // select for vertical constraint 1 |> yLine(length = myVar) // select for vertical constraint 1
|> line(end = [myVar, 4.32]) // select for horizontal constraint 2 |> line(end = [myVar, 4.32]) // select for horizontal constraint 2
|> yLine(-1.12, %) // select for vertical constraint 2 |> yLine(length = -1.12) // select for vertical constraint 2
|> line(endAbsolute = [5, 8]) // select for horizontal constraint 3 |> line(endAbsolute = [5, 8]) // select for horizontal constraint 3
|> yLineTo(11, %) // select for vertical constraint 3 |> yLine(endAbsolute = 11) // select for vertical constraint 3
|> line(endAbsolute = [myVar2, 12.63]) // select for horizontal constraint 4 |> line(endAbsolute = [myVar2, 12.63]) // select for horizontal constraint 4
|> yLineTo(myVar2, %) // select for vertical constraint 4 |> yLine(endAbsolute = myVar2) // select for vertical constraint 4
|> angledLine([156, 1.34], %) // select for horizontal constraint 5 |> angledLine([156, 1.34], %) // select for horizontal constraint 5
|> yLine(1.4, %) // select for vertical constraint 5 |> yLine(length = 1.4) // select for vertical constraint 5
|> angledLine([-178, myVar], %) // select for horizontal constraint 6 |> angledLine([-178, myVar], %) // select for horizontal constraint 6
|> yLine(myVar, %) // select for vertical constraint 6 |> yLine(length = myVar) // select for vertical constraint 6
|> angledLineOfXLength([237, 1.05], %) // select for horizontal constraint 7 |> angledLineOfXLength([237, 1.05], %) // select for horizontal constraint 7
|> yLine(-1.11, %) // select for vertical constraint 7 |> yLine(length = -1.11) // select for vertical constraint 7
|> angledLineOfXLength([194, myVar], %) // select for horizontal constraint 8 |> angledLineOfXLength([194, myVar], %) // select for horizontal constraint 8
|> yLine(-myVar, %) // select for vertical constraint 8 |> yLine(length = -myVar) // select for vertical constraint 8
|> angledLineToX([202, -10.92], %) // select for horizontal constraint 9 |> angledLineToX([202, -10.92], %) // select for horizontal constraint 9
|> yLineTo(7.68, %) // select for vertical constraint 9 |> yLine(endAbsolute = 7.68) // select for vertical constraint 9
|> angledLineToX([333, myVar3], %) // select for horizontal constraint 10 |> angledLineToX([333, myVar3], %) // select for horizontal constraint 10
|> yLineTo(myVar, %) // select for vertical constraint 10 |> yLine(endAbsolute = myVar) // select for vertical constraint 10
` `
const ast = assertParse(inputScript) const ast = assertParse(inputScript)
@ -627,19 +637,19 @@ halfArmAngle = armAngle / 2
part001 = startSketchOn('XY') part001 = startSketchOn('XY')
|> startProfileAt([-0.01, -0.05], %) |> startProfileAt([-0.01, -0.05], %)
|> line(end = [0.01, 0.94 + 0]) // partial |> line(end = [0.01, 0.94 + 0]) // partial
|> xLine(3.03, %) // partial |> xLine(length = 3.03) // partial
|> angledLine({ |> angledLine({
angle: halfArmAngle, angle: halfArmAngle,
length: 2.45, length: 2.45,
}, %, $seg01bing) // partial }, %, $seg01bing) // partial
|> xLine(4.4, %) // partial |> xLine(length = 4.4) // partial
|> yLine(-1, %) // partial |> yLine(length = -1) // partial
|> xLine(-4.2 + 0, %) // full |> xLine(length = -4.2 + 0) // full
|> angledLine([segAng(seg01bing) + 180, 1.79], %) // partial |> angledLine([segAng(seg01bing) + 180, 1.79], %) // partial
|> line(end = [1.44, -0.74]) // free |> line(end = [1.44, -0.74]) // free
|> xLine(3.36, %) // partial |> xLine(length = 3.36) // partial
|> line(end = [1.49, 1.06]) // free |> line(end = [1.49, 1.06]) // free
|> xLine(-3.43 + 0, %) // full |> xLine(length = -3.43 + 0) // full
|> angledLineOfXLength([243 + 0, 1.2 + 0], %) // full` |> angledLineOfXLength([243 + 0, 1.2 + 0], %) // full`
const ast = assertParse(code) const ast = assertParse(code)
const constraintLevels: ConstraintLevel[] = ['full', 'partial', 'free'] const constraintLevels: ConstraintLevel[] = ['full', 'partial', 'free']

View File

@ -51,6 +51,9 @@ import {
ARG_END_ABSOLUTE, ARG_END_ABSOLUTE,
getConstraintInfoKw, getConstraintInfoKw,
isAbsoluteLine, isAbsoluteLine,
ARG_LENGTH,
sketchFnNameToTooltip,
sketchFnIsAbsolute,
} from './sketch' } from './sketch'
import { import {
getSketchSegmentFromPathToNode, getSketchSegmentFromPathToNode,
@ -138,7 +141,7 @@ function createCallWrapper(
} }
if (tooltip === 'lineTo') { if (tooltip === 'lineTo') {
const labeledArgs = [ const labeledArgs = [
createLabeledArg('endAbsolute', createArrayExpression(val)), createLabeledArg(ARG_END_ABSOLUTE, createArrayExpression(val)),
] ]
if (tag) { if (tag) {
labeledArgs.push(createLabeledArg(ARG_TAG, tag)) labeledArgs.push(createLabeledArg(ARG_TAG, tag))
@ -152,6 +155,40 @@ function createCallWrapper(
valueUsedInTransform, valueUsedInTransform,
} }
} }
} else {
// This else branch type narrows 'val' to a scalar.
if (
'xLine' === tooltip ||
'yLine' === tooltip ||
'xLineTo' === tooltip ||
'yLineTo' === tooltip
) {
const [isAbsolute, callee] = (() => {
switch (tooltip) {
case 'xLine':
return [false, 'xLine']
case 'yLine':
return [false, 'yLine']
case 'xLineTo':
return [true, 'xLine']
case 'yLineTo':
return [true, 'yLine']
}
})()
const argLabel = isAbsolute ? ARG_END_ABSOLUTE : ARG_LENGTH
const labeledArgs = [createLabeledArg(argLabel, val)]
if (tag) {
labeledArgs.push(createLabeledArg(ARG_TAG, tag))
}
return {
callExp: createCallExpressionStdLibKw(
callee,
null, // Assumes this is being called in a pipeline, so the first arg is optional and if not given, will become pipeline substitution.
labeledArgs
),
valueUsedInTransform,
}
}
} }
const args = const args =
@ -1376,6 +1413,14 @@ export function removeSingleConstraint({
console.error(callExp) console.error(callExp)
return false return false
} }
const correctFnName = (() => {
switch (callExp.node.type) {
case 'CallExpressionKw': {
const isAbsolute = sketchFnIsAbsolute(callExp.node)
return sketchFnNameToTooltip(callExp.node.callee.name, isAbsolute)
}
}
})()
if ( if (
callExp.node.type !== 'CallExpression' && callExp.node.type !== 'CallExpression' &&
callExp.node.type !== 'CallExpressionKw' callExp.node.type !== 'CallExpressionKw'
@ -1418,21 +1463,29 @@ export function removeSingleConstraint({
) )
} else { } else {
// It's a kw call. // It's a kw call.
const isAbsolute = callExp.node.callee.name == 'lineTo' const res: { isAbsolute: boolean; fnName: ToolTip } | undefined =
(() => {
switch (correctFnName) {
case 'lineTo':
return { isAbsolute: true, fnName: 'line' }
case 'line':
return { isAbsolute: false, fnName: 'line' }
}
})()
if (res === undefined) {
return new Error('Unrecognized kw call function ' + correctFnName)
}
const { isAbsolute, fnName } = res
if (isAbsolute) { if (isAbsolute) {
const args = [ const args = [
createLabeledArg(ARG_END_ABSOLUTE, createArrayExpression(values)), createLabeledArg(ARG_END_ABSOLUTE, createArrayExpression(values)),
] ]
return createStdlibCallExpressionKw('line', args, tag) return createStdlibCallExpressionKw(fnName, args, tag)
} else { } else {
const args = [ const args = [
createLabeledArg(ARG_END, createArrayExpression(values)), createLabeledArg(ARG_END, createArrayExpression(values)),
] ]
return createStdlibCallExpressionKw( return createStdlibCallExpressionKw(fnName, args, tag)
callExp.node.callee.name as ToolTip,
args,
tag
)
} }
} }
} }
@ -1550,7 +1603,7 @@ export function removeSingleConstraint({
} }
return createCallWrapper( return createCallWrapper(
callExp.node.callee.name as any, correctFnName || (callExp.node.callee.name as any),
rawArgs[0].expr, rawArgs[0].expr,
tag tag
) )
@ -1635,7 +1688,18 @@ function getTransformMapPathKw(
return false return false
} }
const isAbsolute = findKwArg(ARG_END_ABSOLUTE, sketchFnExp) !== undefined const isAbsolute = findKwArg(ARG_END_ABSOLUTE, sketchFnExp) !== undefined
const nameAbsolute = name === 'line' ? 'lineTo' : name const nameAbsolute = (() => {
switch (name) {
case 'line':
return 'lineTo'
case 'xLine':
return 'xLineTo'
case 'yLine':
return 'yLineTo'
default:
return name
}
})()
if (!toolTips.includes(name)) { if (!toolTips.includes(name)) {
return false return false
} }
@ -1708,17 +1772,16 @@ export function getConstraintType(
fnName: ToolTip, fnName: ToolTip,
isAbsolute: boolean isAbsolute: boolean
): LineInputsType | null { ): LineInputsType | null {
if (fnName === 'xLine') return 'yRelative'
if (fnName === 'yLine') return 'xRelative'
if (fnName === 'xLineTo') return 'yAbsolute'
if (fnName === 'yLineTo') return 'xAbsolute'
// this function assumes that for two val sketch functions that one arg is locked down not both // this function assumes that for two val sketch functions that one arg is locked down not both
// and for one val sketch functions that the arg is NOT locked down // and for one val sketch functions that the arg is NOT locked down
// these conditions should have been checked previously. // these conditions should have been checked previously.
// completely locked down or not locked down at all does not depend on the fnName so we can check that first // completely locked down or not locked down at all does not depend on the fnName so we can check that first
const isArr = isArray(val) const isArr = isArray(val)
if (!isArr) { if (isArr) {
if (fnName === 'xLine') return 'yRelative'
if (fnName === 'yLine') return 'xRelative'
if (fnName === 'xLineTo') return 'yAbsolute'
if (fnName === 'yLineTo') return 'xAbsolute'
} else {
const isFirstArgLockedDown = isNotLiteralArrayOrStatic(val[0]) const isFirstArgLockedDown = isNotLiteralArrayOrStatic(val[0])
if (fnName === 'line' && !isAbsolute) if (fnName === 'line' && !isAbsolute)
return isFirstArgLockedDown ? 'xRelative' : 'yRelative' return isFirstArgLockedDown ? 'xRelative' : 'yRelative'
@ -2038,12 +2101,26 @@ export function transformAstSketchLines({
} }
const { to, from } = seg const { to, from } = seg
// Note to ADAM: Here is where the replaceExisting call gets sent. // Note to ADAM: Here is where the replaceExisting call gets sent.
const correctFnName = (() => {
switch (call.node.type) {
case 'CallExpressionKw': {
const fnName = call.node.callee.name as ToolTip
const correctFnName = sketchFnNameToTooltip(
fnName,
sketchFnIsAbsolute(call.node)
)
return correctFnName
}
}
})()
const fnName =
correctFnName || transformTo || (call.node.callee.name as ToolTip)
const replacedSketchLine = replaceSketchLine({ const replacedSketchLine = replaceSketchLine({
node: node, node: node,
variables: memVars, variables: memVars,
pathToNode: _pathToNode, pathToNode: _pathToNode,
referencedSegment, referencedSegment,
fnName: transformTo || (call.node.callee.name as ToolTip), fnName,
segmentInput: segmentInput:
seg.type === 'Circle' seg.type === 'Circle'
? { ? {
@ -2154,7 +2231,10 @@ export function getConstraintLevelFromSourceRange(
case 'CallExpression': case 'CallExpression':
return getFirstArg(nodeMeta.node) return getFirstArg(nodeMeta.node)
case 'CallExpressionKw': case 'CallExpressionKw':
const arg = findKwArgAny([ARG_END, ARG_END_ABSOLUTE], nodeMeta.node) const arg = findKwArgAny(
[ARG_END, ARG_END_ABSOLUTE, ARG_LENGTH],
nodeMeta.node
)
if (arg === undefined) { if (arg === undefined) {
return new Error('unexpected call expression: ' + name) return new Error('unexpected call expression: ' + name)
} }

View File

@ -157,10 +157,14 @@ Search the keyword arguments from a call for an argument with one of these label
export function findKwArgAnyIndex( export function findKwArgAnyIndex(
labels: string[], labels: string[],
call: CallExpressionKw call: CallExpressionKw
): number | undefined { ): { expr: Expr; argIndex: number } | undefined {
return call.arguments.findIndex((arg) => { const argIndex = call.arguments.findIndex((arg) => {
return labels.includes(arg.label.name) return labels.includes(arg.label.name)
}) })
if (argIndex < 0) {
return undefined
}
return { expr: call.arguments[argIndex].arg, argIndex }
} }
export function isAbsolute(call: CallExpressionKw): boolean { export function isAbsolute(call: CallExpressionKw): boolean {

View File

@ -21,11 +21,11 @@ mountingHoleDiameter = 0.5
sketch001 = startSketchOn('XZ') sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(shelfMountL - thickness, %, $seg01) |> xLine(length = shelfMountL - thickness, tag = $seg01)
|> yLine(thickness, %, $seg02) |> yLine(length = thickness, tag = $seg02)
|> xLine(-shelfMountL, %, $seg03) |> xLine(length = -shelfMountL, tag = $seg03)
|> yLine(-wallMountL, %, $seg04) |> yLine(length = -wallMountL, tag = $seg04)
|> xLine(thickness, %, $seg05) |> xLine(length = thickness, tag = $seg05)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg06) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg06)
|> close() |> close()
|> extrude(%, length = width) |> extrude(%, length = width)

View File

@ -16,9 +16,9 @@ beforeAll(async () => {
describe('testing source range to artifact conversion', () => { describe('testing source range to artifact conversion', () => {
const MY_CODE = `sketch001 = startSketchOn('XZ') const MY_CODE = `sketch001 = startSketchOn('XZ')
profile001 = startProfileAt([105.55, 105.55], sketch001) profile001 = startProfileAt([105.55, 105.55], sketch001)
|> xLine(332.55, %, $seg01) |> xLine(length = 332.55, tag = $seg01)
|> yLine(-310.12, %, $seg02) |> yLine(length = -310.12, tag = $seg02)
|> xLine(-373.65, %) |> xLine(length = -373.65)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
extrude001 = extrude(profile001, length = 500) extrude001 = extrude(profile001, length = 500)
@ -1126,7 +1126,7 @@ profile004 = circle({
[ [
'segment 2', 'segment 2',
{ {
snippet: 'yLine(-310.12, %, $seg02)', snippet: 'yLine(length = -310.12, tag = $seg02)',
artifactDetails: { artifactDetails: {
type: 'segment', type: 'segment',
range: [149, 149, 0], range: [149, 149, 0],

View File

@ -8,13 +8,12 @@ use indexmap::IndexMap;
use itertools::Itertools; use itertools::Itertools;
use serde_json::json; use serde_json::json;
use super::kcl_doc::{ConstData, DocData, FnData};
use crate::{ use crate::{
docs::{is_primitive, StdLibFn}, docs::{is_primitive, StdLibFn},
std::StdLib, std::StdLib,
}; };
use super::kcl_doc::{ConstData, DocData, FnData};
const TYPES_DIR: &str = "../../../docs/kcl/types"; const TYPES_DIR: &str = "../../../docs/kcl/types";
fn init_handlebars() -> Result<handlebars::Handlebars<'static>> { fn init_handlebars() -> Result<handlebars::Handlebars<'static>> {

View File

@ -138,6 +138,7 @@
use std::{collections::HashMap, fmt}; use std::{collections::HashMap, fmt};
use anyhow::Result; use anyhow::Result;
use env::Environment;
use indexmap::IndexMap; use indexmap::IndexMap;
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@ -147,7 +148,6 @@ use crate::{
execution::KclValue, execution::KclValue,
source_range::SourceRange, source_range::SourceRange,
}; };
use env::Environment;
/// The distinguished name of the return value of a function. /// The distinguished name of the return value of a function.
pub(crate) const RETURN_NAME: &str = "__return"; pub(crate) const RETURN_NAME: &str = "__return";
@ -894,9 +894,8 @@ mod env {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::execution::kcl_value::{FunctionSource, NumericType};
use super::*; use super::*;
use crate::execution::kcl_value::{FunctionSource, NumericType};
fn sr() -> SourceRange { fn sr() -> SourceRange {
SourceRange::default() SourceRange::default()

View File

@ -3,8 +3,16 @@
use std::{path::PathBuf, sync::Arc}; use std::{path::PathBuf, sync::Arc};
use anyhow::Result; use anyhow::Result;
pub use artifact::{Artifact, ArtifactCommand, ArtifactGraph, ArtifactId};
use cache::OldAstState; use cache::OldAstState;
pub use cache::{bust_cache, clear_mem_cache};
pub use cad_op::Operation;
pub use geometry::*;
pub(crate) use import::{
import_foreign, send_to_engine as send_import_to_engine, PreImportedGeometry, ZOO_COORD_SYSTEM,
};
use indexmap::IndexMap; use indexmap::IndexMap;
pub use kcl_value::{KclObjectFields, KclValue, UnitAngle, UnitLen};
use kcmc::{ use kcmc::{
each_cmd as mcmd, each_cmd as mcmd,
ok_response::{output::TakeSnapshot, OkModelingCmdResponse}, ok_response::{output::TakeSnapshot, OkModelingCmdResponse},
@ -12,8 +20,10 @@ use kcmc::{
ImageFormat, ModelingCmd, ImageFormat, ModelingCmd,
}; };
use kittycad_modeling_cmds as kcmc; use kittycad_modeling_cmds as kcmc;
pub use memory::EnvironmentRef;
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
pub use state::{ExecState, IdGenerator, MetaSettings};
use crate::{ use crate::{
engine::EngineManager, engine::EngineManager,
@ -30,17 +40,6 @@ use crate::{
CompilationError, ExecError, ExecutionKind, KclErrorWithOutputs, CompilationError, ExecError, ExecutionKind, KclErrorWithOutputs,
}; };
pub use artifact::{Artifact, ArtifactCommand, ArtifactGraph, ArtifactId};
pub use cache::{bust_cache, clear_mem_cache};
pub use cad_op::Operation;
pub use geometry::*;
pub(crate) use import::{
import_foreign, send_to_engine as send_import_to_engine, PreImportedGeometry, ZOO_COORD_SYSTEM,
};
pub use kcl_value::{KclObjectFields, KclValue, UnitAngle, UnitLen};
pub use memory::EnvironmentRef;
pub use state::{ExecState, IdGenerator, MetaSettings};
pub(crate) mod annotations; pub(crate) mod annotations;
mod artifact; mod artifact;
pub(crate) mod cache; pub(crate) mod cache;
@ -988,8 +987,8 @@ const objExpShouldNotBeIncluded = { a: 1, b: 2, c: 3 }
const part001 = startSketchOn('XY') const part001 = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLineTo(1, %) |> yLine(endAbsolute = 1)
|> xLine(3.84, %) // selection-range-7ish-before-this |> xLine(length = 3.84) // selection-range-7ish-before-this
const variableBelowShouldNotBeIncluded = 3 const variableBelowShouldNotBeIncluded = 3
"#; "#;
@ -1723,9 +1722,9 @@ let w = f() + f()
async fn kcl_test_ids_stable_between_executions() { async fn kcl_test_ids_stable_between_executions() {
let code = r#"sketch001 = startSketchOn('XZ') let code = r#"sketch001 = startSketchOn('XZ')
|> startProfileAt([61.74, 206.13], %) |> startProfileAt([61.74, 206.13], %)
|> xLine(305.11, %, $seg01) |> xLine(length = 305.11, tag = $seg01)
|> yLine(-291.85, %) |> yLine(length = -291.85)
|> xLine(-segLen(seg01), %) |> xLine(length = -segLen(seg01))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
|> extrude(length = 40.14) |> extrude(length = 40.14)
@ -1748,9 +1747,9 @@ let w = f() + f()
let code = r#"sketch001 = startSketchOn('XZ') let code = r#"sketch001 = startSketchOn('XZ')
|> startProfileAt([62.74, 206.13], %) |> startProfileAt([62.74, 206.13], %)
|> xLine(305.11, %, $seg01) |> xLine(length = 305.11, tag = $seg01)
|> yLine(-291.85, %) |> yLine(length = -291.85)
|> xLine(-segLen(seg01), %) |> xLine(length = -segLen(seg01))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
|> extrude(length = 40.14) |> extrude(length = 40.14)
@ -1774,9 +1773,9 @@ let w = f() + f()
async fn kcl_test_changing_a_setting_updates_the_cached_state() { async fn kcl_test_changing_a_setting_updates_the_cached_state() {
let code = r#"sketch001 = startSketchOn('XZ') let code = r#"sketch001 = startSketchOn('XZ')
|> startProfileAt([61.74, 206.13], %) |> startProfileAt([61.74, 206.13], %)
|> xLine(305.11, %, $seg01) |> xLine(length = 305.11, tag = $seg01)
|> yLine(-291.85, %) |> yLine(length = -291.85)
|> xLine(-segLen(seg01), %) |> xLine(length = -segLen(seg01))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
|> extrude(length = 40.14) |> extrude(length = 40.14)

View File

@ -3581,11 +3581,11 @@ const cylinder = startSketchOn('-XZ')
fn test_ast_get_non_code_node_inline_comment() { fn test_ast_get_non_code_node_inline_comment() {
let some_program_string = r#"const part001 = startSketchOn('XY') let some_program_string = r#"const part001 = startSketchOn('XY')
|> startProfileAt([0,0], %) |> startProfileAt([0,0], %)
|> xLine(5, %) // lin |> xLine(length = 5) // lin
"#; "#;
let program = crate::parsing::top_level_parse(some_program_string).unwrap(); let program = crate::parsing::top_level_parse(some_program_string).unwrap();
let value = program.get_non_code_meta_for_position(86); let value = program.get_non_code_meta_for_position(92);
assert!(value.is_some()); assert!(value.is_some());
} }

View File

@ -4202,7 +4202,7 @@ e
/// angle = 30, /// angle = 30,
/// length = 3 / cos(toRadians(30)), /// length = 3 / cos(toRadians(30)),
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close(%) /// |> close(%)
/// ///
/// example = extrude(5, exampleSketch) /// example = extrude(5, exampleSketch)

View File

@ -108,7 +108,7 @@ pub async fn sqrt(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// angle = 50, /// angle = 50,
/// length = sqrt(2500), /// length = sqrt(2500),
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
@ -173,7 +173,7 @@ pub async fn round(_exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> startProfileAt([0, 0], %) /// |> startProfileAt([0, 0], %)
/// |> line(endAbsolute = [12, 10]) /// |> line(endAbsolute = [12, 10])
/// |> line(end = [round(7.02986), 0]) /// |> line(end = [round(7.02986), 0])
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// extrude001 = extrude(sketch001, length = 5) /// extrude001 = extrude(sketch001, length = 5)
@ -201,7 +201,7 @@ pub async fn floor(_exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// |> startProfileAt([0, 0], %) /// |> startProfileAt([0, 0], %)
/// |> line(endAbsolute = [12, 10]) /// |> line(endAbsolute = [12, 10])
/// |> line(end = [floor(7.02986), 0]) /// |> line(end = [floor(7.02986), 0])
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// extrude001 = extrude(sketch001, length = 5) /// extrude001 = extrude(sketch001, length = 5)
@ -229,7 +229,7 @@ pub async fn ceil(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// |> startProfileAt([0, 0], %) /// |> startProfileAt([0, 0], %)
/// |> line(endAbsolute = [12, 10]) /// |> line(endAbsolute = [12, 10])
/// |> line(end = [ceil(7.02986), 0]) /// |> line(end = [ceil(7.02986), 0])
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// extrude001 = extrude(sketch001, length = 5) /// extrude001 = extrude(sketch001, length = 5)
@ -347,7 +347,7 @@ pub async fn pow(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// angle = 50, /// angle = 50,
/// length = pow(5, 2), /// length = pow(5, 2),
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
@ -408,7 +408,7 @@ pub async fn asin(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// angle = toDegrees(asin(0.5)), /// angle = toDegrees(asin(0.5)),
/// length = 20, /// length = 20,
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// extrude001 = extrude(sketch001, length = 5) /// extrude001 = extrude(sketch001, length = 5)
@ -438,7 +438,7 @@ pub async fn atan(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// angle = toDegrees(atan(1.25)), /// angle = toDegrees(atan(1.25)),
/// length = 20, /// length = 20,
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// extrude001 = extrude(sketch001, length = 5) /// extrude001 = extrude(sketch001, length = 5)
@ -468,7 +468,7 @@ pub async fn atan2(_exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// angle = toDegrees(atan2(1.25, 2)), /// angle = toDegrees(atan2(1.25, 2)),
/// length = 20, /// length = 20,
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// extrude001 = extrude(sketch001, length = 5) /// extrude001 = extrude(sketch001, length = 5)
@ -632,7 +632,7 @@ pub async fn e(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclE
/// angle = 30, /// angle = 30,
/// length = 2 * e() ^ 2, /// length = 2 * e() ^ 2,
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 10) /// example = extrude(exampleSketch, length = 10)
@ -664,7 +664,7 @@ pub async fn tau(_exec_state: &mut ExecState, args: Args) -> Result<KclValue, Kc
/// angle = 50, /// angle = 50,
/// length = 10 * tau(), /// length = 10 * tau(),
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
@ -695,7 +695,7 @@ pub async fn to_radians(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// angle = 50, /// angle = 50,
/// length = 70 * cos(toRadians(45)), /// length = 70 * cos(toRadians(45)),
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
@ -725,7 +725,7 @@ pub async fn to_degrees(_exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// angle = 50, /// angle = 50,
/// length = 70 * cos(toDegrees(pi()/4)), /// length = 70 * cos(toDegrees(pi()/4)),
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)

View File

@ -72,9 +72,7 @@ lazy_static! {
Box::new(crate::std::shapes::CircleThreePoint), Box::new(crate::std::shapes::CircleThreePoint),
Box::new(crate::std::shapes::Polygon), Box::new(crate::std::shapes::Polygon),
Box::new(crate::std::sketch::Line), Box::new(crate::std::sketch::Line),
Box::new(crate::std::sketch::XLineTo),
Box::new(crate::std::sketch::XLine), Box::new(crate::std::sketch::XLine),
Box::new(crate::std::sketch::YLineTo),
Box::new(crate::std::sketch::YLine), Box::new(crate::std::sketch::YLine),
Box::new(crate::std::sketch::AngledLineToX), Box::new(crate::std::sketch::AngledLineToX),
Box::new(crate::std::sketch::AngledLineToY), Box::new(crate::std::sketch::AngledLineToY),

View File

@ -657,9 +657,8 @@ impl GeometryTrait for Box<Solid> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::execution::kcl_value::NumericType;
use super::*; use super::*;
use crate::execution::kcl_value::NumericType;
#[test] #[test]
fn test_array_to_point3d() { fn test_array_to_point3d() {

View File

@ -4,14 +4,13 @@ use derive_docs::stdlib;
use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::Color, ModelingCmd}; use kcmc::{each_cmd as mcmd, length_unit::LengthUnit, shared::Color, ModelingCmd};
use kittycad_modeling_cmds as kcmc; use kittycad_modeling_cmds as kcmc;
use super::sketch::PlaneData;
use crate::{ use crate::{
errors::KclError, errors::KclError,
execution::{ExecState, KclValue, Plane, PlaneType}, execution::{ExecState, KclValue, Plane, PlaneType},
std::Args, std::Args,
}; };
use super::sketch::PlaneData;
/// Offset a plane by a distance along its normal. /// Offset a plane by a distance along its normal.
pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn offset_plane(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let std_plane = args.get_unlabeled_kw_arg("plane")?; let std_plane = args.get_unlabeled_kw_arg("plane")?;

View File

@ -657,7 +657,7 @@ pub async fn angle_to_match_length_y(exec_state: &mut ExecState, args: Args) ->
/// angle = angleToMatchLengthY(seg01, 15, %), /// angle = angleToMatchLengthY(seg01, 15, %),
/// length = 5, /// length = 5,
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// extrusion = extrude(sketch001, length = 5) /// extrusion = extrude(sketch001, length = 5)

View File

@ -95,7 +95,6 @@ pub const NEW_TAG_KW: &str = "tag";
/// Draw a line to a point. /// Draw a line to a point.
pub async fn line(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn line(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
// let (to, sketch, tag): ([f64; 2], Sketch, Option<TagNode>) = args.get_data_and_sketch_and_tag()?;
let sketch = args.get_unlabeled_kw_arg("sketch")?; let sketch = args.get_unlabeled_kw_arg("sketch")?;
let end = args.get_kw_arg_opt("end")?; let end = args.get_kw_arg_opt("end")?;
let end_absolute = args.get_kw_arg_opt("endAbsolute")?; let end_absolute = args.get_kw_arg_opt("endAbsolute")?;
@ -260,152 +259,87 @@ async fn straight_line(
Ok(new_sketch) Ok(new_sketch)
} }
/// Draw a line to a point on the x-axis.
pub async fn x_line_to(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let (to, sketch, tag): (f64, Sketch, Option<TagNode>) = args.get_data_and_sketch_and_tag()?;
let new_sketch = inner_x_line_to(to, sketch, tag, exec_state, args).await?;
Ok(KclValue::Sketch {
value: Box::new(new_sketch),
})
}
/// Draw a line parallel to the X axis, that ends at the given X.
/// E.g. if the previous line ended at (1, 1),
/// then xLineTo(4) draws a line from (1, 1) to (4, 1)
///
/// ```no_run
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> xLineTo(15, %)
/// |> angledLine({
/// angle = 80,
/// length = 15,
/// }, %)
/// |> line(end = [8, -10])
/// |> xLineTo(40, %)
/// |> angledLine({
/// angle = 135,
/// length = 30,
/// }, %)
/// |> xLineTo(10, %)
/// |> close()
///
/// example = extrude(exampleSketch, length = 10)
/// ```
#[stdlib {
name = "xLineTo",
}]
async fn inner_x_line_to(
to: f64,
sketch: Sketch,
tag: Option<TagNode>,
exec_state: &mut ExecState,
args: Args,
) -> Result<Sketch, KclError> {
let from = sketch.current_pen_position()?;
let new_sketch = straight_line(
StraightLineParams::absolute([to, from.y], sketch, tag),
exec_state,
args,
)
.await?;
Ok(new_sketch)
}
/// Draw a line to a point on the y-axis.
pub async fn y_line_to(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let (to, sketch, tag): (f64, Sketch, Option<TagNode>) = args.get_data_and_sketch_and_tag()?;
let new_sketch = inner_y_line_to(to, sketch, tag, exec_state, args).await?;
Ok(KclValue::Sketch {
value: Box::new(new_sketch),
})
}
/// Draw a line parallel to the Y axis, that ends at the given Y.
/// E.g. if the previous line ended at (1, 1),
/// then yLineTo(4) draws a line from (1, 1) to (1, 4)
///
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle = 50,
/// length = 45,
/// }, %)
/// |> yLineTo(0, %)
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
#[stdlib {
name = "yLineTo",
}]
async fn inner_y_line_to(
to: f64,
sketch: Sketch,
tag: Option<TagNode>,
exec_state: &mut ExecState,
args: Args,
) -> Result<Sketch, KclError> {
let from = sketch.current_pen_position()?;
let new_sketch = straight_line(
StraightLineParams::absolute([from.x, to], sketch, tag),
exec_state,
args,
)
.await?;
Ok(new_sketch)
}
/// Draw a line on the x-axis. /// Draw a line on the x-axis.
pub async fn x_line(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn x_line(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let (length, sketch, tag): (f64, Sketch, Option<TagNode>) = args.get_data_and_sketch_and_tag()?; let sketch = args.get_unlabeled_kw_arg("sketch")?;
let length = args.get_kw_arg_opt("length")?;
let end_absolute = args.get_kw_arg_opt("endAbsolute")?;
let tag = args.get_kw_arg_opt(NEW_TAG_KW)?;
let new_sketch = inner_x_line(length, sketch, tag, exec_state, args).await?; let new_sketch = inner_x_line(sketch, length, end_absolute, tag, exec_state, args).await?;
Ok(KclValue::Sketch { Ok(KclValue::Sketch {
value: Box::new(new_sketch), value: Box::new(new_sketch),
}) })
} }
/// Draw a line relative to the current origin to a specified distance away /// Draw a line from current point, along the X axis. You can either specify
/// from the current position along the 'x' axis. /// this line's length, or which X it should end at.
/// ///
/// ```no_run /// ```no_run
/// exampleSketch = startSketchOn('XZ') /// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %) /// |> startProfileAt([0, 0], %)
/// |> xLine(15, %) /// |> xLine(length = 15)
/// |> angledLine({ /// |> angledLine({
/// angle = 80, /// angle = 80,
/// length = 15, /// length = 15,
/// }, %) /// }, %)
/// |> line(end = [8, -10]) /// |> line(end = [8, -10])
/// |> xLine(10, %) /// |> xLine(length = 10)
/// |> angledLine({ /// |> angledLine({
/// angle = 120, /// angle = 120,
/// length = 30, /// length = 30,
/// }, %) /// }, %)
/// |> xLine(-15, %) /// |> xLine(length = -15)
/// |> close()
///
/// example = extrude(exampleSketch, length = 10)
/// ```
/// ```no_run
/// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %)
/// |> xLine(endAbsolute = 15)
/// |> angledLine({
/// angle = 80,
/// length = 15,
/// }, %)
/// |> line(end = [8, -10])
/// |> xLine(length = 40)
/// |> angledLine({
/// angle = 135,
/// length = 30,
/// }, %)
/// |> xLine(length = 10)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 10) /// example = extrude(exampleSketch, length = 10)
/// ``` /// ```
#[stdlib { #[stdlib {
name = "xLine", name = "xLine",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
length = { docs = "How far away along the X axis should this line go? Incompatible with `endAbsolute`.", include_in_snippet = true},
end_absolute = { docs = "Which absolute X value should this line go to? Incompatible with `length`."},
tag = { docs = "Create a new tag which refers to this line"},
}
}] }]
async fn inner_x_line( async fn inner_x_line(
length: f64,
sketch: Sketch, sketch: Sketch,
length: Option<f64>,
end_absolute: Option<f64>,
tag: Option<TagNode>, tag: Option<TagNode>,
exec_state: &mut ExecState, exec_state: &mut ExecState,
args: Args, args: Args,
) -> Result<Sketch, KclError> { ) -> Result<Sketch, KclError> {
let from = sketch.current_pen_position()?;
straight_line( straight_line(
StraightLineParams::relative([length, 0.0], sketch, tag), StraightLineParams {
sketch,
end_absolute: end_absolute.map(|x| [x, from.y]),
end: length.map(|x| [x, 0.0]),
tag,
},
exec_state, exec_state,
args, args,
) )
@ -414,9 +348,12 @@ async fn inner_x_line(
/// Draw a line on the y-axis. /// Draw a line on the y-axis.
pub async fn y_line(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> { pub async fn y_line(exec_state: &mut ExecState, args: Args) -> Result<KclValue, KclError> {
let (length, sketch, tag): (f64, Sketch, Option<TagNode>) = args.get_data_and_sketch_and_tag()?; let sketch = args.get_unlabeled_kw_arg("sketch")?;
let length = args.get_kw_arg_opt("length")?;
let end_absolute = args.get_kw_arg_opt("endAbsolute")?;
let tag = args.get_kw_arg_opt(NEW_TAG_KW)?;
let new_sketch = inner_y_line(length, sketch, tag, exec_state, args).await?; let new_sketch = inner_y_line(sketch, length, end_absolute, tag, exec_state, args).await?;
Ok(KclValue::Sketch { Ok(KclValue::Sketch {
value: Box::new(new_sketch), value: Box::new(new_sketch),
}) })
@ -428,29 +365,56 @@ pub async fn y_line(exec_state: &mut ExecState, args: Args) -> Result<KclValue,
/// ```no_run /// ```no_run
/// exampleSketch = startSketchOn('XZ') /// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %) /// |> startProfileAt([0, 0], %)
/// |> yLine(15, %) /// |> yLine(length = 15)
/// |> angledLine({ /// |> angledLine({
/// angle = 30, /// angle = 30,
/// length = 15, /// length = 15,
/// }, %) /// }, %)
/// |> line(end = [8, -10]) /// |> line(end = [8, -10])
/// |> yLine(-5, %) /// |> yLine(length = -5)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 10) /// example = extrude(exampleSketch, length = 10)
/// ``` /// ```
/// ```no_run
/// exampleSketch = startSketchOn("XZ")
/// |> startProfileAt([0, 0], %)
/// |> angledLine({
/// angle = 50,
/// length = 45,
/// }, %)
/// |> yLine(endAbsolute = 0)
/// |> close()
///
/// example = extrude(exampleSketch, length = 5)
/// ```
#[stdlib { #[stdlib {
name = "yLine", name = "yLine",
keywords = true,
unlabeled_first = true,
args = {
sketch = { docs = "Which sketch should this path be added to?"},
length = { docs = "How far away along the Y axis should this line go? Incompatible with `endAbsolute`.", include_in_snippet = true},
end_absolute = { docs = "Which absolute Y value should this line go to? Incompatible with `length`."},
tag = { docs = "Create a new tag which refers to this line"},
}
}] }]
async fn inner_y_line( async fn inner_y_line(
length: f64,
sketch: Sketch, sketch: Sketch,
length: Option<f64>,
end_absolute: Option<f64>,
tag: Option<TagNode>, tag: Option<TagNode>,
exec_state: &mut ExecState, exec_state: &mut ExecState,
args: Args, args: Args,
) -> Result<Sketch, KclError> { ) -> Result<Sketch, KclError> {
let from = sketch.current_pen_position()?;
straight_line( straight_line(
StraightLineParams::relative([0.0, length], sketch, tag), StraightLineParams {
sketch,
end_absolute: end_absolute.map(|y| [from.x, y]),
end: length.map(|y| [0.0, y]),
tag,
},
exec_state, exec_state,
args, args,
) )
@ -489,13 +453,13 @@ pub async fn angled_line(exec_state: &mut ExecState, args: Args) -> Result<KclVa
/// ```no_run /// ```no_run
/// exampleSketch = startSketchOn('XZ') /// exampleSketch = startSketchOn('XZ')
/// |> startProfileAt([0, 0], %) /// |> startProfileAt([0, 0], %)
/// |> yLineTo(15, %) /// |> yLine(endAbsolute = 15)
/// |> angledLine({ /// |> angledLine({
/// angle = 30, /// angle = 30,
/// length = 15, /// length = 15,
/// }, %) /// }, %)
/// |> line(end = [8, -10]) /// |> line(end = [8, -10])
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 10) /// example = extrude(exampleSketch, length = 10)
@ -1120,9 +1084,9 @@ pub async fn start_sketch_on(exec_state: &mut ExecState, args: Args) -> Result<K
/// }) /// })
/// |> startProfileAt([0, 0], %) /// |> startProfileAt([0, 0], %)
/// |> line(end = [100.0, 0]) /// |> line(end = [100.0, 0])
/// |> yLine(-100.0, %) /// |> yLine(length = -100.0)
/// |> xLine(-100.0, %) /// |> xLine(length = -100.0)
/// |> yLine(100.0, %) /// |> yLine(length = 100.0)
/// |> close() /// |> close()
/// |> extrude(length = 3.14) /// |> extrude(length = 3.14)
/// ``` /// ```

View File

@ -949,9 +949,9 @@ d = 1
fn rect(x, y, w, h) { fn rect(x, y, w, h) {
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([x, y], %) |> startProfileAt([x, y], %)
|> xLine(w, %) |> xLine(length = w)
|> yLine(h, %) |> yLine(length = h)
|> xLine(-w, %) |> xLine(length = -w)
|> close() |> close()
|> extrude(d, %) |> extrude(d, %)
} }
@ -969,11 +969,11 @@ fn quad(x1, y1, x2, y2, x3, y3, x4, y4) {
fn crosshair(x, y) { fn crosshair(x, y) {
startSketchOn('XY') startSketchOn('XY')
|> startProfileAt([x, y], %) |> startProfileAt([x, y], %)
|> yLine(1, %) |> yLine(length = 1)
|> yLine(-2, %) |> yLine(length = -2)
|> yLine(1, %) |> yLine(length = 1)
|> xLine(1, %) |> xLine(length = 1)
|> xLine(-2, %) |> xLine(length = -2)
} }
fn z(z_x, z_y) { fn z(z_x, z_y) {

View File

@ -21,7 +21,7 @@ export PI = 3.14159265358979323846264338327950288_
/// angle = 30, /// angle = 30,
/// length = 2 * E ^ 2, /// length = 2 * E ^ 2,
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 10) /// example = extrude(exampleSketch, length = 10)
@ -37,7 +37,7 @@ export E = 2.71828182845904523536028747135266250_
/// angle = 50, /// angle = 50,
/// length = 10 * TAU, /// length = 10 * TAU,
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
@ -53,7 +53,7 @@ export TAU = 6.28318530717958647692528676655900577_
/// angle = 30, /// angle = 30,
/// length = 3 / cos(toRadians(30)), /// length = 3 / cos(toRadians(30)),
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
@ -70,7 +70,7 @@ export fn cos(num: number(rad)): number(_) {}
/// angle = 50, /// angle = 50,
/// length = 15 / sin(toDegrees(135)), /// length = 15 / sin(toDegrees(135)),
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)
@ -87,7 +87,7 @@ export fn sin(num: number(rad)): number(_) {}
/// angle = 50, /// angle = 50,
/// length = 50 * tan(1/2), /// length = 50 * tan(1/2),
/// }, %) /// }, %)
/// |> yLineTo(0, %) /// |> yLine(endAbsolute = 0)
/// |> close() /// |> close()
/// ///
/// example = extrude(exampleSketch, length = 5) /// example = extrude(exampleSketch, length = 5)

File diff suppressed because it is too large Load Diff

View File

@ -4,47 +4,47 @@ flowchart LR
2["Path<br>[399, 432, 0]"] 2["Path<br>[399, 432, 0]"]
3["Segment<br>[438, 478, 0]"] 3["Segment<br>[438, 478, 0]"]
4["Segment<br>[484, 542, 0]"] 4["Segment<br>[484, 542, 0]"]
5["Segment<br>[548, 578, 0]"] 5["Segment<br>[548, 584, 0]"]
6["Segment<br>[584, 643, 0]"] 6["Segment<br>[590, 649, 0]"]
7["Segment<br>[649, 708, 0]"] 7["Segment<br>[655, 720, 0]"]
8["Segment<br>[714, 773, 0]"] 8["Segment<br>[726, 785, 0]"]
9["Segment<br>[779, 831, 0]"] 9["Segment<br>[791, 849, 0]"]
10["Segment<br>[837, 895, 0]"] 10["Segment<br>[855, 913, 0]"]
11["Segment<br>[901, 937, 0]"] 11["Segment<br>[919, 961, 0]"]
12["Segment<br>[943, 1001, 0]"] 12["Segment<br>[967, 1025, 0]"]
13["Segment<br>[1007, 1037, 0]"] 13["Segment<br>[1031, 1067, 0]"]
14["Segment<br>[1043, 1102, 0]"] 14["Segment<br>[1073, 1132, 0]"]
15["Segment<br>[1108, 1171, 0]"] 15["Segment<br>[1138, 1207, 0]"]
16["Segment<br>[1177, 1237, 0]"] 16["Segment<br>[1213, 1273, 0]"]
17["Segment<br>[1243, 1276, 0]"] 17["Segment<br>[1279, 1318, 0]"]
18["Segment<br>[1282, 1341, 0]"] 18["Segment<br>[1324, 1383, 0]"]
19["Segment<br>[1347, 1383, 0]"] 19["Segment<br>[1389, 1431, 0]"]
20["Segment<br>[1389, 1448, 0]"] 20["Segment<br>[1437, 1496, 0]"]
21["Segment<br>[1454, 1509, 0]"] 21["Segment<br>[1502, 1563, 0]"]
22["Segment<br>[1515, 1575, 0]"] 22["Segment<br>[1569, 1629, 0]"]
23["Segment<br>[1581, 1705, 0]"] 23["Segment<br>[1635, 1765, 0]"]
24["Segment<br>[1711, 1771, 0]"] 24["Segment<br>[1771, 1831, 0]"]
25["Segment<br>[1777, 1810, 0]"] 25["Segment<br>[1837, 1876, 0]"]
26["Segment<br>[1816, 1875, 0]"] 26["Segment<br>[1882, 1941, 0]"]
27["Segment<br>[1881, 1889, 0]"] 27["Segment<br>[1947, 1955, 0]"]
28[Solid2d] 28[Solid2d]
end end
subgraph path30 [Path] subgraph path30 [Path]
30["Path<br>[1899, 1920, 0]"] 30["Path<br>[1965, 1986, 0]"]
31["Segment<br>[1926, 1939, 0]"] 31["Segment<br>[1992, 2011, 0]"]
32["Segment<br>[1945, 2003, 0]"] 32["Segment<br>[2017, 2075, 0]"]
33["Segment<br>[2009, 2045, 0]"] 33["Segment<br>[2081, 2123, 0]"]
34["Segment<br>[2051, 2110, 0]"] 34["Segment<br>[2129, 2188, 0]"]
35["Segment<br>[2116, 2130, 0]"] 35["Segment<br>[2194, 2214, 0]"]
36["Segment<br>[2136, 2196, 0]"] 36["Segment<br>[2220, 2280, 0]"]
37["Segment<br>[2202, 2241, 0]"] 37["Segment<br>[2286, 2331, 0]"]
38["Segment<br>[2247, 2306, 0]"] 38["Segment<br>[2337, 2396, 0]"]
39["Segment<br>[2312, 2320, 0]"] 39["Segment<br>[2402, 2410, 0]"]
40[Solid2d] 40[Solid2d]
end end
1["Plane<br>[399, 432, 0]"] 1["Plane<br>[399, 432, 0]"]
29["Plane<br>[1899, 1920, 0]"] 29["Plane<br>[1965, 1986, 0]"]
41["Sweep Extrusion<br>[2366, 2387, 0]"] 41["Sweep Extrusion<br>[2456, 2477, 0]"]
42[Wall] 42[Wall]
43[Wall] 43[Wall]
44[Wall] 44[Wall]

File diff suppressed because it is too large Load Diff

View File

@ -10,38 +10,38 @@ corner_radius = 5.0
brace_base = startSketchAt([corner_radius, 0]) brace_base = startSketchAt([corner_radius, 0])
|> line(end = [width - corner_radius, 0.0]) |> line(end = [width - corner_radius, 0.0])
|> tangentialArcToRelative([corner_radius, corner_radius], %) |> tangentialArcToRelative([corner_radius, corner_radius], %)
|> yLine(25.0 - corner_radius, %) |> yLine(length = 25.0 - corner_radius)
|> tangentialArcToRelative([-corner_radius, corner_radius], %) |> tangentialArcToRelative([-corner_radius, corner_radius], %)
|> xLine(-(d_wrist_circumference[0] - (corner_radius * 2)), %) |> xLine(length = -(d_wrist_circumference[0] - (corner_radius * 2)))
|> tangentialArcToRelative([-corner_radius, corner_radius], %) |> tangentialArcToRelative([-corner_radius, corner_radius], %)
|> yLine(length - 25.0 - 23.0 - (corner_radius * 2), %) |> yLine(length = length - 25.0 - 23.0 - (corner_radius * 2))
|> tangentialArcToRelative([corner_radius, corner_radius], %) |> tangentialArcToRelative([corner_radius, corner_radius], %)
|> xLine(15.0 - (corner_radius * 2), %) |> xLine(length = 15.0 - (corner_radius * 2))
|> tangentialArcToRelative([corner_radius, corner_radius], %) |> tangentialArcToRelative([corner_radius, corner_radius], %)
|> yLine(23.0 - corner_radius, %) |> yLine(length = 23.0 - corner_radius)
|> tangentialArcToRelative([-corner_radius, corner_radius], %) |> tangentialArcToRelative([-corner_radius, corner_radius], %)
|> xLine(-(hand_thickness + 15.0 + 15.0 - (corner_radius * 2)), %) |> xLine(length = -(hand_thickness + 15.0 + 15.0 - (corner_radius * 2)))
|> tangentialArcToRelative([-corner_radius, -corner_radius], %) |> tangentialArcToRelative([-corner_radius, -corner_radius], %)
|> yLine(-(23.0 - corner_radius), %) |> yLine(length = -(23.0 - corner_radius))
|> tangentialArcToRelative([corner_radius, -corner_radius], %) |> tangentialArcToRelative([corner_radius, -corner_radius], %)
|> xLine(15.0 - (corner_radius * 2), %) |> xLine(length = 15.0 - (corner_radius * 2))
|> tangentialArcToRelative([corner_radius, -corner_radius], %) |> tangentialArcToRelative([corner_radius, -corner_radius], %)
|> yLine(-(length - 25.0 - 23.0 - (corner_radius * 2)), %) |> yLine(length = -(length - 25.0 - 23.0 - (corner_radius * 2)))
|> tangentialArcToRelative([-corner_radius, -corner_radius], %) |> tangentialArcToRelative([-corner_radius, -corner_radius], %)
|> xLine(-(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius), %) |> xLine(length = -(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius))
|> tangentialArcToRelative([-corner_radius, -corner_radius], %) |> tangentialArcToRelative([-corner_radius, -corner_radius], %)
|> yLine(-(25.0 - corner_radius), %) |> yLine(length = -(25.0 - corner_radius))
|> tangentialArcToRelative([corner_radius, -corner_radius], %) |> tangentialArcToRelative([corner_radius, -corner_radius], %)
|> close(%) |> close(%)
inner = startSketchAt([0, 0]) inner = startSketchAt([0, 0])
|> xLine(1.0, %) |> xLine(length = 1.0)
|> tangentialArcToRelative([corner_radius, corner_radius], %) |> tangentialArcToRelative([corner_radius, corner_radius], %)
|> yLine(25.0 - (corner_radius * 2), %) |> yLine(length = 25.0 - (corner_radius * 2))
|> tangentialArcToRelative([-corner_radius, corner_radius], %) |> tangentialArcToRelative([-corner_radius, corner_radius], %)
|> xLine(-1.0, %) |> xLine(length = -1.0)
|> tangentialArcToRelative([-corner_radius, -corner_radius], %) |> tangentialArcToRelative([-corner_radius, -corner_radius], %)
|> yLine(-(25.0 - (corner_radius * 2)), %) |> yLine(length = -(25.0 - (corner_radius * 2)))
|> tangentialArcToRelative([corner_radius, -corner_radius], %) |> tangentialArcToRelative([corner_radius, -corner_radius], %)
|> close(%) |> close(%)

View File

@ -14,8 +14,8 @@ snapshot_kind: text
} }
}, },
"sourceRange": [ "sourceRange": [
2351, 2441,
2356, 2446,
0 0
] ]
}, },
@ -27,16 +27,16 @@ snapshot_kind: text
} }
}, },
"sourceRange": [ "sourceRange": [
2358, 2448,
2359, 2449,
0 0
] ]
} }
}, },
"name": "hole", "name": "hole",
"sourceRange": [ "sourceRange": [
2346, 2436,
2360, 2450,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -59,16 +59,16 @@ snapshot_kind: text
} }
}, },
"sourceRange": [ "sourceRange": [
2383, 2473,
2386, 2476,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
2366, 2456,
2387, 2477,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Variables in memory after executing i_shape.kcl description: Variables in memory after executing i_shape.kcl
snapshot_kind: text
--- ---
{ {
"brace_base": { "brace_base": {
@ -65,7 +66,7 @@ description: Variables in memory after executing i_shape.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
548, 548,
578, 584,
0 0
] ]
}, },
@ -87,8 +88,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
584, 590,
643, 649,
0 0
] ]
}, },
@ -115,8 +116,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
649, 655,
708, 720,
0 0
] ]
}, },
@ -138,8 +139,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
714, 726,
773, 785,
0 0
] ]
}, },
@ -166,8 +167,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
779, 791,
831, 849,
0 0
] ]
}, },
@ -189,8 +190,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
837, 855,
895, 913,
0 0
] ]
}, },
@ -217,8 +218,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
901, 919,
937, 961,
0 0
] ]
}, },
@ -240,8 +241,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
943, 967,
1001, 1025,
0 0
] ]
}, },
@ -268,8 +269,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1007, 1031,
1037, 1067,
0 0
] ]
}, },
@ -291,8 +292,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1043, 1073,
1102, 1132,
0 0
] ]
}, },
@ -319,8 +320,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1108, 1138,
1171, 1207,
0 0
] ]
}, },
@ -342,8 +343,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1177, 1213,
1237, 1273,
0 0
] ]
}, },
@ -370,8 +371,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1243, 1279,
1276, 1318,
0 0
] ]
}, },
@ -393,49 +394,26 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1282, 1324,
1341,
0
]
},
"ccw": true,
"center": [
16.60000000000001,
107.0
],
"from": [
11.6,
107.0
],
"tag": null,
"to": [
16.6,
102.0
],
"type": "TangentialArcTo",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1347,
1383, 1383,
0 0
] ]
}, },
"ccw": true,
"center": [
16.60000000000001,
107.0
],
"from": [ "from": [
16.6, 11.6,
102.0 107.0
], ],
"tag": null, "tag": null,
"to": [ "to": [
21.6, 16.6,
102.0 102.0
], ],
"type": "ToPoint", "type": "TangentialArcTo",
"units": { "units": {
"type": "Mm" "type": "Mm"
} }
@ -445,7 +423,30 @@ description: Variables in memory after executing i_shape.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1389, 1389,
1448, 1431,
0
]
},
"from": [
16.6,
102.0
],
"tag": null,
"to": [
21.6,
102.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1437,
1496,
0 0
] ]
}, },
@ -472,8 +473,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1454, 1502,
1509, 1563,
0 0
] ]
}, },
@ -495,8 +496,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1515, 1569,
1575, 1629,
0 0
] ]
}, },
@ -523,8 +524,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1581, 1635,
1705, 1765,
0 0
] ]
}, },
@ -546,8 +547,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1711,
1771, 1771,
1831,
0 0
] ]
}, },
@ -574,8 +575,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1777, 1837,
1810, 1876,
0 0
] ]
}, },
@ -597,8 +598,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1816, 1882,
1875, 1941,
0 0
] ]
}, },
@ -625,8 +626,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1881, 1947,
1889, 1955,
0 0
] ]
}, },
@ -871,40 +872,18 @@ description: Variables in memory after executing i_shape.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
548, 548,
578,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
584, 584,
643,
0 0
], ],
"tag": null, "tag": null,
"type": "extrudeArc" "type": "extrudePlane"
}, },
{ {
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
590,
649, 649,
708,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
714,
773,
0 0
], ],
"tag": null, "tag": null,
@ -914,8 +893,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
779, 655,
831, 720,
0 0
], ],
"tag": null, "tag": null,
@ -925,8 +904,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
837, 726,
895, 785,
0 0
], ],
"tag": null, "tag": null,
@ -936,8 +915,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
901, 791,
937, 849,
0 0
], ],
"tag": null, "tag": null,
@ -947,8 +926,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
943, 855,
1001, 913,
0 0
], ],
"tag": null, "tag": null,
@ -958,8 +937,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1007, 919,
1037, 961,
0 0
], ],
"tag": null, "tag": null,
@ -969,8 +948,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1043, 967,
1102, 1025,
0 0
], ],
"tag": null, "tag": null,
@ -980,8 +959,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1108, 1031,
1171, 1067,
0 0
], ],
"tag": null, "tag": null,
@ -991,8 +970,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1177, 1073,
1237, 1132,
0 0
], ],
"tag": null, "tag": null,
@ -1002,8 +981,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1243, 1138,
1276, 1207,
0 0
], ],
"tag": null, "tag": null,
@ -1013,8 +992,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1282, 1213,
1341, 1273,
0 0
], ],
"tag": null, "tag": null,
@ -1024,30 +1003,30 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1347, 1279,
1318,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1324,
1383, 1383,
0 0
], ],
"tag": null, "tag": null,
"type": "extrudePlane" "type": "extrudeArc"
}, },
{ {
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1389, 1389,
1448, 1431,
0
],
"tag": null,
"type": "extrudeArc"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1454,
1509,
0 0
], ],
"tag": null, "tag": null,
@ -1057,8 +1036,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1515, 1437,
1575, 1496,
0 0
], ],
"tag": null, "tag": null,
@ -1068,8 +1047,30 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1581, 1502,
1705, 1563,
0
],
"tag": null,
"type": "extrudePlane"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1569,
1629,
0
],
"tag": null,
"type": "extrudeArc"
},
{
"faceId": "[uuid]",
"id": "[uuid]",
"sourceRange": [
1635,
1765,
0 0
], ],
"tag": null, "tag": null,
@ -1079,8 +1080,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1711,
1771, 1771,
1831,
0 0
], ],
"tag": null, "tag": null,
@ -1090,8 +1091,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1777, 1837,
1810, 1876,
0 0
], ],
"tag": null, "tag": null,
@ -1101,8 +1102,8 @@ description: Variables in memory after executing i_shape.kcl
"faceId": "[uuid]", "faceId": "[uuid]",
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1816, 1882,
1875, 1941,
0 0
], ],
"tag": null, "tag": null,
@ -1169,7 +1170,7 @@ description: Variables in memory after executing i_shape.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
548, 548,
578, 584,
0 0
] ]
}, },
@ -1191,8 +1192,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
584, 590,
643, 649,
0 0
] ]
}, },
@ -1219,8 +1220,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
649, 655,
708, 720,
0 0
] ]
}, },
@ -1242,8 +1243,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
714, 726,
773, 785,
0 0
] ]
}, },
@ -1270,8 +1271,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
779, 791,
831, 849,
0 0
] ]
}, },
@ -1293,8 +1294,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
837, 855,
895, 913,
0 0
] ]
}, },
@ -1321,8 +1322,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
901, 919,
937, 961,
0 0
] ]
}, },
@ -1344,8 +1345,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
943, 967,
1001, 1025,
0 0
] ]
}, },
@ -1372,8 +1373,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1007, 1031,
1037, 1067,
0 0
] ]
}, },
@ -1395,8 +1396,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1043, 1073,
1102, 1132,
0 0
] ]
}, },
@ -1423,8 +1424,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1108, 1138,
1171, 1207,
0 0
] ]
}, },
@ -1446,8 +1447,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1177, 1213,
1237, 1273,
0 0
] ]
}, },
@ -1474,8 +1475,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1243, 1279,
1276, 1318,
0 0
] ]
}, },
@ -1497,49 +1498,26 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1282, 1324,
1341,
0
]
},
"ccw": true,
"center": [
16.60000000000001,
107.0
],
"from": [
11.6,
107.0
],
"tag": null,
"to": [
16.6,
102.0
],
"type": "TangentialArcTo",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1347,
1383, 1383,
0 0
] ]
}, },
"ccw": true,
"center": [
16.60000000000001,
107.0
],
"from": [ "from": [
16.6, 11.6,
102.0 107.0
], ],
"tag": null, "tag": null,
"to": [ "to": [
21.6, 16.6,
102.0 102.0
], ],
"type": "ToPoint", "type": "TangentialArcTo",
"units": { "units": {
"type": "Mm" "type": "Mm"
} }
@ -1549,7 +1527,30 @@ description: Variables in memory after executing i_shape.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1389, 1389,
1448, 1431,
0
]
},
"from": [
16.6,
102.0
],
"tag": null,
"to": [
21.6,
102.0
],
"type": "ToPoint",
"units": {
"type": "Mm"
}
},
{
"__geoMeta": {
"id": "[uuid]",
"sourceRange": [
1437,
1496,
0 0
] ]
}, },
@ -1576,8 +1577,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1454, 1502,
1509, 1563,
0 0
] ]
}, },
@ -1599,8 +1600,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1515, 1569,
1575, 1629,
0 0
] ]
}, },
@ -1627,8 +1628,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1581, 1635,
1705, 1765,
0 0
] ]
}, },
@ -1650,8 +1651,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1711,
1771, 1771,
1831,
0 0
] ]
}, },
@ -1678,8 +1679,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1777, 1837,
1810, 1876,
0 0
] ]
}, },
@ -1701,8 +1702,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1816, 1882,
1875, 1941,
0 0
] ]
}, },
@ -1729,8 +1730,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1881, 1947,
1889, 1955,
0 0
] ]
}, },
@ -1865,8 +1866,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1926, 1992,
1939, 2011,
0 0
] ]
}, },
@ -1888,8 +1889,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1945, 2017,
2003, 2075,
0 0
] ]
}, },
@ -1916,8 +1917,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
2009, 2081,
2045, 2123,
0 0
] ]
}, },
@ -1939,8 +1940,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
2051, 2129,
2110, 2188,
0 0
] ]
}, },
@ -1967,8 +1968,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
2116, 2194,
2130, 2214,
0 0
] ]
}, },
@ -1990,8 +1991,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
2136, 2220,
2196, 2280,
0 0
] ]
}, },
@ -2018,8 +2019,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
2202, 2286,
2241, 2331,
0 0
] ]
}, },
@ -2041,8 +2042,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
2247, 2337,
2306, 2396,
0 0
] ]
}, },
@ -2069,8 +2070,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
2312, 2402,
2320, 2410,
0 0
] ]
}, },
@ -2135,8 +2136,8 @@ description: Variables in memory after executing i_shape.kcl
"__geoMeta": { "__geoMeta": {
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [ "sourceRange": [
1899, 1965,
1920, 1986,
0 0
] ]
} }
@ -2149,8 +2150,8 @@ description: Variables in memory after executing i_shape.kcl
"__meta": [ "__meta": [
{ {
"sourceRange": [ "sourceRange": [
1899, 1965,
1920, 1986,
0 0
] ]
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -363,7 +363,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
258, 258,
286, 292,
0 0
], ],
"command": { "command": {
@ -383,8 +383,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
292, 298,
355, 361,
0 0
], ],
"command": { "command": {
@ -404,8 +404,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
361, 367,
379, 394,
0 0
], ],
"command": { "command": {
@ -425,8 +425,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
385, 400,
410, 431,
0 0
], ],
"command": { "command": {
@ -446,8 +446,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
416, 437,
442, 472,
0 0
], ],
"command": { "command": {
@ -467,8 +467,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
448, 478,
547, 577,
0 0
], ],
"command": { "command": {
@ -488,8 +488,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
553, 583,
578, 614,
0 0
], ],
"command": { "command": {
@ -509,8 +509,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
584, 620,
662, 698,
0 0
], ],
"command": { "command": {
@ -530,8 +530,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
668, 704,
686, 731,
0 0
], ],
"command": { "command": {
@ -551,29 +551,29 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
692,
705,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 5.5,
"z": 0.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [
711,
737, 737,
759,
0
],
"command": {
"type": "extend_path",
"path": "[uuid]",
"segment": {
"type": "line",
"end": {
"x": 0.0,
"y": 5.5,
"z": 0.0
},
"relative": false
}
}
},
{
"cmdId": "[uuid]",
"range": [
765,
800,
0 0
], ],
"command": { "command": {
@ -593,8 +593,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
743, 806,
789, 852,
0 0
], ],
"command": { "command": {
@ -614,8 +614,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
795, 858,
803, 866,
0 0
], ],
"command": { "command": {
@ -626,8 +626,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
795, 858,
803, 866,
0 0
], ],
"command": { "command": {
@ -637,8 +637,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -665,8 +665,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -677,8 +677,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -690,8 +690,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -704,8 +704,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -718,8 +718,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -732,8 +732,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -746,8 +746,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -760,8 +760,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -774,8 +774,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -788,8 +788,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -802,8 +802,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -816,8 +816,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -830,8 +830,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -844,8 +844,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -858,8 +858,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -872,8 +872,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -886,8 +886,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -900,8 +900,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -914,8 +914,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -928,8 +928,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -942,8 +942,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -956,8 +956,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -970,8 +970,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -984,8 +984,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -998,8 +998,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -1012,8 +1012,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -1026,8 +1026,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -1040,8 +1040,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
814, 877,
952, 1015,
0 0
], ],
"command": { "command": {
@ -1054,8 +1054,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
966, 1029,
986, 1049,
0 0
], ],
"command": { "command": {
@ -1083,8 +1083,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
992, 1055,
1036, 1099,
0 0
], ],
"command": { "command": {
@ -1103,8 +1103,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
992, 1055,
1036, 1099,
0 0
], ],
"command": { "command": {
@ -1114,8 +1114,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
992, 1055,
1036, 1099,
0 0
], ],
"command": { "command": {
@ -1131,8 +1131,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1042, 1105,
1070, 1139,
0 0
], ],
"command": { "command": {
@ -1152,8 +1152,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1076, 1145,
1139, 1208,
0 0
], ],
"command": { "command": {
@ -1173,8 +1173,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1145, 1214,
1163, 1241,
0 0
], ],
"command": { "command": {
@ -1194,8 +1194,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1169, 1247,
1194, 1278,
0 0
], ],
"command": { "command": {
@ -1215,8 +1215,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1200, 1284,
1226, 1319,
0 0
], ],
"command": { "command": {
@ -1236,8 +1236,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1232, 1325,
1331, 1424,
0 0
], ],
"command": { "command": {
@ -1257,8 +1257,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1337, 1430,
1362, 1461,
0 0
], ],
"command": { "command": {
@ -1278,8 +1278,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1368, 1467,
1446, 1545,
0 0
], ],
"command": { "command": {
@ -1299,8 +1299,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1452, 1551,
1470, 1578,
0 0
], ],
"command": { "command": {
@ -1320,8 +1320,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1476, 1584,
1489, 1606,
0 0
], ],
"command": { "command": {
@ -1341,8 +1341,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1495, 1612,
1521, 1647,
0 0
], ],
"command": { "command": {
@ -1362,8 +1362,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1527, 1653,
1573, 1699,
0 0
], ],
"command": { "command": {
@ -1383,8 +1383,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1579, 1705,
1587, 1713,
0 0
], ],
"command": { "command": {
@ -1395,8 +1395,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1579, 1705,
1587, 1713,
0 0
], ],
"command": { "command": {
@ -1406,8 +1406,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1426,8 +1426,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1440,8 +1440,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1451,8 +1451,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1463,8 +1463,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1476,8 +1476,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1490,8 +1490,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1504,8 +1504,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1518,8 +1518,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1532,8 +1532,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1546,8 +1546,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1560,8 +1560,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1574,8 +1574,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1588,8 +1588,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1602,8 +1602,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1616,8 +1616,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1630,8 +1630,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1644,8 +1644,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1658,8 +1658,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1672,8 +1672,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1686,8 +1686,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1700,8 +1700,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1714,8 +1714,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1728,8 +1728,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1742,8 +1742,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1756,8 +1756,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1770,8 +1770,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1784,8 +1784,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1798,8 +1798,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1812,8 +1812,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {
@ -1826,8 +1826,8 @@ snapshot_kind: text
{ {
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
1593, 1719,
1631, 1757,
0 0
], ],
"command": { "command": {

View File

@ -2,40 +2,40 @@
flowchart LR flowchart LR
subgraph path2 [Path] subgraph path2 [Path]
2["Path<br>[208, 252, 0]"] 2["Path<br>[208, 252, 0]"]
3["Segment<br>[258, 286, 0]"] 3["Segment<br>[258, 292, 0]"]
4["Segment<br>[292, 355, 0]"] 4["Segment<br>[298, 361, 0]"]
5["Segment<br>[361, 379, 0]"] 5["Segment<br>[367, 394, 0]"]
6["Segment<br>[385, 410, 0]"] 6["Segment<br>[400, 431, 0]"]
7["Segment<br>[416, 442, 0]"] 7["Segment<br>[437, 472, 0]"]
8["Segment<br>[448, 547, 0]"] 8["Segment<br>[478, 577, 0]"]
9["Segment<br>[553, 578, 0]"] 9["Segment<br>[583, 614, 0]"]
10["Segment<br>[584, 662, 0]"] 10["Segment<br>[620, 698, 0]"]
11["Segment<br>[668, 686, 0]"] 11["Segment<br>[704, 731, 0]"]
12["Segment<br>[692, 705, 0]"] 12["Segment<br>[737, 759, 0]"]
13["Segment<br>[711, 737, 0]"] 13["Segment<br>[765, 800, 0]"]
14["Segment<br>[743, 789, 0]"] 14["Segment<br>[806, 852, 0]"]
15["Segment<br>[795, 803, 0]"] 15["Segment<br>[858, 866, 0]"]
16[Solid2d] 16[Solid2d]
end end
subgraph path60 [Path] subgraph path60 [Path]
60["Path<br>[992, 1036, 0]"] 60["Path<br>[1055, 1099, 0]"]
61["Segment<br>[1042, 1070, 0]"] 61["Segment<br>[1105, 1139, 0]"]
62["Segment<br>[1076, 1139, 0]"] 62["Segment<br>[1145, 1208, 0]"]
63["Segment<br>[1145, 1163, 0]"] 63["Segment<br>[1214, 1241, 0]"]
64["Segment<br>[1169, 1194, 0]"] 64["Segment<br>[1247, 1278, 0]"]
65["Segment<br>[1200, 1226, 0]"] 65["Segment<br>[1284, 1319, 0]"]
66["Segment<br>[1232, 1331, 0]"] 66["Segment<br>[1325, 1424, 0]"]
67["Segment<br>[1337, 1362, 0]"] 67["Segment<br>[1430, 1461, 0]"]
68["Segment<br>[1368, 1446, 0]"] 68["Segment<br>[1467, 1545, 0]"]
69["Segment<br>[1452, 1470, 0]"] 69["Segment<br>[1551, 1578, 0]"]
70["Segment<br>[1476, 1489, 0]"] 70["Segment<br>[1584, 1606, 0]"]
71["Segment<br>[1495, 1521, 0]"] 71["Segment<br>[1612, 1647, 0]"]
72["Segment<br>[1527, 1573, 0]"] 72["Segment<br>[1653, 1699, 0]"]
73["Segment<br>[1579, 1587, 0]"] 73["Segment<br>[1705, 1713, 0]"]
74[Solid2d] 74[Solid2d]
end end
1["Plane<br>[182, 202, 0]"] 1["Plane<br>[182, 202, 0]"]
17["Sweep Revolve<br>[814, 952, 0]"] 17["Sweep Revolve<br>[877, 1015, 0]"]
18[Wall] 18[Wall]
19[Wall] 19[Wall]
20[Wall] 20[Wall]
@ -77,8 +77,8 @@ flowchart LR
56["SweepEdge Adjacent"] 56["SweepEdge Adjacent"]
57["SweepEdge Opposite"] 57["SweepEdge Opposite"]
58["SweepEdge Adjacent"] 58["SweepEdge Adjacent"]
59["Plane<br>[966, 986, 0]"] 59["Plane<br>[1029, 1049, 0]"]
75["Sweep Extrusion<br>[1593, 1631, 0]"] 75["Sweep Extrusion<br>[1719, 1757, 0]"]
76[Wall] 76[Wall]
77[Wall] 77[Wall]
78[Wall] 78[Wall]

File diff suppressed because it is too large Load Diff

View File

@ -11,23 +11,23 @@ Fy = 0.5
sketch001 = startSketchOn('-YZ') sketch001 = startSketchOn('-YZ')
|> startProfileAt([back_walls_width / 2, 0], %) |> startProfileAt([back_walls_width / 2, 0], %)
|> xLine(wall_thickness / 2, %) |> xLine(length = wall_thickness / 2)
|> angledLineToX({ angle = 45, to = back_walls_width }, %, $seg01) |> angledLineToX({ angle = 45, to = back_walls_width }, %, $seg01)
|> yLineTo(height, %) |> yLine(endAbsolute = height)
|> xLine(-wall_thickness, %) |> xLine(length = -wall_thickness)
|> yLineTo(segEndY(seg01), %) |> yLine(endAbsolute = segEndY(seg01))
|> angledLineToX({ |> angledLineToX({
angle = 45, angle = 45,
to = back_walls_width / 2 + wall_thickness / 2 to = back_walls_width / 2 + wall_thickness / 2
}, %) }, %)
|> xLine(-wall_thickness, %) |> xLine(length = -wall_thickness)
|> angledLineToX({ |> angledLineToX({
angle = 180 - 45, angle = 180 - 45,
to = wall_thickness to = wall_thickness
}, %) }, %)
|> yLineTo(height, %) |> yLine(endAbsolute = height)
|> xLineTo(0, %) |> xLine(endAbsolute = 0)
|> yLineTo(segEndY(seg01), %) |> yLine(endAbsolute = segEndY(seg01))
|> angledLineToY({ angle = 180 - 45, to = 0 }, %) |> angledLineToY({ angle = 180 - 45, to = 0 }, %)
|> close(%) |> close(%)
part001 = revolve({ part001 = revolve({
@ -42,23 +42,23 @@ part001 = revolve({
sketch002 = startSketchOn('-YZ') sketch002 = startSketchOn('-YZ')
|> startProfileAt([back_walls_width / 2, 0], %) |> startProfileAt([back_walls_width / 2, 0], %)
|> xLine(wall_thickness / 2, %) |> xLine(length = wall_thickness / 2)
|> angledLineToX({ angle = 45, to = back_walls_width }, %, $seg02) |> angledLineToX({ angle = 45, to = back_walls_width }, %, $seg02)
|> yLineTo(height, %) |> yLine(endAbsolute = height)
|> xLine(-wall_thickness, %) |> xLine(length = -wall_thickness)
|> yLineTo(segEndY(seg01), %) |> yLine(endAbsolute = segEndY(seg01))
|> angledLineToX({ |> angledLineToX({
angle = 45, angle = 45,
to = back_walls_width / 2 + wall_thickness / 2 to = back_walls_width / 2 + wall_thickness / 2
}, %) }, %)
|> xLine(-wall_thickness, %) |> xLine(length = -wall_thickness)
|> angledLineToX({ |> angledLineToX({
angle = 180 - 45, angle = 180 - 45,
to = wall_thickness to = wall_thickness
}, %) }, %)
|> yLineTo(height, %) |> yLine(endAbsolute = height)
|> xLineTo(0, %) |> xLine(endAbsolute = 0)
|> yLineTo(segEndY(seg02), %) |> yLine(endAbsolute = segEndY(seg02))
|> angledLineToY({ angle = 180 - 45, to = 0 }, %) |> angledLineToY({ angle = 180 - 45, to = 0 }, %)
|> close(%) |> close(%)
|> extrude(length = back_length - height) |> extrude(length = back_length - height)

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed poop_chute.kcl description: Operations executed poop_chute.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -120,8 +121,8 @@ description: Operations executed poop_chute.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
822, 885,
940, 1003,
0 0
] ]
}, },
@ -133,16 +134,16 @@ description: Operations executed poop_chute.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
942, 1005,
951, 1014,
0 0
] ]
} }
}, },
"name": "revolve", "name": "revolve",
"sourceRange": [ "sourceRange": [
814, 877,
952, 1015,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -156,16 +157,16 @@ description: Operations executed poop_chute.kcl
"value": "-YZ" "value": "-YZ"
}, },
"sourceRange": [ "sourceRange": [
980, 1043,
985, 1048,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
966, 1029,
986, 1049,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -188,16 +189,16 @@ description: Operations executed poop_chute.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
1610, 1736,
1630, 1756,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
1593, 1719,
1631, 1757,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,21 +2,21 @@
flowchart LR flowchart LR
subgraph path2 [Path] subgraph path2 [Path]
2["Path<br>[37, 71, 0]"] 2["Path<br>[37, 71, 0]"]
3["Segment<br>[77, 91, 0]"] 3["Segment<br>[77, 97, 0]"]
4["Segment<br>[97, 122, 0]"] 4["Segment<br>[103, 128, 0]"]
5["Segment<br>[128, 161, 0]"] 5["Segment<br>[134, 167, 0]"]
6["Segment<br>[167, 183, 0]"] 6["Segment<br>[173, 195, 0]"]
7["Segment<br>[189, 259, 0]"] 7["Segment<br>[201, 271, 0]"]
8["Segment<br>[265, 272, 0]"] 8["Segment<br>[277, 284, 0]"]
9[Solid2d] 9[Solid2d]
end end
subgraph path28 [Path] subgraph path28 [Path]
28["Path<br>[370, 421, 0]"] 28["Path<br>[382, 433, 0]"]
29["Segment<br>[370, 421, 0]"] 29["Segment<br>[382, 433, 0]"]
30[Solid2d] 30[Solid2d]
end end
1["Plane<br>[12, 31, 0]"] 1["Plane<br>[12, 31, 0]"]
10["Sweep Extrusion<br>[287, 318, 0]"] 10["Sweep Extrusion<br>[299, 330, 0]"]
11[Wall] 11[Wall]
12[Wall] 12[Wall]
13[Wall] 13[Wall]
@ -34,7 +34,7 @@ flowchart LR
25["SweepEdge Adjacent"] 25["SweepEdge Adjacent"]
26["SweepEdge Opposite"] 26["SweepEdge Opposite"]
27["SweepEdge Adjacent"] 27["SweepEdge Adjacent"]
31["Sweep Extrusion<br>[611, 632, 0]"] 31["Sweep Extrusion<br>[623, 644, 0]"]
32[Wall] 32[Wall]
33["SweepEdge Opposite"] 33["SweepEdge Opposite"]
34["SweepEdge Adjacent"] 34["SweepEdge Adjacent"]

View File

@ -1,13 +1,14 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing ssi_pattern.kcl description: Result of parsing ssi_pattern.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {
"body": [ "body": [
{ {
"declaration": { "declaration": {
"end": 272, "end": 284,
"id": { "id": {
"end": 9, "end": 9,
"name": "sketch001", "name": "sketch001",
@ -105,21 +106,22 @@ description: Result of parsing ssi_pattern.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 87, "type": "LabeledArg",
"raw": "10.2", "label": {
"start": 83, "type": "Identifier",
"type": "Literal", "name": "length"
"type": "Literal", },
"value": { "arg": {
"value": 10.2, "end": 96,
"suffix": "None" "raw": "10.2",
"start": 92,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.2,
"suffix": "None"
}
} }
},
{
"end": 90,
"start": 89,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
@ -128,10 +130,11 @@ description: Result of parsing ssi_pattern.kcl
"start": 77, "start": 77,
"type": "Identifier" "type": "Identifier"
}, },
"end": 91, "end": 97,
"start": 77, "start": 77,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
}, },
{ {
"arguments": [ "arguments": [
@ -144,9 +147,9 @@ description: Result of parsing ssi_pattern.kcl
"arg": { "arg": {
"elements": [ "elements": [
{ {
"end": 113, "end": 119,
"raw": "0.54", "raw": "0.54",
"start": 109, "start": 115,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -156,9 +159,9 @@ description: Result of parsing ssi_pattern.kcl
}, },
{ {
"argument": { "argument": {
"end": 120, "end": 126,
"raw": "0.03", "raw": "0.03",
"start": 116, "start": 122,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -166,28 +169,28 @@ description: Result of parsing ssi_pattern.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"end": 120, "end": 126,
"operator": "-", "operator": "-",
"start": 115, "start": 121,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
} }
], ],
"end": 121, "end": 127,
"start": 108, "start": 114,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 101, "end": 107,
"name": "line", "name": "line",
"start": 97, "start": 103,
"type": "Identifier" "type": "Identifier"
}, },
"end": 122, "end": 128,
"start": 97, "start": 103,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -197,9 +200,9 @@ description: Result of parsing ssi_pattern.kcl
{ {
"elements": [ "elements": [
{ {
"end": 149, "end": 155,
"raw": "20.4", "raw": "20.4",
"start": 145, "start": 151,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -208,9 +211,9 @@ description: Result of parsing ssi_pattern.kcl
} }
}, },
{ {
"end": 156, "end": 162,
"raw": "14.61", "raw": "14.61",
"start": 151, "start": 157,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -219,66 +222,68 @@ description: Result of parsing ssi_pattern.kcl
} }
} }
], ],
"end": 157, "end": 163,
"start": 144, "start": 150,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"end": 160, "end": 166,
"start": 159, "start": 165,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 143, "end": 149,
"name": "tangentialArcTo", "name": "tangentialArcTo",
"start": 128, "start": 134,
"type": "Identifier" "type": "Identifier"
}, },
"end": 161, "end": 167,
"start": 128, "start": 134,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
{ {
"arguments": [ "arguments": [
{ {
"argument": { "type": "LabeledArg",
"end": 179, "label": {
"raw": "26.76", "type": "Identifier",
"start": 174, "name": "length"
"type": "Literal",
"type": "Literal",
"value": {
"value": 26.76,
"suffix": "None"
}
}, },
"end": 179, "arg": {
"operator": "-", "argument": {
"start": 173, "end": 194,
"type": "UnaryExpression", "raw": "26.76",
"type": "UnaryExpression" "start": 189,
}, "type": "Literal",
{ "type": "Literal",
"end": 182, "value": {
"start": 181, "value": 26.76,
"type": "PipeSubstitution", "suffix": "None"
"type": "PipeSubstitution" }
},
"end": 194,
"operator": "-",
"start": 188,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
} }
], ],
"callee": { "callee": {
"end": 172, "end": 178,
"name": "yLine", "name": "yLine",
"start": 167, "start": 173,
"type": "Identifier" "type": "Identifier"
}, },
"end": 183, "end": 195,
"start": 167, "start": 173,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
}, },
{ {
"arguments": [ "arguments": [
@ -293,46 +298,46 @@ description: Result of parsing ssi_pattern.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 224, "end": 236,
"start": 223, "start": 235,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 222, "end": 234,
"name": "profileStartX", "name": "profileStartX",
"start": 209, "start": 221,
"type": "Identifier" "type": "Identifier"
}, },
"end": 225, "end": 237,
"start": 209, "start": 221,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
{ {
"arguments": [ "arguments": [
{ {
"end": 242, "end": 254,
"start": 241, "start": 253,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 240, "end": 252,
"name": "profileStartY", "name": "profileStartY",
"start": 227, "start": 239,
"type": "Identifier" "type": "Identifier"
}, },
"end": 243, "end": 255,
"start": 227, "start": 239,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 244, "end": 256,
"start": 208, "start": 220,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
@ -344,8 +349,8 @@ description: Result of parsing ssi_pattern.kcl
"name": "tag" "name": "tag"
}, },
"arg": { "arg": {
"end": 258, "end": 270,
"start": 252, "start": 264,
"type": "TagDeclarator", "type": "TagDeclarator",
"type": "TagDeclarator", "type": "TagDeclarator",
"value": "seg01" "value": "seg01"
@ -353,13 +358,13 @@ description: Result of parsing ssi_pattern.kcl
} }
], ],
"callee": { "callee": {
"end": 193, "end": 205,
"name": "line", "name": "line",
"start": 189, "start": 201,
"type": "Identifier" "type": "Identifier"
}, },
"end": 259, "end": 271,
"start": 189, "start": 201,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -367,18 +372,18 @@ description: Result of parsing ssi_pattern.kcl
{ {
"arguments": [], "arguments": [],
"callee": { "callee": {
"end": 270, "end": 282,
"name": "close", "name": "close",
"start": 265, "start": 277,
"type": "Identifier" "type": "Identifier"
}, },
"end": 272, "end": 284,
"start": 265, "start": 277,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"end": 272, "end": 284,
"start": 12, "start": 12,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -386,7 +391,7 @@ description: Result of parsing ssi_pattern.kcl
"start": 0, "start": 0,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 272, "end": 284,
"kind": "const", "kind": "const",
"start": 0, "start": 0,
"type": "VariableDeclaration", "type": "VariableDeclaration",
@ -394,11 +399,11 @@ description: Result of parsing ssi_pattern.kcl
}, },
{ {
"declaration": { "declaration": {
"end": 318, "end": 330,
"id": { "id": {
"end": 284, "end": 296,
"name": "extrude001", "name": "extrude001",
"start": 274, "start": 286,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
@ -410,9 +415,9 @@ description: Result of parsing ssi_pattern.kcl
"name": "length" "name": "length"
}, },
"arg": { "arg": {
"end": 317, "end": 329,
"raw": "50", "raw": "50",
"start": 315, "start": 327,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -423,39 +428,39 @@ description: Result of parsing ssi_pattern.kcl
} }
], ],
"callee": { "callee": {
"end": 294, "end": 306,
"name": "extrude", "name": "extrude",
"start": 287, "start": 299,
"type": "Identifier" "type": "Identifier"
}, },
"end": 318, "end": 330,
"start": 287, "start": 299,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": { "unlabeled": {
"end": 304, "end": 316,
"name": "sketch001", "name": "sketch001",
"start": 295, "start": 307,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
}, },
"start": 274, "start": 286,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 318, "end": 330,
"kind": "const", "kind": "const",
"start": 274, "start": 286,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"declaration": { "declaration": {
"end": 632, "end": 644,
"id": { "id": {
"end": 329, "end": 341,
"name": "sketch002", "name": "sketch002",
"start": 320, "start": 332,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
@ -463,53 +468,53 @@ description: Result of parsing ssi_pattern.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 356, "end": 368,
"name": "extrude001", "name": "extrude001",
"start": 346, "start": 358,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
{ {
"end": 363, "end": 375,
"name": "seg01", "name": "seg01",
"start": 358, "start": 370,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
} }
], ],
"callee": { "callee": {
"end": 345, "end": 357,
"name": "startSketchOn", "name": "startSketchOn",
"start": 332, "start": 344,
"type": "Identifier" "type": "Identifier"
}, },
"end": 364, "end": 376,
"start": 332, "start": 344,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
{ {
"arguments": [ "arguments": [
{ {
"end": 417, "end": 429,
"properties": [ "properties": [
{ {
"end": 401, "end": 413,
"key": { "key": {
"end": 385, "end": 397,
"name": "center", "name": "center",
"start": 379, "start": 391,
"type": "Identifier" "type": "Identifier"
}, },
"start": 379, "start": 391,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"elements": [ "elements": [
{ {
"argument": { "argument": {
"end": 394, "end": 406,
"raw": "2.08", "raw": "2.08",
"start": 390, "start": 402,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -517,16 +522,16 @@ description: Result of parsing ssi_pattern.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"end": 394, "end": 406,
"operator": "-", "operator": "-",
"start": 389, "start": 401,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
}, },
{ {
"end": 400, "end": 412,
"raw": "47.7", "raw": "47.7",
"start": 396, "start": 408,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -535,26 +540,26 @@ description: Result of parsing ssi_pattern.kcl
} }
} }
], ],
"end": 401, "end": 413,
"start": 388, "start": 400,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
}, },
{ {
"end": 415, "end": 427,
"key": { "key": {
"end": 409, "end": 421,
"name": "radius", "name": "radius",
"start": 403, "start": 415,
"type": "Identifier" "type": "Identifier"
}, },
"start": 403, "start": 415,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"end": 415, "end": 427,
"raw": "1.4", "raw": "1.4",
"start": 412, "start": 424,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -564,25 +569,25 @@ description: Result of parsing ssi_pattern.kcl
} }
} }
], ],
"start": 377, "start": 389,
"type": "ObjectExpression", "type": "ObjectExpression",
"type": "ObjectExpression" "type": "ObjectExpression"
}, },
{ {
"end": 420, "end": 432,
"start": 419, "start": 431,
"type": "PipeSubstitution", "type": "PipeSubstitution",
"type": "PipeSubstitution" "type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 376, "end": 388,
"name": "circle", "name": "circle",
"start": 370, "start": 382,
"type": "Identifier" "type": "Identifier"
}, },
"end": 421, "end": 433,
"start": 370, "start": 382,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
@ -595,9 +600,9 @@ description: Result of parsing ssi_pattern.kcl
"name": "instances" "name": "instances"
}, },
"arg": { "arg": {
"end": 456, "end": 468,
"raw": "5", "raw": "5",
"start": 455, "start": 467,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -613,9 +618,9 @@ description: Result of parsing ssi_pattern.kcl
"name": "distance" "name": "distance"
}, },
"arg": { "arg": {
"end": 470, "end": 482,
"raw": "5", "raw": "5",
"start": 469, "start": 481,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -633,9 +638,9 @@ description: Result of parsing ssi_pattern.kcl
"arg": { "arg": {
"elements": [ "elements": [
{ {
"end": 481, "end": 493,
"raw": "1", "raw": "1",
"start": 480, "start": 492,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -644,9 +649,9 @@ description: Result of parsing ssi_pattern.kcl
} }
}, },
{ {
"end": 484, "end": 496,
"raw": "0", "raw": "0",
"start": 483, "start": 495,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -655,21 +660,21 @@ description: Result of parsing ssi_pattern.kcl
} }
} }
], ],
"end": 485, "end": 497,
"start": 479, "start": 491,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 442, "end": 454,
"name": "patternLinear2d", "name": "patternLinear2d",
"start": 427, "start": 439,
"type": "Identifier" "type": "Identifier"
}, },
"end": 486, "end": 498,
"start": 427, "start": 439,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -683,9 +688,9 @@ description: Result of parsing ssi_pattern.kcl
"name": "instances" "name": "instances"
}, },
"arg": { "arg": {
"end": 574, "end": 586,
"raw": "6", "raw": "6",
"start": 573, "start": 585,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -701,9 +706,9 @@ description: Result of parsing ssi_pattern.kcl
"name": "distance" "name": "distance"
}, },
"arg": { "arg": {
"end": 588, "end": 600,
"raw": "4", "raw": "4",
"start": 587, "start": 599,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -721,9 +726,9 @@ description: Result of parsing ssi_pattern.kcl
"arg": { "arg": {
"elements": [ "elements": [
{ {
"end": 599, "end": 611,
"raw": "0", "raw": "0",
"start": 598, "start": 610,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -733,9 +738,9 @@ description: Result of parsing ssi_pattern.kcl
}, },
{ {
"argument": { "argument": {
"end": 603, "end": 615,
"raw": "1", "raw": "1",
"start": 602, "start": 614,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -743,28 +748,28 @@ description: Result of parsing ssi_pattern.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"end": 603, "end": 615,
"operator": "-", "operator": "-",
"start": 601, "start": 613,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
} }
], ],
"end": 604, "end": 616,
"start": 597, "start": 609,
"type": "ArrayExpression", "type": "ArrayExpression",
"type": "ArrayExpression" "type": "ArrayExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 560, "end": 572,
"name": "patternLinear2d", "name": "patternLinear2d",
"start": 545, "start": 557,
"type": "Identifier" "type": "Identifier"
}, },
"end": 605, "end": 617,
"start": 545, "start": 557,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
@ -779,9 +784,9 @@ description: Result of parsing ssi_pattern.kcl
}, },
"arg": { "arg": {
"argument": { "argument": {
"end": 631, "end": 643,
"raw": "40", "raw": "40",
"start": 629, "start": 641,
"type": "Literal", "type": "Literal",
"type": "Literal", "type": "Literal",
"value": { "value": {
@ -789,34 +794,34 @@ description: Result of parsing ssi_pattern.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"end": 631, "end": 643,
"operator": "-", "operator": "-",
"start": 628, "start": 640,
"type": "UnaryExpression", "type": "UnaryExpression",
"type": "UnaryExpression" "type": "UnaryExpression"
} }
} }
], ],
"callee": { "callee": {
"end": 618, "end": 630,
"name": "extrude", "name": "extrude",
"start": 611, "start": 623,
"type": "Identifier" "type": "Identifier"
}, },
"end": 632, "end": 644,
"start": 611, "start": 623,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": null "unlabeled": null
} }
], ],
"end": 632, "end": 644,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"2": [ "2": [
{ {
"end": 539, "end": 551,
"start": 488, "start": 500,
"type": "NonCodeNode", "type": "NonCodeNode",
"value": { "value": {
"type": "blockComment", "type": "blockComment",
@ -828,27 +833,27 @@ description: Result of parsing ssi_pattern.kcl
}, },
"startNodes": [] "startNodes": []
}, },
"start": 332, "start": 344,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
}, },
"start": 320, "start": 332,
"type": "VariableDeclarator" "type": "VariableDeclarator"
}, },
"end": 632, "end": 644,
"kind": "const", "kind": "const",
"start": 320, "start": 332,
"type": "VariableDeclaration", "type": "VariableDeclaration",
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"end": 633, "end": 645,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"0": [ "0": [
{ {
"end": 274, "end": 286,
"start": 272, "start": 284,
"type": "NonCodeNode", "type": "NonCodeNode",
"value": { "value": {
"type": "newLine" "type": "newLine"
@ -857,8 +862,8 @@ description: Result of parsing ssi_pattern.kcl
], ],
"1": [ "1": [
{ {
"end": 320, "end": 332,
"start": 318, "start": 330,
"type": "NonCodeNode", "type": "NonCodeNode",
"value": { "value": {
"type": "newLine" "type": "newLine"

View File

@ -1,9 +1,9 @@
sketch001 = startSketchOn('XZ') sketch001 = startSketchOn('XZ')
|> startProfileAt([-4.35, -12.26], %) |> startProfileAt([-4.35, -12.26], %)
|> yLine(10.2, %) |> yLine(length = 10.2)
|> line(end = [0.54, -0.03]) |> line(end = [0.54, -0.03])
|> tangentialArcTo([20.4, 14.61], %) |> tangentialArcTo([20.4, 14.61], %)
|> yLine(-26.76, %) |> yLine(length = -26.76)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01)
|> close() |> close()

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Operations executed ssi_pattern.kcl description: Operations executed ssi_pattern.kcl
snapshot_kind: text
--- ---
[ [
{ {
@ -43,16 +44,16 @@ description: Operations executed ssi_pattern.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
315, 327,
317, 329,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
287, 299,
318, 330,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -64,8 +65,8 @@ description: Operations executed ssi_pattern.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
295, 307,
304, 316,
0 0
] ]
} }
@ -80,8 +81,8 @@ description: Operations executed ssi_pattern.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
346, 358,
356, 368,
0 0
] ]
}, },
@ -92,16 +93,16 @@ description: Operations executed ssi_pattern.kcl
"artifact_id": "[uuid]" "artifact_id": "[uuid]"
}, },
"sourceRange": [ "sourceRange": [
358, 370,
363, 375,
0 0
] ]
} }
}, },
"name": "startSketchOn", "name": "startSketchOn",
"sourceRange": [ "sourceRange": [
332, 344,
364, 376,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",
@ -124,16 +125,16 @@ description: Operations executed ssi_pattern.kcl
} }
}, },
"sourceRange": [ "sourceRange": [
628, 640,
631, 643,
0 0
] ]
} }
}, },
"name": "extrude", "name": "extrude",
"sourceRange": [ "sourceRange": [
611, 623,
632, 644,
0 0
], ],
"type": "StdLibCall", "type": "StdLibCall",

File diff suppressed because it is too large Load Diff

View File

@ -444,7 +444,7 @@ snapshot_kind: text
"cmdId": "[uuid]", "cmdId": "[uuid]",
"range": [ "range": [
443, 443,
456, 465,
0 0
], ],
"command": { "command": {

View File

@ -6,7 +6,7 @@ flowchart LR
4["Segment<br>[191, 252, 0]"] 4["Segment<br>[191, 252, 0]"]
5["Segment<br>[258, 344, 0]"] 5["Segment<br>[258, 344, 0]"]
6["Segment<br>[350, 437, 0]"] 6["Segment<br>[350, 437, 0]"]
7["Segment<br>[443, 456, 0]"] 7["Segment<br>[443, 465, 0]"]
end end
1["Plane<br>[64, 83, 0]"] 1["Plane<br>[64, 83, 0]"]
1 --- 2 1 --- 2

View File

@ -1,6 +1,7 @@
--- ---
source: kcl/src/simulation_tests.rs source: kcl/src/simulation_tests.rs
description: Result of parsing tan_arc_x_line.kcl description: Result of parsing tan_arc_x_line.kcl
snapshot_kind: text
--- ---
{ {
"Ok": { "Ok": {
@ -151,7 +152,7 @@ description: Result of parsing tan_arc_x_line.kcl
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"end": 456, "end": 465,
"expression": { "expression": {
"body": [ "body": [
{ {
@ -545,36 +546,38 @@ description: Result of parsing tan_arc_x_line.kcl
{ {
"arguments": [ "arguments": [
{ {
"end": 452, "type": "LabeledArg",
"raw": "1", "label": {
"start": 451, "type": "Identifier",
"type": "Literal", "name": "endAbsolute"
"type": "Literal", },
"value": { "arg": {
"value": 1.0, "end": 464,
"suffix": "None" "raw": "1",
"start": 463,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
} }
},
{
"end": 455,
"start": 454,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
} }
], ],
"callee": { "callee": {
"end": 450, "end": 448,
"name": "xLineTo", "name": "xLine",
"start": 443, "start": 443,
"type": "Identifier" "type": "Identifier"
}, },
"end": 456, "end": 465,
"start": 443, "start": 443,
"type": "CallExpression", "type": "CallExpressionKw",
"type": "CallExpression" "type": "CallExpressionKw",
"unlabeled": null
} }
], ],
"end": 456, "end": 465,
"start": 64, "start": 64,
"type": "PipeExpression", "type": "PipeExpression",
"type": "PipeExpression" "type": "PipeExpression"
@ -584,7 +587,7 @@ description: Result of parsing tan_arc_x_line.kcl
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"end": 457, "end": 466,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"4": [ "4": [

View File

@ -16,4 +16,4 @@ startSketchOn('XY')
offset = -angleOffset, offset = -angleOffset,
radius = 0.5 * r radius = 0.5 * r
}, %, $arc3) }, %, $arc3)
|> xLineTo(1, %) |> xLine(endAbsolute = 1)

View File

@ -10,38 +10,38 @@ let corner_radius = 5.0
let brace_base = startSketchAt([corner_radius, 0]) let brace_base = startSketchAt([corner_radius, 0])
|> line(end = [width - corner_radius, 0.0]) |> line(end = [width - corner_radius, 0.0])
|> tangentialArcToRelative([corner_radius, corner_radius], %) |> tangentialArcToRelative([corner_radius, corner_radius], %)
|> yLine(25.0 - corner_radius, %) |> yLine(length = 25.0 - corner_radius)
|> tangentialArcToRelative([-corner_radius, corner_radius], %) |> tangentialArcToRelative([-corner_radius, corner_radius], %)
|> xLine(-(d_wrist_circumference[0] - (corner_radius * 2)), %) |> xLine(length = -(d_wrist_circumference[0] - (corner_radius * 2)))
|> tangentialArcToRelative([-corner_radius, corner_radius], %) |> tangentialArcToRelative([-corner_radius, corner_radius], %)
|> yLine(length - 25.0 - 23.0 - (corner_radius * 2), %) |> yLine(length = length - 25.0 - 23.0 - (corner_radius * 2))
|> tangentialArcToRelative([corner_radius, corner_radius], %) |> tangentialArcToRelative([corner_radius, corner_radius], %)
|> xLine(15.0 - (corner_radius * 2), %) |> xLine(length = 15.0 - (corner_radius * 2))
|> tangentialArcToRelative([corner_radius, corner_radius], %) |> tangentialArcToRelative([corner_radius, corner_radius], %)
|> yLine(23.0 - corner_radius, %) |> yLine(length = 23.0 - corner_radius)
|> tangentialArcToRelative([-corner_radius, corner_radius], %) |> tangentialArcToRelative([-corner_radius, corner_radius], %)
|> xLine(-(hand_thickness + 15.0 + 15.0 - (corner_radius * 2)), %) |> xLine(length = -(hand_thickness + 15.0 + 15.0 - (corner_radius * 2)))
|> tangentialArcToRelative([-corner_radius, -corner_radius], %) |> tangentialArcToRelative([-corner_radius, -corner_radius], %)
|> yLine(-(23.0 - corner_radius), %) |> yLine(length = -(23.0 - corner_radius))
|> tangentialArcToRelative([corner_radius, -corner_radius], %) |> tangentialArcToRelative([corner_radius, -corner_radius], %)
|> xLine(15.0 - (corner_radius * 2), %) |> xLine(length = 15.0 - (corner_radius * 2))
|> tangentialArcToRelative([corner_radius, -corner_radius], %) |> tangentialArcToRelative([corner_radius, -corner_radius], %)
|> yLine(-(length - 25.0 - 23.0 - (corner_radius * 2)), %) |> yLine(length = -(length - 25.0 - 23.0 - (corner_radius * 2)))
|> tangentialArcToRelative([-corner_radius, -corner_radius], %) |> tangentialArcToRelative([-corner_radius, -corner_radius], %)
|> xLine(-(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius), %) |> xLine(length = -(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius))
|> tangentialArcToRelative([-corner_radius, -corner_radius], %) |> tangentialArcToRelative([-corner_radius, -corner_radius], %)
|> yLine(-(25.0 - corner_radius), %) |> yLine(length = -(25.0 - corner_radius))
|> tangentialArcToRelative([corner_radius, -corner_radius], %) |> tangentialArcToRelative([corner_radius, -corner_radius], %)
|> close() |> close()
let inner = startSketchAt([0, 0]) let inner = startSketchAt([0, 0])
|> xLine(1.0, %) |> xLine(length = 1.0)
|> tangentialArcToRelative([corner_radius, corner_radius], %) |> tangentialArcToRelative([corner_radius, corner_radius], %)
|> yLine(25.0 - (corner_radius * 2), %) |> yLine(length = 25.0 - (corner_radius * 2))
|> tangentialArcToRelative([-corner_radius, corner_radius], %) |> tangentialArcToRelative([-corner_radius, corner_radius], %)
|> xLine(-1.0, %) |> xLine(length = -1.0)
|> tangentialArcToRelative([-corner_radius, -corner_radius], %) |> tangentialArcToRelative([-corner_radius, -corner_radius], %)
|> yLine(-(25.0 - (corner_radius * 2)), %) |> yLine(length = -(25.0 - (corner_radius * 2)))
|> tangentialArcToRelative([corner_radius, -corner_radius], %) |> tangentialArcToRelative([corner_radius, -corner_radius], %)
|> close() |> close()

View File

@ -11,20 +11,20 @@ Fy = 0.5
sketch001 = startSketchOn('-YZ') sketch001 = startSketchOn('-YZ')
|> startProfileAt([back_walls_width / 2, 0], %) |> startProfileAt([back_walls_width / 2, 0], %)
|> xLine(wall_thickness / 2, %) |> xLine(length = wall_thickness / 2)
|> angledLineToX({ angle: 45, to: back_walls_width }, %, $seg01) |> angledLineToX({ angle: 45, to: back_walls_width }, %, $seg01)
|> yLineTo(height, %) |> yLine(endAbsolute = height)
|> xLine(-wall_thickness, %) |> xLine(length = -wall_thickness)
|> yLineTo(segEndY(seg01), %) |> yLine(endAbsolute = segEndY(seg01))
|> angledLineToX({ |> angledLineToX({
angle: 45, angle: 45,
to: back_walls_width / 2 + wall_thickness / 2 to: back_walls_width / 2 + wall_thickness / 2
}, %) }, %)
|> xLine(-wall_thickness, %) |> xLine(length = -wall_thickness)
|> angledLineToX({ angle: 180 - 45, to: wall_thickness }, %) |> angledLineToX({ angle: 180 - 45, to: wall_thickness }, %)
|> yLineTo(height, %) |> yLine(endAbsolute = height)
|> xLineTo(0, %) |> xLine(endAbsolute = 0)
|> yLineTo(segEndY(seg01), %) |> yLine(endAbsolute = segEndY(seg01))
|> angledLineToY({ angle: 180 - 45, to: 0 }, %) |> angledLineToY({ angle: 180 - 45, to: 0 }, %)
|> close() |> close()
part001 = revolve({ part001 = revolve({
@ -39,20 +39,20 @@ part001 = revolve({
sketch002 = startSketchOn('-YZ') sketch002 = startSketchOn('-YZ')
|> startProfileAt([back_walls_width / 2, 0], %) |> startProfileAt([back_walls_width / 2, 0], %)
|> xLine(wall_thickness / 2, %) |> xLine(length = wall_thickness / 2)
|> angledLineToX({ angle: 45, to: back_walls_width }, %, $seg02) |> angledLineToX({ angle: 45, to: back_walls_width }, %, $seg02)
|> yLineTo(height, %) |> yLine(endAbsolute = height)
|> xLine(-wall_thickness, %) |> xLine(length = -wall_thickness)
|> yLineTo(segEndY(seg01), %) |> yLine(endAbsolute = segEndY(seg01))
|> angledLineToX({ |> angledLineToX({
angle: 45, angle: 45,
to: back_walls_width / 2 + wall_thickness / 2 to: back_walls_width / 2 + wall_thickness / 2
}, %) }, %)
|> xLine(-wall_thickness, %) |> xLine(length = -wall_thickness)
|> angledLineToX({ angle: 180 - 45, to: wall_thickness }, %) |> angledLineToX({ angle: 180 - 45, to: wall_thickness }, %)
|> yLineTo(height, %) |> yLine(endAbsolute = height)
|> xLineTo(0, %) |> xLine(endAbsolute = 0)
|> yLineTo(segEndY(seg02), %) |> yLine(endAbsolute = segEndY(seg02))
|> angledLineToY({ angle: 180 - 45, to: 0 }, %) |> angledLineToY({ angle: 180 - 45, to: 0 }, %)
|> close() |> close()
|> extrude(length = back_length - height) |> extrude(length = back_length - height)

View File

@ -11,20 +11,20 @@ const length001 = slateWidthHalf - radius
const length002 = depth + minClampingDistance const length002 = depth + minClampingDistance
const sketch001 = startSketchOn('XZ') const sketch001 = startSketchOn('XZ')
|> startProfileAt([0, depth - templateGap], %) |> startProfileAt([0, depth - templateGap], %)
|> xLine(length001, %, $seg01) |> xLine(length = length001, tag = $seg01)
|> arc({ |> arc({
angleEnd: 0, angleEnd: 0,
angleStart: 90, angleStart: 90,
radius: radius - templateGap radius: radius - templateGap
}, %) }, %)
|> yLineTo(-templateGap * 2 - (templateDiameter / 2), %, $seg05) |> yLine(endAbsolute = -templateGap * 2 - (templateDiameter / 2), tag = $seg05)
|> xLineTo(slateWidthHalf + templateThickness, %, $seg04) |> xLineTo(endAbsolute = slateWidthHalf + templateThickness, tag = $seg04)
|> yLine(-length002, %, $seg03) |> yLine(length = -length002, tag = $seg03)
|> xLineTo(0, %, $seg02) |> xLineTo(endAbsolute = 0, tag = $seg02)
|> xLine(-segLen(seg02, %), %) |> xLine(length = length = -segLen(seg02))
|> yLine(segLen(seg03, %), %) |> yLine(length = segLen(seg03, %))
|> xLine(segLen(seg04, %), %) |> xLine(length = length = segLen(seg04))
|> yLine(segLen(seg05, %), %) |> yLine(length = segLen(seg05, %))
|> arc({ |> arc({
angleEnd: 90, angleEnd: 90,
angleStart: 180, angleStart: 180,
@ -38,7 +38,7 @@ const sketch002 = startSketchOn(extrude001, 'START')
-slateWidthHalf, -slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2) -templateGap * 2 - (templateDiameter / 2)
], %) ], %)
|> xLine(-7, %, $rectangleSegmentA001) |> xLine(length = -7, tag = $rectangleSegmentA001)
|> angledLine([ |> angledLine([
segAng(rectangleSegmentA001, %) + 90, segAng(rectangleSegmentA001, %) + 90,
minClampingDistance minClampingDistance
@ -55,7 +55,7 @@ const sketch003 = startSketchOn(extrude001, 'START')
slateWidthHalf, slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2) -templateGap * 2 - (templateDiameter / 2)
], %) ], %)
|> xLine(7, %, $rectangleSegmentA002) |> xLine(length = 7, tag = $rectangleSegmentA002)
|> angledLine([ |> angledLine([
segAng(rectangleSegmentA002, %) - 90, segAng(rectangleSegmentA002, %) - 90,
minClampingDistance minClampingDistance

View File

@ -25,9 +25,9 @@ fn caster = (originStart) => {
const sketch001c = startSketchOn(plane001c) const sketch001c = startSketchOn(plane001c)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(3.543, %) |> xLine(length = 3.543)
|> yLine(3.543, %) |> yLine(length = 3.543)
|> xLine(-3.543, %) |> xLine(length = -3.543)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
|> hole(circle({ center: [ |> hole(circle({ center: [
@ -110,21 +110,21 @@ const plane001 = {
const sketch001l = startSketchOn(plane001) const sketch001l = startSketchOn(plane001)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(serverDepth + .8, %) |> xLine(length = serverDepth + .8)
|> angledLineToY({ angle: -45, to: 1 }, %) |> angledLineToY({ angle: -45, to: 1 }, %)
|> xLine(-serverDepth + 2 - .8, %, $seg01) |> xLine(length = -serverDepth + 2 - .8, tag = $seg01)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude001l = extrude(sketch001l, length = 1) const extrude001l = extrude(sketch001l, length = 1)
const sketch002l = startSketchOn(plane001) const sketch002l = startSketchOn(plane001)
|> startProfileAt([serverDepth + .8, 0], %) |> startProfileAt([serverDepth + .8, 0], %)
|> yLine(railHeight * 1.75 + 2, %) |> yLine(length = railHeight * 1.75 + 2)
|> angledLineToX({ |> angledLineToX({
angle: -135, angle: -135,
to: serverDepth - 1 + .8 to: serverDepth - 1 + .8
}, %) }, %)
|> yLine(-railHeight * 1.75, %) |> yLine(length = -railHeight * 1.75)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude002l = extrude(sketch002l, length = 1) const extrude002l = extrude(sketch002l, length = 1)
@ -134,24 +134,24 @@ const sketch003l = startSketchOn(plane001)
serverDepth + .8, serverDepth + .8,
railHeight * 1.75 + 2 railHeight * 1.75 + 2
], %) ], %)
|> xLine(-serverDepth - .8, %, $seg02) |> xLine(length = -serverDepth - .8, tag = $seg02)
|> angledLineToY({ |> angledLineToY({
angle: -45, angle: -45,
to: railHeight * 1.75 - 1 + 2 to: railHeight * 1.75 - 1 + 2
}, %) }, %)
|> xLine(serverDepth - 2 + .8, %) |> xLine(length = serverDepth - 2 + .8)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude003l = extrude(sketch003l, length = 1) const extrude003l = extrude(sketch003l, length = 1)
const sketch004l = startSketchOn(plane001) const sketch004l = startSketchOn(plane001)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLine(railHeight * 1.75 + 2, %) |> yLine(length = railHeight * 1.75 + 2)
|> angledLineToY({ |> angledLineToY({
angle: 135, angle: 135,
to: railHeight * 1.75 + 2 - 1 to: railHeight * 1.75 + 2 - 1
}, %) }, %)
|> yLine(-railHeight * 1.75, %) |> yLine(length = -railHeight * 1.75)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude004l = extrude(sketch004l, length = 1) const extrude004l = extrude(sketch004l, length = 1)
@ -159,7 +159,7 @@ const extrude004l = extrude(sketch004l, length = 1)
const sketch005l = startSketchOn(plane001) const sketch005l = startSketchOn(plane001)
|> startProfileAt([serverDepth - 1.25, 1], %) |> startProfileAt([serverDepth - 1.25, 1], %)
|> line(end = [-serverDepth + 2.25, railHeight * 1.75], tag = $lineToIntersect4) |> line(end = [-serverDepth + 2.25, railHeight * 1.75], tag = $lineToIntersect4)
|> xLine(1, %) |> xLine(length = 1)
|> line(end = [serverDepth - 2.25, -railHeight * 1.75], tag = $lineToIntersect5) |> line(end = [serverDepth - 2.25, -railHeight * 1.75], tag = $lineToIntersect5)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -213,42 +213,42 @@ const plane002 = {
const sketch001w = startSketchOn(plane002) const sketch001w = startSketchOn(plane002)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(depth, %) |> xLine(length = depth)
|> angledLineToY({ angle: -45, to: 1 }, %) |> angledLineToY({ angle: -45, to: 1 }, %)
|> xLine(-depth + 2, %, $seg01w) |> xLine(length = -depth + 2, tag = $seg01w)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude001w = extrude(sketch001w, length = 1) const extrude001w = extrude(sketch001w, length = 1)
const sketch002w = startSketchOn(plane002) const sketch002w = startSketchOn(plane002)
|> startProfileAt([depth, 0], %) |> startProfileAt([depth, 0], %)
|> yLine(railHeight * 1.75 + 2, %) |> yLine(length = railHeight * 1.75 + 2)
|> angledLineToX({ angle: -135, to: depth - 1 }, %) |> angledLineToX({ angle: -135, to: depth - 1 }, %)
|> yLine(-railHeight * 1.75, %) |> yLine(length = -railHeight * 1.75)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude002w = extrude(sketch002w, length = 1) const extrude002w = extrude(sketch002w, length = 1)
const sketch003w = startSketchOn(plane002) const sketch003w = startSketchOn(plane002)
|> startProfileAt([depth, railHeight * 1.75 + 2], %) |> startProfileAt([depth, railHeight * 1.75 + 2], %)
|> xLine(-depth, %, $seg02w) |> xLine(length = -depth, tag = $seg02w)
|> angledLineToY({ |> angledLineToY({
angle: -45, angle: -45,
to: railHeight * 1.75 - 1 + 2 to: railHeight * 1.75 - 1 + 2
}, %) }, %)
|> xLine(depth - 2, %) |> xLine(length = depth - 2)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude003w = extrude(sketch003w, length = 1) const extrude003w = extrude(sketch003w, length = 1)
const sketch004w = startSketchOn(plane002) const sketch004w = startSketchOn(plane002)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLine(railHeight * 1.75 + 2, %) |> yLine(length = railHeight * 1.75 + 2)
|> angledLineToY({ |> angledLineToY({
angle: 135, angle: 135,
to: railHeight * 1.75 + 2 - 1 to: railHeight * 1.75 + 2 - 1
}, %) }, %)
|> yLine(-railHeight * 1.75, %) |> yLine(length = -railHeight * 1.75)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude004w = extrude(sketch004w, length = 1) const extrude004w = extrude(sketch004w, length = 1)
@ -268,7 +268,7 @@ const sketch006w = startSketchOn(plane002)
40.6 - (35.5 * sin(23 * pi() / 180)) + 1.75 / 2 40.6 - (35.5 * sin(23 * pi() / 180)) + 1.75 / 2
], %) ], %)
|> angledLineToX({ angle: -23 + 90, to: depth - 1 }, %) |> angledLineToX({ angle: -23 + 90, to: depth - 1 }, %)
|> yLine(2.56, %) |> yLine(length = 2.56)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle: -23 + 90 + 180, angle: -23 + 90 + 180,
intersectTag: lineToIntersect, intersectTag: lineToIntersect,
@ -357,7 +357,7 @@ const sketch013w = startSketchOn(plane002)
], %) ], %)
|> angledLine({ angle: -23, length: 1 }, %) |> angledLine({ angle: -23, length: 1 }, %)
|> angledLineToX({ angle: -23 + 90, to: 1 }, %) |> angledLineToX({ angle: -23 + 90, to: 1 }, %)
|> yLine(2.56, %) |> yLine(length = 2.56)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude013w = extrude(sketch013w, length = 1) const extrude013w = extrude(sketch013w, length = 1)
@ -462,7 +462,7 @@ const extrude020w = extrude(sketch020w, length = 1)
const sketch021w = startSketchOn(plane002) const sketch021w = startSketchOn(plane002)
|> startProfileAt([1, 21.9], %) |> startProfileAt([1, 21.9], %)
|> angledLineToX({ angle: -23, to: depth - 1 }, %) |> angledLineToX({ angle: -23, to: depth - 1 }, %)
|> yLine(-1.1, %) |> yLine(length = -1.1)
|> angledLineToX({ angle: -23, to: 1 }, %) |> angledLineToX({ angle: -23, to: 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -474,7 +474,7 @@ const sketch022w = startSketchOn(plane002)
angle: 180 - 23, angle: 180 - 23,
to: railHeight * 1.75 + 1 to: railHeight * 1.75 + 1
}, %) }, %)
|> xLine(-2.56, %) |> xLine(length = -2.56)
|> angledLineToX({ angle: -23, to: depth - 1 }, %) |> angledLineToX({ angle: -23, to: depth - 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -486,7 +486,7 @@ const sketch023w = startSketchOn(plane002)
angle: 90 - 23, angle: 90 - 23,
to: railHeight * 1.75 + 1 to: railHeight * 1.75 + 1
}, %) }, %)
|> xLine(1.086, %) |> xLine(length = 1.086)
|> angledLineToX({ angle: 90 - 23, to: 1 }, %) |> angledLineToX({ angle: 90 - 23, to: 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -495,7 +495,7 @@ const extrude023w = extrude(sketch023w, length = 1)
const sketch024w = startSketchOn(plane002) const sketch024w = startSketchOn(plane002)
|> startProfileAt([1, 16.5], %) |> startProfileAt([1, 16.5], %)
|> angledLineToY({ angle: -23, to: 1 }, %) |> angledLineToY({ angle: -23, to: 1 }, %)
|> xLine(-2.56, %) |> xLine(length = -2.56)
|> angledLineToX({ angle: -23, to: 1 }, %) |> angledLineToX({ angle: -23, to: 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -504,7 +504,7 @@ const extrude024w = extrude(sketch024w, length = 1)
const sketch025w = startSketchOn(plane002) const sketch025w = startSketchOn(plane002)
|> startProfileAt([1, 4], %) |> startProfileAt([1, 4], %)
|> angledLineToY({ angle: -23, to: 1 }, %) |> angledLineToY({ angle: -23, to: 1 }, %)
|> xLine(-2.56, %) |> xLine(length = -2.56)
|> angledLineToX({ angle: -23, to: 1 }, %) |> angledLineToX({ angle: -23, to: 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -685,13 +685,13 @@ const sketch003fl = startSketchOn(planeXYfl)
angleEnd: 180, angleEnd: 180,
radius: bendRad + thickness radius: bendRad + thickness
}, %) }, %)
|> xLine(thickness, %) |> xLine(length = thickness)
|> arc({ |> arc({
angleStart: 180, angleStart: 180,
angleEnd: 270, angleEnd: 270,
radius: bendRad radius: bendRad
}, %) }, %)
|> yLine(-thickness, %) |> yLine(length = -thickness)
|> close() |> close()
const extrude003fl = extrude(sketch003fl, length = railHeight * 1.75) const extrude003fl = extrude(sketch003fl, length = railHeight * 1.75)
@ -834,9 +834,9 @@ const sketch010fl = startSketchOn(extrude001fl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + .81 - (.438 / 2) originStart[2] + .81 - (.438 / 2)
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([-0.66 - originStart[0],originStart[2] + .81 + .438 / 2], %) |> tangentialArcTo([-0.66 - originStart[0],originStart[2] + .81 + .438 / 2], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -852,12 +852,12 @@ const sketch011fl = startSketchOn(extrude001fl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 + .438 / 2 originStart[2] + railHeight * 1.75 / 2 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0],originStart[2]+ -0.66 - originStart[0],originStart[2]+
railHeight * 1.75 / 2 - (.438 / 2) railHeight * 1.75 / 2 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
@ -869,12 +869,12 @@ const sketch012fl = startSketchOn(extrude001fl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], originStart[2] + -1.12 + (.75 - .438) / 2 - originStart[0], originStart[2] +
railHeight * 1.75 - .81 + .438 / 2 railHeight * 1.75 - .81 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], originStart[2]+ -0.66 - originStart[0], originStart[2]+
railHeight * 1.75 - .81 - (.438 / 2) railHeight * 1.75 - .81 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -965,7 +965,7 @@ const sketch003fr = startSketchOn(planeXYfr)
angleEnd: -90, angleEnd: -90,
radius: bendRad radius: bendRad
}, %) }, %)
|> yLine(-thickness, %) |> yLine(length = -thickness)
|> arc({ |> arc({
angleStart: -90, angleStart: -90,
angleEnd: 0, angleEnd: 0,
@ -1125,12 +1125,12 @@ const sketch010fr = startSketchOn(extrude001fr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + .81 - (.438 / 2) originStart[2] + .81 - (.438 / 2)
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], -0.66 - originStart[0],
originStart[2] + .81 + .438 / 2 originStart[2] + .81 + .438 / 2
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1146,12 +1146,12 @@ const sketch011fr = startSketchOn(extrude001fr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 + .438 / 2 originStart[2] + railHeight * 1.75 / 2 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], -0.66 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 - (.438 / 2) originStart[2] + railHeight * 1.75 / 2 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
@ -1163,12 +1163,12 @@ const sketch012fr = startSketchOn(extrude001fr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 - .81 + .438 / 2 originStart[2] + railHeight * 1.75 - .81 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], -0.66 - originStart[0],
originStart[2] + railHeight * 1.75 - .81 - (.438 / 2) originStart[2] + railHeight * 1.75 - .81 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1259,7 +1259,7 @@ const sketch003rr = startSketchOn(planeXYrr)
angleEnd: 90, angleEnd: 90,
radius: bendRad+thickness radius: bendRad+thickness
}, %) }, %)
|> yLine(-thickness, %) |> yLine(length = -thickness)
|> arc({ |> arc({
angleStart: 90, angleStart: 90,
angleEnd: 0, angleEnd: 0,
@ -1419,12 +1419,12 @@ const sketch010rr = startSketchOn(extrude001rr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0]+1.5-serverDepth, -1.12 + (.75 - .438) / 2 - originStart[0]+1.5-serverDepth,
originStart[2] + .81 - (.438 / 2) originStart[2] + .81 - (.438 / 2)
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0]+1.5-serverDepth, -0.66 - originStart[0]+1.5-serverDepth,
originStart[2] + .81 + .438 / 2 originStart[2] + .81 + .438 / 2
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1440,12 +1440,12 @@ const sketch011rr = startSketchOn(extrude001rr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0]+1.5-serverDepth, -1.12 + (.75 - .438) / 2 - originStart[0]+1.5-serverDepth,
originStart[2] + railHeight * 1.75 / 2 + .438 / 2 originStart[2] + railHeight * 1.75 / 2 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0]+1.5-serverDepth, -0.66 - originStart[0]+1.5-serverDepth,
originStart[2] + railHeight * 1.75 / 2 - (.438 / 2) originStart[2] + railHeight * 1.75 / 2 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
@ -1457,12 +1457,12 @@ const sketch012rr = startSketchOn(extrude001rr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0]+1.5-serverDepth, -1.12 + (.75 - .438) / 2 - originStart[0]+1.5-serverDepth,
originStart[2] + railHeight * 1.75 - .81 + .438 / 2 originStart[2] + railHeight * 1.75 - .81 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0]+1.5-serverDepth, -0.66 - originStart[0]+1.5-serverDepth,
originStart[2] + railHeight * 1.75 - .81 - (.438 / 2) originStart[2] + railHeight * 1.75 - .81 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1552,7 +1552,7 @@ const sketch003rl = startSketchOn(planeXYrl)
angleEnd: 180, angleEnd: 180,
radius: bendRad radius: bendRad
}, %) }, %)
|> xLine(-thickness, %) |> xLine(length = -thickness)
|> arc({ |> arc({
angleStart: 180, angleStart: 180,
angleEnd: 90, angleEnd: 90,
@ -1712,12 +1712,12 @@ const sketch010rl = startSketchOn(extrude001rl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5, -1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + .81 - (.438 / 2) originStart[2] + .81 - (.438 / 2)
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0] - serverDepth + 1.5, -0.66 - originStart[0] - serverDepth + 1.5,
originStart[2] + .81 + .438 / 2 originStart[2] + .81 + .438 / 2
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1733,12 +1733,12 @@ const sketch011rl = startSketchOn(extrude001rl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5, -1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 / 2 + .438 / 2 originStart[2] + railHeight * 1.75 / 2 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0] - serverDepth + 1.5, -0.66 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 / 2 - (.438 / 2) originStart[2] + railHeight * 1.75 / 2 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
@ -1750,12 +1750,12 @@ const sketch012rl = startSketchOn(extrude001rl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5, -1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 - .81 + .438 / 2 originStart[2] + railHeight * 1.75 - .81 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0] - serverDepth + 1.5, -0.66 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 - .81 - (.438 / 2) originStart[2] + railHeight * 1.75 - .81 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1808,23 +1808,23 @@ fn streamServer = (serverPos) => {
const sketch002s = startSketchOn(planeXZs) const sketch002s = startSketchOn(planeXZs)
|> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %) |> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %)
|> yLine(6.98, %) |> yLine(length = 6.98)
|> xLine(0.2, %) |> xLine(length = 0.2)
|> yLine(-0.36, %) |> yLine(length = -0.36)
|> xLine(0.5, %) |> xLine(length = 0.5)
|> tangentialArcTo([ |> tangentialArcTo([
0.3, 0.3,
17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114 17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114
], %) ], %)
|> yLine(-1.77, %) |> yLine(length = -1.77)
|> tangentialArcTo([ |> tangentialArcTo([
-0.13, -0.13,
14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114 14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114
], %) ], %)
|> xLine(-0.52, %) |> xLine(length = -0.52)
|> yLine(-0.42, %) |> yLine(length = -0.42)
|> line(end = [0.34, -0.15]) |> line(end = [0.34, -0.15])
|> yLine(-2.97, %) |> yLine(length = -2.97)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -1832,23 +1832,23 @@ fn streamServer = (serverPos) => {
const sketch003s = startSketchOn(planeXZs2) const sketch003s = startSketchOn(planeXZs2)
|> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %) |> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %)
|> yLine(6.98, %) |> yLine(length = 6.98)
|> xLine(0.2, %) |> xLine(length = 0.2)
|> yLine(-0.36, %) |> yLine(length = -0.36)
|> xLine(0.5, %) |> xLine(length = 0.5)
|> tangentialArcTo([ |> tangentialArcTo([
0.3, 0.3,
17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114 17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114
], %) ], %)
|> yLine(-1.77, %) |> yLine(length = -1.77)
|> tangentialArcTo([ |> tangentialArcTo([
-0.13, -0.13,
14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114 14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114
], %) ], %)
|> xLine(-0.52, %) |> xLine(length = -0.52)
|> yLine(-0.42, %) |> yLine(length = -0.42)
|> line(end = [0.34, -0.15]) |> line(end = [0.34, -0.15])
|> yLine(-2.97, %) |> yLine(length = -2.97)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()

View File

@ -23,9 +23,9 @@ fn caster = (originStart) => {
const sketch001c = startSketchOn(plane001c) const sketch001c = startSketchOn(plane001c)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(3.543, %) |> xLine(length = 3.543)
|> yLine(3.543, %) |> yLine(length = 3.543)
|> xLine(-3.543, %) |> xLine(length = -3.543)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
|> hole(circle({ center: [ |> hole(circle({ center: [
@ -108,21 +108,21 @@ const plane001 = {
const sketch001l = startSketchOn(plane001) const sketch001l = startSketchOn(plane001)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(serverDepth + .8, %) |> xLine(length = serverDepth + .8)
|> angledLineToY({ angle: -45, to: 1 }, %) |> angledLineToY({ angle: -45, to: 1 }, %)
|> xLine(-serverDepth + 2 - .8, %, $seg01) |> xLine(length = -serverDepth + 2 - .8, tag = $seg01)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude001l = extrude(sketch001l, length = 1) const extrude001l = extrude(sketch001l, length = 1)
const sketch002l = startSketchOn(plane001) const sketch002l = startSketchOn(plane001)
|> startProfileAt([serverDepth + .8, 0], %) |> startProfileAt([serverDepth + .8, 0], %)
|> yLine(railHeight * 1.75 + 2, %) |> yLine(length = railHeight * 1.75 + 2)
|> angledLineToX({ |> angledLineToX({
angle: -135, angle: -135,
to: serverDepth - 1 + .8 to: serverDepth - 1 + .8
}, %) }, %)
|> yLine(-railHeight * 1.75, %) |> yLine(length = -railHeight * 1.75)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude002l = extrude(sketch002l, length = 1) const extrude002l = extrude(sketch002l, length = 1)
@ -132,24 +132,24 @@ const sketch003l = startSketchOn(plane001)
serverDepth + .8, serverDepth + .8,
railHeight * 1.75 + 2 railHeight * 1.75 + 2
], %) ], %)
|> xLine(-serverDepth - .8, %, $seg02) |> xLine(length = -serverDepth - .8, tag = $seg02)
|> angledLineToY({ |> angledLineToY({
angle: -45, angle: -45,
to: railHeight * 1.75 - 1 + 2 to: railHeight * 1.75 - 1 + 2
}, %) }, %)
|> xLine(serverDepth - 2 + .8, %) |> xLine(length = serverDepth - 2 + .8)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude003l = extrude(sketch003l, length = 1) const extrude003l = extrude(sketch003l, length = 1)
const sketch004l = startSketchOn(plane001) const sketch004l = startSketchOn(plane001)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLine(railHeight * 1.75 + 2, %) |> yLine(length = railHeight * 1.75 + 2)
|> angledLineToY({ |> angledLineToY({
angle: 135, angle: 135,
to: railHeight * 1.75 + 2 - 1 to: railHeight * 1.75 + 2 - 1
}, %) }, %)
|> yLine(-railHeight * 1.75, %) |> yLine(length = -railHeight * 1.75)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude004l = extrude(sketch004l, length = 1) const extrude004l = extrude(sketch004l, length = 1)
@ -157,7 +157,7 @@ const extrude004l = extrude(sketch004l, length = 1)
const sketch005l = startSketchOn(plane001) const sketch005l = startSketchOn(plane001)
|> startProfileAt([serverDepth - 1.25, 1], %) |> startProfileAt([serverDepth - 1.25, 1], %)
|> line(end = [-serverDepth + 2.25, railHeight * 1.75], tag = $lineToIntersect4) |> line(end = [-serverDepth + 2.25, railHeight * 1.75], tag = $lineToIntersect4)
|> xLine(1, %) |> xLine(length = 1)
|> line(end = [serverDepth - 2.25, -railHeight * 1.75], tag = $lineToIntersect5) |> line(end = [serverDepth - 2.25, -railHeight * 1.75], tag = $lineToIntersect5)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -211,42 +211,42 @@ const plane002 = {
const sketch001w = startSketchOn(plane002) const sketch001w = startSketchOn(plane002)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> xLine(depth, %) |> xLine(length = depth)
|> angledLineToY({ angle: -45, to: 1 }, %) |> angledLineToY({ angle: -45, to: 1 }, %)
|> xLine(-depth + 2, %, $seg01w) |> xLine(length = -depth + 2, tag = $seg01w)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude001w = extrude(sketch001w, length = 1) const extrude001w = extrude(sketch001w, length = 1)
const sketch002w = startSketchOn(plane002) const sketch002w = startSketchOn(plane002)
|> startProfileAt([depth, 0], %) |> startProfileAt([depth, 0], %)
|> yLine(railHeight * 1.75 + 2, %) |> yLine(length = railHeight * 1.75 + 2)
|> angledLineToX({ angle: -135, to: depth - 1 }, %) |> angledLineToX({ angle: -135, to: depth - 1 }, %)
|> yLine(-railHeight * 1.75, %) |> yLine(length = -railHeight * 1.75)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude002w = extrude(sketch002w, length = 1) const extrude002w = extrude(sketch002w, length = 1)
const sketch003w = startSketchOn(plane002) const sketch003w = startSketchOn(plane002)
|> startProfileAt([depth, railHeight * 1.75 + 2], %) |> startProfileAt([depth, railHeight * 1.75 + 2], %)
|> xLine(-depth, %, $seg02w) |> xLine(length = -depth, tag = $seg02w)
|> angledLineToY({ |> angledLineToY({
angle: -45, angle: -45,
to: railHeight * 1.75 - 1 + 2 to: railHeight * 1.75 - 1 + 2
}, %) }, %)
|> xLine(depth - 2, %) |> xLine(length = depth - 2)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude003w = extrude(sketch003w, length = 1) const extrude003w = extrude(sketch003w, length = 1)
const sketch004w = startSketchOn(plane002) const sketch004w = startSketchOn(plane002)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> yLine(railHeight * 1.75 + 2, %) |> yLine(length = railHeight * 1.75 + 2)
|> angledLineToY({ |> angledLineToY({
angle: 135, angle: 135,
to: railHeight * 1.75 + 2 - 1 to: railHeight * 1.75 + 2 - 1
}, %) }, %)
|> yLine(-railHeight * 1.75, %) |> yLine(length = -railHeight * 1.75)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude004w = extrude(sketch004w, length = 1) const extrude004w = extrude(sketch004w, length = 1)
@ -266,7 +266,7 @@ const sketch006w = startSketchOn(plane002)
40.6 - (35.5 * sin(23 * pi() / 180)) + 1.75 / 2 40.6 - (35.5 * sin(23 * pi() / 180)) + 1.75 / 2
], %) ], %)
|> angledLineToX({ angle: -23 + 90, to: depth - 1 }, %) |> angledLineToX({ angle: -23 + 90, to: depth - 1 }, %)
|> yLine(2.56, %) |> yLine(length = 2.56)
|> angledLineThatIntersects({ |> angledLineThatIntersects({
angle: -23 + 90 + 180, angle: -23 + 90 + 180,
intersectTag: lineToIntersect, intersectTag: lineToIntersect,
@ -355,7 +355,7 @@ const sketch013w = startSketchOn(plane002)
], %) ], %)
|> angledLine({ angle: -23, length: 1 }, %) |> angledLine({ angle: -23, length: 1 }, %)
|> angledLineToX({ angle: -23 + 90, to: 1 }, %) |> angledLineToX({ angle: -23 + 90, to: 1 }, %)
|> yLine(2.56, %) |> yLine(length = 2.56)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
const extrude013w = extrude(sketch013w, length = 1) const extrude013w = extrude(sketch013w, length = 1)
@ -460,7 +460,7 @@ const extrude020w = extrude(sketch020w, length = 1)
const sketch021w = startSketchOn(plane002) const sketch021w = startSketchOn(plane002)
|> startProfileAt([1, 21.9], %) |> startProfileAt([1, 21.9], %)
|> angledLineToX({ angle: -23, to: depth - 1 }, %) |> angledLineToX({ angle: -23, to: depth - 1 }, %)
|> yLine(-1.1, %) |> yLine(length = -1.1)
|> angledLineToX({ angle: -23, to: 1 }, %) |> angledLineToX({ angle: -23, to: 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -472,7 +472,7 @@ const sketch022w = startSketchOn(plane002)
angle: 180 - 23, angle: 180 - 23,
to: railHeight * 1.75 + 1 to: railHeight * 1.75 + 1
}, %) }, %)
|> xLine(-2.56, %) |> xLine(length = -2.56)
|> angledLineToX({ angle: -23, to: depth - 1 }, %) |> angledLineToX({ angle: -23, to: depth - 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -484,7 +484,7 @@ const sketch023w = startSketchOn(plane002)
angle: 90 - 23, angle: 90 - 23,
to: railHeight * 1.75 + 1 to: railHeight * 1.75 + 1
}, %) }, %)
|> xLine(1.086, %) |> xLine(length = 1.086)
|> angledLineToX({ angle: 90 - 23, to: 1 }, %) |> angledLineToX({ angle: 90 - 23, to: 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -493,7 +493,7 @@ const extrude023w = extrude(sketch023w, length = 1)
const sketch024w = startSketchOn(plane002) const sketch024w = startSketchOn(plane002)
|> startProfileAt([1, 16.5], %) |> startProfileAt([1, 16.5], %)
|> angledLineToY({ angle: -23, to: 1 }, %) |> angledLineToY({ angle: -23, to: 1 }, %)
|> xLine(-2.56, %) |> xLine(length = -2.56)
|> angledLineToX({ angle: -23, to: 1 }, %) |> angledLineToX({ angle: -23, to: 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -502,7 +502,7 @@ const extrude024w = extrude(sketch024w, length = 1)
const sketch025w = startSketchOn(plane002) const sketch025w = startSketchOn(plane002)
|> startProfileAt([1, 4], %) |> startProfileAt([1, 4], %)
|> angledLineToY({ angle: -23, to: 1 }, %) |> angledLineToY({ angle: -23, to: 1 }, %)
|> xLine(-2.56, %) |> xLine(length = -2.56)
|> angledLineToX({ angle: -23, to: 1 }, %) |> angledLineToX({ angle: -23, to: 1 }, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -694,13 +694,13 @@ const sketch003fl = startSketchOn(planeXYfl)
angleEnd: 180, angleEnd: 180,
radius: bendRad + thickness radius: bendRad + thickness
}, %) }, %)
|> xLine(thickness, %) |> xLine(length = thickness)
|> arc({ |> arc({
angleStart: 180, angleStart: 180,
angleEnd: 270, angleEnd: 270,
radius: bendRad radius: bendRad
}, %) }, %)
|> yLine(-thickness, %) |> yLine(length = -thickness)
|> close() |> close()
const extrude003fl = extrude(sketch003fl, length = railHeight * 1.75) const extrude003fl = extrude(sketch003fl, length = railHeight * 1.75)
@ -711,12 +711,12 @@ const sketch010fl = startSketchOn(extrude001fl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + .81 - (.438 / 2) originStart[2] + .81 - (.438 / 2)
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], -0.66 - originStart[0],
originStart[2] + .81 + .438 / 2 originStart[2] + .81 + .438 / 2
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -732,12 +732,12 @@ const sketch011fl = startSketchOn(extrude001fl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 + .438 / 2 originStart[2] + railHeight * 1.75 / 2 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], -0.66 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 - (.438 / 2) originStart[2] + railHeight * 1.75 / 2 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
@ -749,12 +749,12 @@ const sketch012fl = startSketchOn(extrude001fl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 - .81 + .438 / 2 originStart[2] + railHeight * 1.75 - .81 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], -0.66 - originStart[0],
originStart[2] + railHeight * 1.75 - .81 - (.438 / 2) originStart[2] + railHeight * 1.75 - .81 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -845,7 +845,7 @@ const sketch003fr = startSketchOn(planeXYfr)
angleEnd: -90, angleEnd: -90,
radius: bendRad radius: bendRad
}, %) }, %)
|> yLine(-thickness, %) |> yLine(length = -thickness)
|> arc({ |> arc({
angleStart: -90, angleStart: -90,
angleEnd: 0, angleEnd: 0,
@ -861,12 +861,12 @@ const sketch010fr = startSketchOn(extrude001fr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + .81 - (.438 / 2) originStart[2] + .81 - (.438 / 2)
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], -0.66 - originStart[0],
originStart[2] + .81 + .438 / 2 originStart[2] + .81 + .438 / 2
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -882,12 +882,12 @@ const sketch011fr = startSketchOn(extrude001fr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 + .438 / 2 originStart[2] + railHeight * 1.75 / 2 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], -0.66 - originStart[0],
originStart[2] + railHeight * 1.75 / 2 - (.438 / 2) originStart[2] + railHeight * 1.75 / 2 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
@ -899,12 +899,12 @@ const sketch012fr = startSketchOn(extrude001fr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0], -1.12 + (.75 - .438) / 2 - originStart[0],
originStart[2] + railHeight * 1.75 - .81 + .438 / 2 originStart[2] + railHeight * 1.75 - .81 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0], -0.66 - originStart[0],
originStart[2] + railHeight * 1.75 - .81 - (.438 / 2) originStart[2] + railHeight * 1.75 - .81 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -995,7 +995,7 @@ const sketch003rr = startSketchOn(planeXYrr)
angleEnd: 90, angleEnd: 90,
radius: bendRad + thickness radius: bendRad + thickness
}, %) }, %)
|> yLine(-thickness, %) |> yLine(length = -thickness)
|> arc({ |> arc({
angleStart: 90, angleStart: 90,
angleEnd: 0, angleEnd: 0,
@ -1011,12 +1011,12 @@ const sketch010rr = startSketchOn(extrude001rr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0] + 1.5 - serverDepth, -1.12 + (.75 - .438) / 2 - originStart[0] + 1.5 - serverDepth,
originStart[2] + .81 - (.438 / 2) originStart[2] + .81 - (.438 / 2)
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0] + 1.5 - serverDepth, -0.66 - originStart[0] + 1.5 - serverDepth,
originStart[2] + .81 + .438 / 2 originStart[2] + .81 + .438 / 2
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1032,12 +1032,12 @@ const sketch011rr = startSketchOn(extrude001rr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0] + 1.5 - serverDepth, -1.12 + (.75 - .438) / 2 - originStart[0] + 1.5 - serverDepth,
originStart[2] + railHeight * 1.75 / 2 + .438 / 2 originStart[2] + railHeight * 1.75 / 2 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0] + 1.5 - serverDepth, -0.66 - originStart[0] + 1.5 - serverDepth,
originStart[2] + railHeight * 1.75 / 2 - (.438 / 2) originStart[2] + railHeight * 1.75 / 2 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
@ -1049,12 +1049,12 @@ const sketch012rr = startSketchOn(extrude001rr, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0] + 1.5 - serverDepth, -1.12 + (.75 - .438) / 2 - originStart[0] + 1.5 - serverDepth,
originStart[2] + railHeight * 1.75 - .81 + .438 / 2 originStart[2] + railHeight * 1.75 - .81 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0] + 1.5 - serverDepth, -0.66 - originStart[0] + 1.5 - serverDepth,
originStart[2] + railHeight * 1.75 - .81 - (.438 / 2) originStart[2] + railHeight * 1.75 - .81 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1144,7 +1144,7 @@ const sketch003rl = startSketchOn(planeXYrl)
angleEnd: 180, angleEnd: 180,
radius: bendRad radius: bendRad
}, %) }, %)
|> xLine(-thickness, %) |> xLine(length = -thickness)
|> arc({ |> arc({
angleStart: 180, angleStart: 180,
angleEnd: 90, angleEnd: 90,
@ -1160,12 +1160,12 @@ const sketch010rl = startSketchOn(extrude001rl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5, -1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + .81 - (.438 / 2) originStart[2] + .81 - (.438 / 2)
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0] - serverDepth + 1.5, -0.66 - originStart[0] - serverDepth + 1.5,
originStart[2] + .81 + .438 / 2 originStart[2] + .81 + .438 / 2
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1181,12 +1181,12 @@ const sketch011rl = startSketchOn(extrude001rl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5, -1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 / 2 + .438 / 2 originStart[2] + railHeight * 1.75 / 2 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0] - serverDepth + 1.5, -0.66 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 / 2 - (.438 / 2) originStart[2] + railHeight * 1.75 / 2 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
@ -1198,12 +1198,12 @@ const sketch012rl = startSketchOn(extrude001rl, 'START')
-1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5, -1.12 + (.75 - .438) / 2 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 - .81 + .438 / 2 originStart[2] + railHeight * 1.75 - .81 + .438 / 2
], %) ], %)
|> xLine(0.75 - .438, %) |> xLine(length = 0.75 - .438)
|> tangentialArcTo([ |> tangentialArcTo([
-0.66 - originStart[0] - serverDepth + 1.5, -0.66 - originStart[0] - serverDepth + 1.5,
originStart[2] + railHeight * 1.75 - .81 - (.438 / 2) originStart[2] + railHeight * 1.75 - .81 - (.438 / 2)
], %) ], %)
|> xLine(-0.75 + .438, %) |> xLine(length = -0.75 + .438)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %) |> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close() |> close()
|> patternLinear2d( |> patternLinear2d(
@ -1255,23 +1255,23 @@ fn streamServer = (serverPos) => {
const sketch002s = startSketchOn(planeXZs) const sketch002s = startSketchOn(planeXZs)
|> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %) |> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %)
|> yLine(6.98, %) |> yLine(length = 6.98)
|> xLine(0.2, %) |> xLine(length = 0.2)
|> yLine(-0.36, %) |> yLine(length = -0.36)
|> xLine(0.5, %) |> xLine(length = 0.5)
|> tangentialArcTo([ |> tangentialArcTo([
0.3, 0.3,
17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114 17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114
], %) ], %)
|> yLine(-1.77, %) |> yLine(length = -1.77)
|> tangentialArcTo([ |> tangentialArcTo([
-0.13, -0.13,
14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114 14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114
], %) ], %)
|> xLine(-0.52, %) |> xLine(length = -0.52)
|> yLine(-0.42, %) |> yLine(length = -0.42)
|> line(end = [0.34, -0.15]) |> line(end = [0.34, -0.15])
|> yLine(-2.97, %) |> yLine(length = -2.97)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()
@ -1279,23 +1279,23 @@ fn streamServer = (serverPos) => {
const sketch003s = startSketchOn(planeXZs2) const sketch003s = startSketchOn(planeXZs2)
|> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %) |> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %)
|> yLine(6.98, %) |> yLine(length = 6.98)
|> xLine(0.2, %) |> xLine(length = 0.2)
|> yLine(-0.36, %) |> yLine(length = -0.36)
|> xLine(0.5, %) |> xLine(length = 0.5)
|> tangentialArcTo([ |> tangentialArcTo([
0.3, 0.3,
17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114 17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114
], %) ], %)
|> yLine(-1.77, %) |> yLine(length = -1.77)
|> tangentialArcTo([ |> tangentialArcTo([
-0.13, -0.13,
14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114 14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114
], %) ], %)
|> xLine(-0.52, %) |> xLine(length = -0.52)
|> yLine(-0.42, %) |> yLine(length = -0.42)
|> line(end = [0.34, -0.15]) |> line(end = [0.34, -0.15])
|> yLine(-2.97, %) |> yLine(length = -2.97)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close() |> close()

Some files were not shown because too many files have changed in this diff Show More