diff --git a/e2e/playwright/basic-sketch.spec.ts b/e2e/playwright/basic-sketch.spec.ts index a274232a2..0ff50e1f0 100644 --- a/e2e/playwright/basic-sketch.spec.ts +++ b/e2e/playwright/basic-sketch.spec.ts @@ -65,7 +65,7 @@ async function doBasicSketch( if (openPanes.includes('code')) { await expect(u.codeLocator) .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001) - |> xLine(${commonPoints.num1}, %)`) + |> xLine(length = ${commonPoints.num1})`) } await page.waitForTimeout(500) await page.mouse.click(startXPx + PUR * 20, 500 - PUR * 20) @@ -74,8 +74,8 @@ async function doBasicSketch( .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ commonPoints.startAt }, sketch001) - |> xLine(${commonPoints.num1}, %) - |> yLine(${commonPoints.num1 + 0.01}, %)`) + |> xLine(length = ${commonPoints.num1}) + |> yLine(length = ${commonPoints.num1 + 0.01})`) } else { await page.waitForTimeout(500) } @@ -86,9 +86,9 @@ async function doBasicSketch( .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ commonPoints.startAt }, sketch001) - |> xLine(${commonPoints.num1}, %) - |> yLine(${commonPoints.num1 + 0.01}, %) - |> xLine(${commonPoints.num2 * -1}, %)`) + |> xLine(length = ${commonPoints.num1}) + |> yLine(length = ${commonPoints.num1 + 0.01}) + |> xLine(length = ${commonPoints.num2 * -1})`) } // deselect line tool @@ -146,9 +146,9 @@ async function doBasicSketch( .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ commonPoints.startAt }, sketch001) - |> xLine(${commonPoints.num1}, %, $seg01) - |> yLine(${commonPoints.num1 + 0.01}, %) - |> xLine(-segLen(seg01), %)`) + |> xLine(length = ${commonPoints.num1}, tag = $seg01) + |> yLine(length = ${commonPoints.num1 + 0.01}) + |> xLine(length = -segLen(seg01))`) } test.describe('Basic sketch', { tag: ['@skipWin'] }, () => { diff --git a/e2e/playwright/command-bar-tests.spec.ts b/e2e/playwright/command-bar-tests.spec.ts index a0f900b94..80454e7e6 100644 --- a/e2e/playwright/command-bar-tests.spec.ts +++ b/e2e/playwright/command-bar-tests.spec.ts @@ -16,7 +16,7 @@ test.describe('Command bar tests', { tag: ['@skipWin'] }, () => { |> startProfileAt([-10, -10], %) |> line(end = [20, 0]) |> line(end = [0, 20]) - |> xLine(-20, %) + |> xLine(length = -20) |> close() ` ) diff --git a/e2e/playwright/editor-tests.spec.ts b/e2e/playwright/editor-tests.spec.ts index 351a2218b..f0a2b2d69 100644 --- a/e2e/playwright/editor-tests.spec.ts +++ b/e2e/playwright/editor-tests.spec.ts @@ -817,7 +817,7 @@ test.describe('Editor tests', { tag: ['@skipWin'] }, () => { await expect(page.locator('.cm-content')) .toHaveText(`sketch001 = startSketchOn('XZ') |> startProfileAt([3.14, 12], %) - |> xLine(5, %) // lin`) + |> xLine(length = 5) // lin`) // expect there to be no KCL errors 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')) .toHaveText(`sketch001 = startSketchOn('XZ') |> startProfileAt([3.14, 12], %) - |> xLine(5, %) // lin`) + |> xLine(length = 5) // lin`) }) }) test('Can undo a click and point extrude with ctrl+z', async ({ diff --git a/e2e/playwright/feature-tree-pane.spec.ts b/e2e/playwright/feature-tree-pane.spec.ts index 9efdb4c84..0eea97e20 100644 --- a/e2e/playwright/feature-tree-pane.spec.ts +++ b/e2e/playwright/feature-tree-pane.spec.ts @@ -8,7 +8,7 @@ const FEATURE_TREE_EXAMPLE_CODE = `export fn timesFive(x) { export fn triangle() { return startSketchOn('XZ') |> startProfileAt([0, 0], %) - |> xLine(10, %) + |> xLine(length = 10) |> line(end = [-10, -5]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -28,7 +28,7 @@ plane001 = offsetPlane('XY', offset = 10) sketch002 = startSketchOn(plane001) |> startProfileAt([-20, 0], %) |> line(end = [5, -15]) - |> xLine(-10, %) + |> xLine(length = -10) |> line(endAbsolute = [-40, 0]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() diff --git a/e2e/playwright/point-click.spec.ts b/e2e/playwright/point-click.spec.ts index 1e3ca7de1..fe8d5da8b 100644 --- a/e2e/playwright/point-click.spec.ts +++ b/e2e/playwright/point-click.spec.ts @@ -524,7 +524,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002) const expectedCodeSnippets = { sketchOnXzPlane: `sketch001 = startSketchOn('XZ')`, 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)`, afterSegmentDraggedOnYAxis: `startProfileAt([${yAxisSloppy.kcl[0]}, ${yAxisSloppy.kcl[1]}], sketch001)`, } @@ -585,7 +585,7 @@ profile001 = startProfileAt([205.96, 254.59], sketch002) openSketch = startSketchOn('XY') |> startProfileAt([-5, 0], %) |> line(endAbsolute = [0, 5]) - |> xLine(5, %) + |> xLine(length = 5) |> tangentialArcTo([10, 0], %) ` const viewPortSize = { width: 1000, height: 500 } @@ -1350,7 +1350,7 @@ loft001 = loft([sketch001, sketch002]) }, %) sketch002 = startSketchOn('XZ') |> startProfileAt([0, 0], %) - |> xLine(-500, %) + |> xLine(length = -500) |> tangentialArcTo([-2000, 500], %) ` await context.addInitScript((initialCode) => { @@ -1444,7 +1444,7 @@ sketch002 = startSketchOn('XZ') }, %) sketch002 = startSketchOn('XZ') |> startProfileAt([0, 0], %) - |> xLine(-500, %) + |> xLine(length = -500) |> line(endAbsolute = [-2000, 500]) ` await context.addInitScript((initialCode) => { @@ -2365,9 +2365,9 @@ chamfer04 = chamfer(extrude001, length = 5, tags = [getOppositeEdge(seg02)]) }) => { const initialCode = `sketch001 = startSketchOn('XY') |> startProfileAt([-20, 20], %) - |> xLine(40, %) - |> yLine(-60, %) - |> xLine(-40, %) + |> xLine(length = 40) + |> yLine(length = -60) + |> xLine(length = -40) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() extrude001 = extrude(sketch001, length = 40) @@ -2383,7 +2383,7 @@ extrude001 = extrude(sketch001, length = 40) const testPoint = { x: 580, y: 180 } const [clickOnCap] = scene.makeMouseHelpers(testPoint.x, testPoint.y) const [clickOnWall] = scene.makeMouseHelpers(testPoint.x, testPoint.y + 70) - const mutatedCode = 'xLine(-40, %, $seg01)' + const mutatedCode = 'xLine(length = -40, tag = $seg01)' const shellDeclaration = "shell001 = shell(extrude001, faces = ['end', seg01], thickness = 5)" @@ -2549,9 +2549,9 @@ extrude002 = extrude(sketch002, length = 50) }) => { const sketchCode = `sketch001 = startSketchOn('XY') profile001 = startProfileAt([-20, 20], sketch001) - |> xLine(40, %) - |> yLine(-60, %) - |> xLine(-40, %) + |> xLine(length = 40) + |> yLine(length = -60) + |> xLine(length = -40) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() ` @@ -2637,7 +2637,7 @@ profile001 = startProfileAt([-20, 20], sketch001) }, %) sketch002 = startSketchOn('XZ') |> startProfileAt([0, 0], %) - |> xLine(-2000, %) + |> xLine(length = -2000) sweep001 = sweep(sketch001, path = sketch002) ` await context.addInitScript((initialCode) => { @@ -2798,7 +2798,7 @@ radius = 8.69 const initialCode = ` sketch002 = startSketchOn('XY') |> startProfileAt([-2.02, 1.79], %) - |> xLine(2.6, %) + |> xLine(length = 2.6) sketch001 = startSketchOn('-XY') |> startProfileAt([-0.48, 1.25], %) |> angledLine([0, 2.38], %, $rectangleSegmentA001) @@ -2830,7 +2830,7 @@ radius = 8.69 await page.getByText(codeToSelecton).click() await toolbar.revolveButton.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 cmdBar.progressCmdBar() diff --git a/e2e/playwright/prompt-to-edit.spec.ts b/e2e/playwright/prompt-to-edit.spec.ts index 23d6de648..db57c08ac 100644 --- a/e2e/playwright/prompt-to-edit.spec.ts +++ b/e2e/playwright/prompt-to-edit.spec.ts @@ -13,9 +13,9 @@ profile001 = startProfileAt([57.81, 250.51], sketch001) extrude001 = extrude(profile001, length = 200) sketch002 = startSketchOn('XZ') |> startProfileAt([-73.64, -42.89], %) - |> xLine(173.71, %) + |> xLine(length = 173.71) |> line(end = [-22.12, -94.4]) - |> xLine(-156.98, %) + |> xLine(length = -156.98) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() extrude002 = extrude(sketch002, length = 50) diff --git a/e2e/playwright/regression-tests.spec.ts b/e2e/playwright/regression-tests.spec.ts index 78a3099eb..1056477b2 100644 --- a/e2e/playwright/regression-tests.spec.ts +++ b/e2e/playwright/regression-tests.spec.ts @@ -248,7 +248,7 @@ extrude001 = extrude(sketch001, length = 50) `exampleSketch = startSketchOn("XZ") |> startProfileAt([0, 0], %) |> angledLine({ angle: 50, length: 45 }, %) - |> yLineTo(0, %) + |> yLine(endAbsolute = 0) |> close() |> @@ -304,7 +304,7 @@ extrude001 = extrude(sketch001, length = 50) .toContainText(`exampleSketch = startSketchOn("XZ") |> startProfileAt([0, 0], %) |> angledLine({ angle: 50, length: 45 }, %) - |> yLineTo(0, %) + |> yLine(endAbsolute = 0) |> close() thing: "blah"`) diff --git a/e2e/playwright/sketch-tests.spec.ts b/e2e/playwright/sketch-tests.spec.ts index 49639080a..4cb550507 100644 --- a/e2e/playwright/sketch-tests.spec.ts +++ b/e2e/playwright/sketch-tests.spec.ts @@ -48,26 +48,26 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => { part001 = startSketchOn('XY') ${startProfileAt2} - |> xLine(width * .5, %) - |> yLine(height, %) - |> xLine(-width * .5, %) + |> xLine(length = width * .5) + |> yLine(length = height) + |> xLine(length = -width * .5) |> close() |> hole(screwHole, %) |> extrude(length = thickness) part002 = startSketchOn('-XZ') ${startProfileAt3} - |> xLine(width / 4, %) + |> xLine(length = width / 4) |> tangentialArcTo([width / 2, 0], %) - |> xLine(-width / 4 + wireRadius, %) - |> yLine(wireOffset, %) + |> xLine(length = -width / 4 + wireRadius) + |> yLine(length = wireOffset) |> arc({ radius = wireRadius, angleStart = 0, angleEnd = 180 }, %) - |> yLine(-wireOffset, %) - |> xLine(-width / 4, %) + |> yLine(length = -wireOffset) + |> xLine(length = -width / 4) |> close() |> extrude(length = -height) ` @@ -111,7 +111,7 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => { 'persistCode', `sketch001 = startSketchOn('XZ') |> startProfileAt([2.61, -4.01], %) - |> xLine(8.73, %) + |> xLine(length = 8.73) |> tangentialArcTo([8.33, -1.31], %)` ) }) @@ -157,7 +157,7 @@ test.describe('Sketch tests', { tag: ['@skipWin'] }, () => { await expect.poll(u.normalisedEditorCode, { timeout: 1000 }) .toBe(`sketch002 = startSketchOn('XZ') sketch001 = startProfileAt([12.34, -12.34], sketch002) - |> yLine(12.34, %) + |> yLine(length = 12.34) `) }).toPass({ timeout: 5_000, intervals: [1_000] }) @@ -693,15 +693,15 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002) await click00r(50, 0) await page.waitForTimeout(100) - codeStr += ` |> xLine(${toU(50, 0)[0]}, %)` + codeStr += ` |> xLine(length = ${toU(50, 0)[0]})` await expect(u.codeLocator).toHaveText(codeStr) await click00r(0, 50) - codeStr += ` |> yLine(${toU(0, 50)[1]}, %)` + codeStr += ` |> yLine(length = ${toU(0, 50)[1]})` await expect(u.codeLocator).toHaveText(codeStr) await click00r(-50, 0) - codeStr += ` |> xLine(${toU(-50, 0)[0]}, %)` + codeStr += ` |> xLine(length = ${toU(-50, 0)[0]})` await expect(u.codeLocator).toHaveText(codeStr) // 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 // it to be off by 0.01 await click00r(30, 0) - codeStr += ` |> xLine(2.04, %)` + codeStr += ` |> xLine(length = 2.04)` await expect(u.codeLocator).toHaveText(codeStr) await click00r(0, 30) - codeStr += ` |> yLine(-2.03, %)` + codeStr += ` |> yLine(length = -2.03)` await expect(u.codeLocator).toHaveText(codeStr) await click00r(-30, 0) - codeStr += ` |> xLine(-2.04, %)` + codeStr += ` |> xLine(length = -2.04)` await expect(u.codeLocator).toHaveText(codeStr) await click00r(undefined, undefined) @@ -763,8 +763,8 @@ sketch001 = startProfileAt([12.34, -12.34], sketch002) profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff( scale * 34.8 )}], sketch001) - |> xLine(${roundOff(scale * 139.19)}, %) - |> yLine(-${roundOff(scale * 139.2)}, %) + |> xLine(length = ${roundOff(scale * 139.19)}) + |> yLine(length = -${roundOff(scale * 139.2)}) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close()` @@ -1020,7 +1020,7 @@ profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff( |> startProfileAt([-10, -10], %) |> line(end = [20, 0]) |> line(end = [0, 20]) - |> xLine(-20, %) + |> xLine(length = -20) `) await u.expectCmdLog('[data-message-type="execution-done"]') @@ -1096,8 +1096,8 @@ profile001 = startProfileAt([${roundOff(scale * 69.6)}, ${roundOff( lugSketch = startSketchOn(plane) |> startProfileAt([origin[0] + lugDiameter / 2, origin[1]], %) |> angledLineOfYLength({ angle = 60, length = lugHeadLength }, %) - |> xLineTo(0 + .001, %) - |> yLineTo(0, %) + |> xLine(endAbsolute = 0 + .001) + |> yLine(endAbsolute = 0) |> close() |> revolve({ axis = "Y" }, %) @@ -1370,7 +1370,7 @@ profile001 = startProfileAt([121.52, 168.25], sketch001) |> close() profile002 = startProfileAt([117.2, 56.08], sketch001) |> 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', `sketch001 = startSketchOn('XZ') profile002 = startProfileAt([40.68, 87.67], sketch001) - |> xLine(239.17, %) + |> xLine(length = 239.17) 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(%)]) |> close() profile004 = startProfileAt([3.15, 9.39], sketch002) - |> xLine(6.92, %) + |> xLine(length = 6.92) |> line(end = [-7.41, -2.85]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -2552,7 +2552,7 @@ profile001 = startProfileAt([34, 42.66], sketch001) plane001 = offsetPlane('XZ', offset = 50) sketch002 = startSketchOn(plane001) profile002 = startProfileAt([39.43, 172.21], sketch002) - |> xLine(183.99, %) + |> xLine(length = 183.99) |> line(end = [-77.95, -145.93]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -2605,7 +2605,7 @@ profile001 = startProfileAt([34, 42.66], sketch001) plane001 = offsetPlane('XZ', offset = 50) sketch002 = startSketchOn(plane001) profile002 = startProfileAt([39.43, 172.21], sketch002) - |> xLine(183.99, %) + |> xLine(length = 183.99) |> line(end = [-77.95, -145.93]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() diff --git a/e2e/playwright/snapshot-tests.spec.ts b/e2e/playwright/snapshot-tests.spec.ts index aed88c396..8ae657ee6 100644 --- a/e2e/playwright/snapshot-tests.spec.ts +++ b/e2e/playwright/snapshot-tests.spec.ts @@ -71,14 +71,14 @@ armThick = 0.5 totalLen = 9.5 part001 = startSketchOn('-XZ') |> startProfileAt([0, 0], %) - |> yLine(baseHeight, %) - |> xLine(baseLen, %) + |> yLine(length = baseHeight) + |> xLine(length = baseLen) |> angledLineToY({ angle = topAng, to = totalHeightHalf, }, %, $seg04) - |> xLineTo(totalLen, %, $seg03) - |> yLine(-armThick, %, $seg01) + |> xLine(endAbsolute = totalLen, tag = $seg03) + |> yLine(length = -armThick, tag = $seg01) |> angledLineThatIntersects({ angle = HALF_TURN, offset = -armThick, @@ -89,15 +89,15 @@ part001 = startSketchOn('-XZ') angle = -bottomAng, to = -totalHeightHalf - armThick, }, %, $seg02) - |> xLineTo(segEndX(seg03, %) + 0, %) - |> yLine(-segLen(seg01, %), %) + |> xLine(length = endAbsolute = segEndX(seg03) + 0) + |> yLine(length = -segLen(seg01, %)) |> angledLineThatIntersects({ angle = HALF_TURN, offset = -armThick, intersectTag = seg02 }, %) |> angledLineToY([segAng(seg02, %) + 180, -baseHeight], %) - |> xLineTo(ZERO, %) + |> xLine(endAbsolute = ZERO) |> close() |> extrude(length = 4)` ) @@ -461,7 +461,7 @@ test( await page.waitForTimeout(100) code += ` - |> xLine(7.25, %)` + |> xLine(length = 7.25)` await expect(page.locator('.cm-content')).toHaveText(code) await page @@ -653,7 +653,7 @@ test.describe( await page.waitForTimeout(100) code += ` - |> xLine(7.25, %)` + |> xLine(length = 7.25)` await expect(u.codeLocator).toHaveText(code) await page @@ -761,7 +761,7 @@ test.describe( await page.waitForTimeout(100) code += ` - |> xLine(184.3, %)` + |> xLine(length = 184.3)` await expect(u.codeLocator).toHaveText(code) await page diff --git a/e2e/playwright/storageStates.ts b/e2e/playwright/storageStates.ts index c2ecb491f..3fbf1e5ba 100644 --- a/e2e/playwright/storageStates.ts +++ b/e2e/playwright/storageStates.ts @@ -79,9 +79,9 @@ export const TEST_CODE_GIZMO = `part001 = startSketchOn('XZ') |> line(end = [7.13, 4 + 0]) |> angledLine({ angle: 3 + 0, length: 3.14 + 0 }, %) |> line(endAbsolute = [20.14 + 0, -0.14 + 0]) -|> xLineTo(29 + 0, %) -|> yLine(-3.14 + 0, %, $a) -|> xLine(1.63, %) +|> xLine(endAbsolute = 29 + 0) +|> yLine(length = -3.14 + 0, tag = $a) +|> xLine(length = 1.63) |> angledLineOfXLength({ angle: 3 + 0, length: 3.14 }, %) |> angledLineOfYLength({ angle: 30, length: 3 + 0 }, %) |> angledLineToX({ angle: 22.14 + 0, to: 12 }, %) @@ -146,7 +146,7 @@ sketch001 = startSketchOn(box, revolveAxis) sketch001 = startSketchOn('XZ') |> startProfileAt([0.0, 0.0], %) - |> xLine(0.0, %) + |> xLine(length = 0.0) |> close() ` diff --git a/e2e/playwright/test-network-and-connection-issues.spec.ts b/e2e/playwright/test-network-and-connection-issues.spec.ts index f45aa4f63..14aa36278 100644 --- a/e2e/playwright/test-network-and-connection-issues.spec.ts +++ b/e2e/playwright/test-network-and-connection-issues.spec.ts @@ -122,7 +122,7 @@ test.describe('Test network and connection issues', () => { await expect(page.locator('.cm-content')) .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001) - |> xLine(${commonPoints.num1}, %)`) + |> xLine(length = ${commonPoints.num1})`) // Expect the network to be up await expect(networkToggle).toContainText('Connected') @@ -215,7 +215,7 @@ test.describe('Test network and connection issues', () => { await expect.poll(u.normalisedEditorCode) .toBe(`sketch001 = startSketchOn('XZ') profile001 = startProfileAt([12.34, -12.34], sketch001) - |> xLine(12.34, %) + |> xLine(length = 12.34) |> line(end = [-12.34, 12.34]) `) @@ -225,9 +225,9 @@ profile001 = startProfileAt([12.34, -12.34], sketch001) await expect.poll(u.normalisedEditorCode) .toBe(`sketch001 = startSketchOn('XZ') profile001 = startProfileAt([12.34, -12.34], sketch001) - |> xLine(12.34, %) + |> xLine(length = 12.34) |> line(end = [-12.34, 12.34]) - |> xLine(-12.34, %) + |> xLine(length = -12.34) `) diff --git a/e2e/playwright/testing-constraints.spec.ts b/e2e/playwright/testing-constraints.spec.ts index 2aa70c883..87a2a6934 100644 --- a/e2e/playwright/testing-constraints.spec.ts +++ b/e2e/playwright/testing-constraints.spec.ts @@ -18,7 +18,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => { |> startProfileAt([-10, -10], %) |> line(end = [20, 0]) |> line(end = [0, 20]) - |> xLine(-20, %) + |> xLine(length = -20) ` ) }) @@ -57,7 +57,7 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => { .click() 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. @@ -89,9 +89,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => { |> line(end = [41.19, 58.97 + 5]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 120], %) - |> xLine(-385.34, %, $seg_what) - |> yLine(-170.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -385.34, tag = $seg_what) + |> yLine(length = -170.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) }) @@ -153,9 +153,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => { |> line(end = [51.19, 48.97]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 231.45], %) - |> xLine(-425.34, %, $seg_what) - |> yLine(-264.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -425.34, tag = $seg_what) + |> yLine(length = -264.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) @@ -285,9 +285,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => { |> line(end = [51.19, 48.97]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 231.45], %) - |> xLine(-425.34, %, $seg_what) - |> yLine(-264.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -425.34, tag = $seg_what) + |> yLine(length = -264.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) }) @@ -395,9 +395,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => { |> line(end = [51.19, 48.97]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 231.45], %) - |> xLine(-425.34, %, $seg_what) - |> yLine(-264.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -425.34, tag = $seg_what) + |> yLine(length = -264.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) }) @@ -508,9 +508,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => { |> line(end = [51.19, 48.97]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 231.45], %) - |> xLine(-425.34, %, $seg_what) - |> yLine(-264.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -425.34, tag = $seg_what) + |> yLine(length = -264.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) }) @@ -610,9 +610,9 @@ test.describe('Testing constraints', { tag: ['@skipWin'] }, () => { |> line(end = [51.19, 48.97]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 231.45], %) - |> xLine(-425.34, %, $seg_what) - |> yLine(-264.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -425.34, tag = $seg_what) + |> yLine(length = -264.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) }) @@ -696,9 +696,9 @@ part001 = startSketchOn('XZ') |> line(end = [51.19, 48.97]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 231.45], %) - |> xLine(-425.34, %, $seg_what) - |> yLine(-264.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -425.34, tag = $seg_what) + |> yLine(length = -264.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) }) @@ -748,16 +748,16 @@ part002 = startSketchOn('XZ') { constraintName: 'Vertical', codeAfter: [ - `|> yLine(130.4, %)`, - `|> yLine(77.79, %)`, - `|> yLine(48.97, %)`, + `|> yLine(length = 130.4)`, + `|> yLine(length = 77.79)`, + `|> yLine(length = 48.97)`, ], }, { codeAfter: [ - `|> xLine(74.36, %)`, - `|> xLine(9.16, %)`, - `|> xLine(51.19, %)`, + `|> xLine(length = 74.36)`, + `|> xLine(length = 9.16)`, + `|> xLine(length = 51.19)`, ], constraintName: 'Horizontal', }, @@ -776,9 +776,9 @@ part002 = startSketchOn('XZ') |> line(end = [51.19, 48.97]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 231.45], %) - |> xLine(-425.34, %, $seg_what) - |> yLine(-264.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -425.34, tag = $seg_what) + |> yLine(length = -264.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) }) @@ -876,9 +876,9 @@ part002 = startSketchOn('XZ') |> line(end = [9.16, 77.79]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 231.45], %) - |> xLine(-425.34, %, $seg_what) - |> yLine(-264.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -425.34, tag = $seg_what) + |> yLine(length = -264.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) }) @@ -957,9 +957,9 @@ part002 = startSketchOn('XZ') |> line(end = [9.16, 77.79]) part002 = startSketchOn('XZ') |> startProfileAt([299.05, 231.45], %) - |> xLine(-425.34, %, $seg_what) - |> yLine(-264.06, %) - |> xLine(segLen(seg_what), %) + |> xLine(length = -425.34, tag = $seg_what) + |> yLine(length = -264.06) + |> xLine(length = segLen(seg_what)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])` ) }) @@ -1061,7 +1061,7 @@ part002 = startSketchOn('XZ') await pollEditorLinesSelectedLength(page, 1) 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. await page.waitForTimeout(2000) @@ -1105,7 +1105,7 @@ part002 = startSketchOn('XZ') await pollEditorLinesSelectedLength(page, 1) 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 await expect(page.getByTestId('segment-overlay')).toHaveCount(2) diff --git a/e2e/playwright/testing-segment-overlays.spec.ts b/e2e/playwright/testing-segment-overlays.spec.ts index 1662e801d..bff06e83b 100644 --- a/e2e/playwright/testing-segment-overlays.spec.ts +++ b/e2e/playwright/testing-segment-overlays.spec.ts @@ -212,10 +212,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { |> line(end = [0.5, -14 + 0]) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> line(endAbsolute = [5 + 33, 20 + 11.5 + 0]) - |> xLineTo(5 + 9 - 5, %) - |> yLineTo(20 + -10.77, %, $a) - |> xLine(26.04, %) - |> yLine(21.14 + 0, %) + |> xLine(endAbsolute = 5 + 9 - 5) + |> yLine(endAbsolute = 20 + -10.77, tag = $a) + |> xLine(length = 26.04) + |> yLine(length = 21.14 + 0) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> 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.closeDebugPanel() - await page.getByText('xLineTo(5 + 9 - 5, %)').click() + await page.getByText('xLine(endAbsolute = 5 + 9 - 5)').click() await page.waitForTimeout(100) await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.waitForTimeout(500) @@ -358,9 +358,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { await clickConstrained({ hoverPos: { x: xLineTo.x, y: xLineTo.y }, constraintType: 'xAbsolute', - expectBeforeUnconstrained: 'xLineTo(5 + 9 - 5, %)', - expectAfterUnconstrained: 'xLineTo(9, %)', - expectFinal: 'xLineTo(xAbs002, %)', + expectBeforeUnconstrained: 'xLine(endAbsolute = 5 + 9 - 5)', + expectAfterUnconstrained: 'xLine(endAbsolute = 9)', + expectFinal: 'xLine(endAbsolute = xAbs002)', ang: ang + 180, steps: 8, locator: '[data-overlay-toolbar-index="3"]', @@ -386,10 +386,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { |> line(end = [0.5, yRel001]) |> angledLine({ angle = angle001, length = len001 }, %) |> line(endAbsolute = [33, yAbs001]) - |> xLineTo(xAbs002, %) - |> yLineTo(-10.77, %, $a) - |> xLine(26.04, %) - |> yLine(21.14 + 0, %) + |> xLine(endAbsolute = xAbs002) + |> yLine(endAbsolute = -10.77, tag = $a) + |> xLine(length = 26.04) + |> yLine(length = 21.14 + 0) |> 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.closeDebugPanel() - await page.getByText('xLine(26.04, %)').click() + await page.getByText('xLine(length = 26.04)').click() await page.waitForTimeout(100) await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.waitForTimeout(500) @@ -424,9 +424,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { await clickUnconstrained({ hoverPos: { x: yLineTo.x, y: yLineTo.y - 200 }, constraintType: 'yAbsolute', - expectBeforeUnconstrained: 'yLineTo(-10.77, %, $a)', - expectAfterUnconstrained: 'yLineTo(yAbs002, %, $a)', - expectFinal: 'yLineTo(-10.77, %, $a)', + expectBeforeUnconstrained: 'yLine(endAbsolute = -10.77, tag = $a)', + expectAfterUnconstrained: 'yLine(endAbsolute = yAbs002, tag = $a)', + expectFinal: 'yLine(endAbsolute = -10.77, tag = $a)', ang: ang + 180, locator: '[data-overlay-toolbar-index="4"]', }) @@ -437,9 +437,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { await clickUnconstrained({ hoverPos: { x: xLine.x, y: xLine.y }, constraintType: 'xRelative', - expectBeforeUnconstrained: 'xLine(26.04, %)', - expectAfterUnconstrained: 'xLine(xRel002, %)', - expectFinal: 'xLine(26.04, %)', + expectBeforeUnconstrained: 'xLine(length = 26.04)', + expectAfterUnconstrained: 'xLine(length = xRel002)', + expectFinal: 'xLine(length = 26.04)', steps: 10, ang: ang + 180, locator: '[data-overlay-toolbar-index="5"]', @@ -459,10 +459,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { |> line(end = [0.5, -14 + 0]) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> line(endAbsolute = [33, 11.5 + 0]) - |> xLineTo(9 - 5, %) - |> yLineTo(-10.77, %, $a) - |> xLine(26.04, %) - |> yLine(21.14 + 0, %) + |> xLine(endAbsolute = 9 - 5) + |> yLine(endAbsolute = -10.77, tag = $a) + |> xLine(length = 26.04) + |> yLine(length = 21.14 + 0) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> angledLineToX({ angle = 3 + 0, to = 26 }, %) @@ -488,7 +488,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { await u.closeDebugPanel() 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.getByRole('button', { name: 'Edit Sketch' }).click() await page.waitForTimeout(500) @@ -506,9 +506,9 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { await clickConstrained({ hoverPos: { x: yLine.x, y: yLine.y }, constraintType: 'yRelative', - expectBeforeUnconstrained: 'yLine(21.14 + 0, %)', - expectAfterUnconstrained: 'yLine(21.14, %)', - expectFinal: 'yLine(yRel001, %)', + expectBeforeUnconstrained: 'yLine(length = 21.14 + 0)', + expectAfterUnconstrained: 'yLine(length = 21.14)', + expectFinal: 'yLine(length = yRel001)', ang: ang + 180, locator: '[data-overlay-toolbar-index="6"]', }) @@ -591,10 +591,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { |> line(end = [0.5, -14 + 0]) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> line(endAbsolute = [33, 11.5 + 0]) - |> xLineTo(9 - 5, %) - |> yLineTo(-10.77, %, $a) - |> xLine(26.04, %) - |> yLine(21.14 + 0, %) + |> xLine(endAbsolute = 9 - 5) + |> yLine(endAbsolute = -10.77, tag = $a) + |> xLine(length = 26.04) + |> yLine(length = 21.14 + 0) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> 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.closeDebugPanel() - await page.getByText('xLineTo(9 - 5, %)').click() + await page.getByText('xLine(endAbsolute = 9 - 5)').click() await page.waitForTimeout(100) await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.waitForTimeout(500) @@ -755,10 +755,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { |> line(end = [0.5, -14 + 0]) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> line(endAbsolute = [33, 11.5 + 0]) - |> xLineTo(9 - 5, %) - |> yLineTo(-10.77, %, $a) - |> xLine(26.04, %) - |> yLine(21.14 + 0, %) + |> xLine(endAbsolute = 9 - 5) + |> yLine(endAbsolute = -10.77, tag = $a) + |> xLine(length = 26.04) + |> yLine(length = 21.14 + 0) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> 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.closeDebugPanel() - await page.getByText('xLineTo(9 - 5, %)').click() + await page.getByText('xLine(endAbsolute = 9 - 5)').click() await page.waitForTimeout(100) await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.waitForTimeout(500) @@ -947,10 +947,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { |> line(end = [0.5, -14 + 0]) |> angledLine({ angle = 3 + 0, length = 32 + 0 }, %) |> line(endAbsolute = [33, 11.5 + 0]) - |> xLineTo(9 - 5, %) - |> yLineTo(-10.77, %, $a) - |> xLine(26.04, %) - |> yLine(21.14 + 0, %) + |> xLine(endAbsolute = 9 - 5) + |> yLine(endAbsolute = -10.77, tag = $a) + |> xLine(length = 26.04) + |> yLine(length = 21.14 + 0) |> angledLineOfXLength({ angle = 181 + 0, length = 23.14 }, %) |> angledLineOfYLength({ angle = -91, length = 19 + 0 }, %) |> 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.closeDebugPanel() - await page.getByText('xLineTo(9 - 5, %)').click() + await page.getByText('xLine(endAbsolute = 9 - 5)').click() await page.waitForTimeout(100) await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.waitForTimeout(500) @@ -1060,7 +1060,7 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { ang = await u.getAngle(`[data-overlay-index="${6}"]`) await deleteSegmentSequence({ hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, - codeToBeDeleted: 'yLine(21.14 + 0, %)', + codeToBeDeleted: 'yLine(length = 21.14 + 0)', stdLibFnName: 'yLine', ang: ang + 180, 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}"]`) await deleteSegmentSequence({ hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, - codeToBeDeleted: 'xLine(26.04, %)', + codeToBeDeleted: 'xLine(length = 26.04)', stdLibFnName: 'xLine', ang: ang + 180, 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}"]`) await deleteSegmentSequence({ hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, - codeToBeDeleted: 'yLineTo(-10.77, %, $a)', + codeToBeDeleted: 'yLine(endAbsolute = -10.77, tag = $a)', stdLibFnName: 'yLineTo', ang: ang + 180, 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}"]`) await deleteSegmentSequence({ hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, - codeToBeDeleted: 'xLineTo(9 - 5, %)', + codeToBeDeleted: 'xLine(endAbsolute = 9 - 5)', stdLibFnName: 'xLineTo', ang: ang + 180, locator: '[data-overlay-toolbar-index="3"]', @@ -1155,10 +1155,10 @@ test.describe('Testing segment overlays', { tag: ['@skipWin'] }, () => { const cases = [ 'line(end = [22, 2], tag = $seg01)', 'angledLine([5, 23.03], %, $seg01)', - 'xLine(23, %, $seg01)', - 'yLine(-8, %, $seg01)', - 'xLineTo(30, %, $seg01)', - 'yLineTo(-4, %, $seg01)', + 'xLine(length = 23, tag = $seg01)', + 'yLine(length = -8, tag = $seg01)', + 'xLine(endAbsolute = 30, tag = $seg01)', + 'yLine(endAbsolute = -4, tag = $seg01)', 'angledLineOfXLength([3, 30], %, $seg01)', 'angledLineOfXLength({ angle = 3, length = 30 }, %, $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)`, }, { - before: `xLine(23 + 0, %, $seg01)`, + before: `xLine(length = 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)`, }, { - before: `xLineTo(30 + 0, %, $seg01)`, + before: `xLine(endAbsolute = 30 + 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)`, }, { diff --git a/e2e/playwright/testing-selections.spec.ts b/e2e/playwright/testing-selections.spec.ts index fe68c264e..191f2cd55 100644 --- a/e2e/playwright/testing-selections.spec.ts +++ b/e2e/playwright/testing-selections.spec.ts @@ -75,7 +75,7 @@ test.describe('Testing selections', { tag: ['@skipWin'] }, () => { await expect(page.locator('.cm-content')) .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${commonPoints.startAt}, sketch001) - |> xLine(${commonPoints.num1}, %)`) + |> xLine(length = ${commonPoints.num1})`) await page.waitForTimeout(100) 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(${ commonPoints.startAt }, sketch001) - |> xLine(${commonPoints.num1}, %) - |> yLine(${commonPoints.num1 + 0.01}, %)`) + |> xLine(length = ${commonPoints.num1}) + |> yLine(length = ${commonPoints.num1 + 0.01})`) await page.waitForTimeout(100) await page.mouse.click(startXPx, 500 - PUR * 20) await expect(page.locator('.cm-content')) .toHaveText(`sketch001 = startSketchOn('XZ')profile001 = startProfileAt(${ commonPoints.startAt }, sketch001) - |> xLine(${commonPoints.num1}, %) - |> yLine(${commonPoints.num1 + 0.01}, %) - |> xLine(${commonPoints.num2 * -1}, %)`) + |> xLine(length = ${commonPoints.num1}) + |> yLine(length = ${commonPoints.num1 + 0.01}) + |> xLine(length = ${commonPoints.num2 * -1})`) // deselect line tool await page.getByRole('button', { name: 'line Line', exact: true }).click() @@ -158,7 +158,7 @@ test.describe('Testing selections', { tag: ['@skipWin'] }, () => { // 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 page.getByText(` |> xLine(${commonPoints.num2 * -1}, %)`).click() + await page.getByText(` |> xLine(length = ${commonPoints.num2 * -1})`).click() await page.keyboard.down('Shift') await constrainButton.click() await expect(absXButton).toBeDisabled() @@ -182,7 +182,7 @@ test.describe('Testing selections', { tag: ['@skipWin'] }, () => { process.platform === 'linux' ? 'Control' : 'Meta' ) 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 page.waitForTimeout(500) @@ -536,9 +536,9 @@ profile003 = startProfileAt([40.16, -120.48], sketch006) |> line(end = [7.13, 4 + 0]) |> angledLine({ angle = 3 + 0, length = 3.14 + 0 }, %) |> line(endAbsolute = [20.14 + 0, -0.14 + 0]) - |> xLineTo(29 + 0, %) - |> yLine(-3.14 + 0, %, $a) - |> xLine(1.63, %) + |> xLine(endAbsolute = 29 + 0) + |> yLine(length = -3.14 + 0, tag = $a) + |> xLine(length = 1.63) |> angledLineOfXLength({ angle = 3 + 0, length = 3.14 }, %) |> angledLineOfYLength({ angle = 30, length = 3 + 0 }, %) |> angledLineToX({ angle = 22.14 + 0, to = 12 }, %) diff --git a/e2e/playwright/various.spec.ts b/e2e/playwright/various.spec.ts index 0ac72342d..60365bd5d 100644 --- a/e2e/playwright/various.spec.ts +++ b/e2e/playwright/various.spec.ts @@ -52,14 +52,14 @@ armThick = 0.5 totalLen = 9.5 part001 = startSketchOn('-XZ') |> startProfileAt([0, 0], %) -|> yLine(baseHeight, %) -|> xLine(baseLen, %) +|> yLine(length = baseHeight) +|> xLine(length = baseLen) |> angledLineToY({ angle = topAng, to = totalHeightHalf, }, %, $seg04) -|> xLineTo(totalLen, %, $seg03) -|> yLine(-armThick, %, $seg01) +|> xLine(endAbsolute = totalLen, tag = $seg03) +|> yLine(length = -armThick, tag = $seg01) |> angledLineThatIntersects({ angle = HALF_TURN, offset = -armThick, @@ -70,15 +70,15 @@ part001 = startSketchOn('-XZ') angle = -bottomAng, to = -totalHeightHalf - armThick, }, %, $seg02) -|> xLineTo(segEndX(seg03) + 0, %) -|> yLine(-segLen(seg01), %) +|> xLine(endAbsolute = segEndX(seg03) + 0) +|> yLine(length = -segLen(seg01)) |> angledLineThatIntersects({ angle = HALF_TURN, offset = -armThick, intersectTag = seg02 }, %) |> angledLineToY([segAng(seg02) + 180, -baseHeight], %) -|> xLineTo(ZERO, %) +|> xLine(endAbsolute = ZERO) |> close() |> extrude(length = 4)` ) diff --git a/src/lang/modifyAst.test.ts b/src/lang/modifyAst.test.ts index 95a86b6b1..e5639a5ab 100644 --- a/src/lang/modifyAst.test.ts +++ b/src/lang/modifyAst.test.ts @@ -592,10 +592,10 @@ ${!replace1 ? ` |> ${line}\n` : ''} |> angledLine([-65, ${ 'line(endAbsolute = [306.21, 198.85], tag = $a)', ['110.48', '119.73'], ], - ['yLine', 'yLine(198.85, %, $a)', ['198.85', '90']], - ['xLine', 'xLine(198.85, %, $a)', ['198.85', '0']], - ['yLineTo', 'yLineTo(198.85, %, $a)', ['95.94', '90']], - ['xLineTo', 'xLineTo(198.85, %, $a)', ['162.14', '180']], + ['yLine', 'yLine(length = 198.85, tag = $a)', ['198.85', '90']], + ['xLine', 'xLine(length = 198.85, tag = $a)', ['198.85', '0']], + ['yLineTo', 'yLine(endAbsolute = 198.85, tag = $a)', ['95.94', '90']], + ['xLineTo', 'xLine(endAbsolute = 198.85, tag = $a)', ['162.14', '180']], [ 'angledLine', 'angledLine({ angle: 45.5, length: 198.85 }, %, $a)', @@ -658,10 +658,10 @@ describe('Testing removeSingleConstraintInfo', () => { |> line(end = [3 + 0, 4 + 0]) |> angledLine({ angle = 3 + 0, length = 3.14 + 0 }, %) |> line(endAbsolute = [6.14 + 0, 3.14 + 0]) - |> xLineTo(8 + 0, %) - |> yLineTo(5 + 0, %) - |> yLine(3.14 + 0, %, $a) - |> xLine(3.14 + 0, %) + |> xLine(endAbsolute = 8 + 0) + |> yLine(endAbsolute = 5 + 0) + |> yLine(length = 3.14 + 0, tag = $a) + |> xLine(length = 3.14 + 0) |> angledLineOfXLength({ angle = 3 + 0, length = 3.14 + 0 }, %) |> angledLineOfYLength({ angle = 30 + 0, length = 3 + 0 }, %) |> angledLineToX({ angle = 12.14 + 0, to = 12 + 0 }, %) @@ -680,10 +680,10 @@ describe('Testing removeSingleConstraintInfo', () => { 'angle', ], ['line(endAbsolute = [6.14 + 0, 3.14 + 0])', 'arrayIndex', 0], - ['xLineTo(8, %)', '', ''], - ['yLineTo(5, %)', '', ''], - ['yLine(3.14, %, $a)', '', ''], - ['xLine(3.14, %)', '', ''], + ['xLine(endAbsolute = 8)', '', ''], + ['yLine(endAbsolute = 5)', '', ''], + ['yLine(length = 3.14, tag = $a)', '', ''], + ['xLine(length = 3.14)', '', ''], [ 'angledLineOfXLength({ angle = 3, length = 3.14 + 0 }, %)', 'objectProperty', diff --git a/src/lang/queryAst.test.ts b/src/lang/queryAst.test.ts index 6ff2ac21e..82403c33d 100644 --- a/src/lang/queryAst.test.ts +++ b/src/lang/queryAst.test.ts @@ -51,8 +51,8 @@ objExpShouldNotBeIncluded = { a: 1, b: 2, c: 3 } part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) - |> yLineTo(1, %) - |> xLine(3.84, %) // selection-range-7ish-before-this + |> yLine(endAbsolute = 1) + |> xLine(length = 3.84) // selection-range-7ish-before-this variableBelowShouldNotBeIncluded = 3 ` @@ -690,11 +690,11 @@ describe('Testing specific sketch getNodeFromPath workflow', () => { it('should parse the code', () => { const openSketch = `sketch001 = startSketchOn('XZ') |> startProfileAt([0.02, 0.22], %) -|> xLine(0.39, %) +|> xLine(length = 0.39) |> line([0.02, -0.17], %) -|> yLine(-0.15, %) +|> yLine(length = -0.15) |> line([-0.21, -0.02], %) -|> xLine(-0.15, %) +|> xLine(length = -0.15) |> line([-0.02, 0.21], %) |> line([-0.08, 0.05], %)` const ast = assertParse(openSketch) @@ -704,11 +704,11 @@ describe('Testing specific sketch getNodeFromPath workflow', () => { it('should find the location to add new lineTo', () => { const openSketch = `sketch001 = startSketchOn('XZ') |> startProfileAt([0.02, 0.22], %) -|> xLine(0.39, %) +|> xLine(length = 0.39) |> line([0.02, -0.17], %) -|> yLine(-0.15, %) +|> yLine(length = -0.15) |> line([-0.21, -0.02], %) -|> xLine(-0.15, %) +|> xLine(length = -0.15) |> line([-0.02, 0.21], %) |> line([-0.08, 0.05], %)` const ast = assertParse(openSketch) @@ -744,11 +744,11 @@ describe('Testing specific sketch getNodeFromPath workflow', () => { const recasted = recast(modifiedAst) const expectedCode = `sketch001 = startSketchOn('XZ') |> startProfileAt([0.02, 0.22], %) - |> xLine(0.39, %) + |> xLine(length = 0.39) |> line([0.02, -0.17], %) - |> yLine(-0.15, %) + |> yLine(length = -0.15) |> line([-0.21, -0.02], %) - |> xLine(-0.15, %) + |> xLine(length = -0.15) |> line([-0.02, 0.21], %) |> line([-0.08, 0.05], %) |> lineTo([profileStartX(%), profileStartY(%)], %) @@ -758,11 +758,11 @@ describe('Testing specific sketch getNodeFromPath workflow', () => { it('it should find the location to add close', () => { const openSketch = `sketch001 = startSketchOn('XZ') |> startProfileAt([0.02, 0.22], %) -|> xLine(0.39, %) +|> xLine(length = 0.39) |> line([0.02, -0.17], %) -|> yLine(-0.15, %) +|> yLine(length = -0.15) |> line([-0.21, -0.02], %) -|> xLine(-0.15, %) +|> xLine(length = -0.15) |> line([-0.02, 0.21], %) |> line([-0.08, 0.05], %) |> lineTo([profileStartX(%), profileStartY(%)], %) @@ -784,11 +784,11 @@ describe('Testing specific sketch getNodeFromPath workflow', () => { const recasted = recast(modifiedAst) const expectedCode = `sketch001 = startSketchOn('XZ') |> startProfileAt([0.02, 0.22], %) - |> xLine(0.39, %) + |> xLine(length = 0.39) |> line([0.02, -0.17], %) - |> yLine(-0.15, %) + |> yLine(length = -0.15) |> line([-0.21, -0.02], %) - |> xLine(-0.15, %) + |> xLine(length = -0.15) |> line([-0.02, 0.21], %) |> line([-0.08, 0.05], %) |> lineTo([profileStartX(%), profileStartY(%)], %) diff --git a/src/lang/std/sketch.test.ts b/src/lang/std/sketch.test.ts index 9121ff6e0..0b4fb7d09 100644 --- a/src/lang/std/sketch.test.ts +++ b/src/lang/std/sketch.test.ts @@ -334,10 +334,10 @@ describe('testing getConstraintInfo', () => { length = 3.14, }, %) |> line(endAbsolute = [6.14, 3.14]) - |> xLineTo(8, %) - |> yLineTo(5, %) - |> yLine(3.14, %, $a) - |> xLine(3.14, %) + |> xLine(endAbsolute = 8) + |> yLine(endAbsolute = 5) + |> yLine(length = 3.14, tag = $a) + |> xLine(length = 3.14) |> angledLineOfXLength({ angle = 3.14, length = 3.14, @@ -708,10 +708,10 @@ describe('testing getConstraintInfo', () => { |> line(end = [3, 4]) |> angledLine([3.14, 3.14], %) |> line(endAbsolute = [6.14, 3.14]) - |> xLineTo(8, %) - |> yLineTo(5, %) - |> yLine(3.14, %, $a) - |> xLine(3.14, %) + |> xLine(endAbsolute = 8) + |> yLine(endAbsolute = 5) + |> yLine(length = 3.14, tag = $a) + |> xLine(length = 3.14) |> angledLineOfXLength([3.14, 3.14], %) |> angledLineOfYLength([30, 3], %) |> angledLineToX([12, 12], %) @@ -865,10 +865,10 @@ describe('testing getConstraintInfo', () => { |> line(end = [3 + 0, 4 + 0]) |> angledLine({ angle = 3.14 + 0, length = 3.14 + 0 }, %) |> line(endAbsolute = [6.14 + 0, 3.14 + 0]) - |> xLineTo(8 + 0, %) - |> yLineTo(5 + 0, %) - |> yLine(3.14 + 0, %, $a) - |> xLine(3.14 + 0, %) + |> xLine(endAbsolute = 8 + 0) + |> yLine(endAbsolute = 5 + 0) + |> yLine(length = 3.14 + 0, tag = $a) + |> xLine(length = 3.14 + 0) |> angledLineOfXLength({ angle = 3.14 + 0, length = 3.14 + 0 }, %) |> angledLineOfYLength({ angle = 30 + 0, length = 3 + 0 }, %) |> angledLineToX({ angle = 12.14 + 0, to = 12 + 0 }, %) diff --git a/src/lang/std/sketchConstraints.test.ts b/src/lang/std/sketchConstraints.test.ts index 81efc18c0..ed938c548 100644 --- a/src/lang/std/sketchConstraints.test.ts +++ b/src/lang/std/sketchConstraints.test.ts @@ -80,10 +80,10 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => { ` |> angledLineOfYLength({ angle = 104, length = 1.58 }, %, $abc5)`, ` |> angledLineToX({ angle = 55, to = -2.89 }, %, $abc6)`, ` |> angledLineToY({ angle = 330, to = 2.53 }, %, $abc7)`, - ` |> xLine(1.47, %, $abc8)`, - ` |> yLine(1.57, %, $abc9)`, - ` |> xLineTo(1.49, %, $abc10)`, - ` |> yLineTo(2.64, %, $abc11)`, + ` |> xLine(length = 1.47, tag = $abc8)`, + ` |> yLine(length = 1.57, tag = $abc9)`, + ` |> xLine(endAbsolute = 1.49, tag = $abc10)`, + ` |> yLine(endAbsolute = 2.64, tag = $abc11)`, ` |> line(endAbsolute = [2.55, 3.58]) // lineTo`, ` |> line(end = [0.73, -0.75])`, ` |> angledLine([63, 1.38], %) // angledLine`, @@ -91,15 +91,15 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => { ` |> angledLineOfYLength([50, 1.35], %) // angledLineOfYLength`, ` |> angledLineToX([291, 6.66], %) // angledLineToX`, ` |> angledLineToY([228, 2.14], %) // angledLineToY`, - ` |> xLine(-1.33, %)`, - ` |> yLine(-1.07, %)`, - ` |> xLineTo(3.27, %)`, - ` |> yLineTo(2.14, %)`, + ` |> xLine(length = -1.33)`, + ` |> yLine(length = -1.07)`, + ` |> xLine(endAbsolute = 3.27)`, + ` |> yLine(endAbsolute = 2.14)`, ] const bigExample = bigExampleArr.join('\n') it('line with tag converts to xLine', async () => { 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({ inputCode: bigExample, callToSwap, @@ -111,7 +111,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => { }) it('line w/o tag converts to xLine', async () => { const callToSwap = 'line(end = [0.73, -0.75])' - const expectedLine = 'xLine(0.73, %)' + const expectedLine = 'xLine(length = 0.73)' const { newCode, originalRange } = await testingSwapSketchFnCall({ inputCode: bigExample, callToSwap, @@ -127,7 +127,7 @@ describe('testing swapping out sketch calls with xLine/xLineTo', () => { callToSwap: 'line(endAbsolute = [1, 1], tag = $abc1)', constraintType: 'horizontal', }) - const expectedLine = 'xLineTo(1, %, $abc1)' + const expectedLine = 'xLine(endAbsolute = 1, tag = $abc1)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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])', constraintType: 'horizontal', }) - const expectedLine = 'xLineTo(2.55, %) // lineTo' + const expectedLine = 'xLine(endAbsolute = 2.55) // lineTo' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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)', constraintType: 'horizontal', }) - const expectedLine = 'xLine(-1.56, %, $abc3)' + const expectedLine = 'xLine(length = -1.56, tag = $abc3)' console.log(newCode) expect(newCode).toContain(expectedLine) // 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], %)', constraintType: 'horizontal', }) - const expectedLine = 'xLine(0.63, %) // angledLine' + const expectedLine = 'xLine(length = 0.63) // angledLine' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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)', 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` expect(newCode).toContain(expectedLine) // 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], %)', constraintType: 'horizontal', }) - const expectedLine = 'xLine(1.15, %) // angledLineOfXLength' + const expectedLine = 'xLine(length = 1.15) // angledLineOfXLength' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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)', constraintType: 'vertical', }) - const expectedLine = 'yLine(1.58, %, $abc5)' + const expectedLine = 'yLine(length = 1.58, tag = $abc5)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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], %)', constraintType: 'vertical', }) - const expectedLine = 'yLine(1.35, %) // angledLineOfYLength' + const expectedLine = 'yLine(length = 1.35) // angledLineOfYLength' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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)', constraintType: 'horizontal', }) - const expectedLine = 'xLineTo(-2.89, %, $abc6)' + const expectedLine = 'xLine(endAbsolute = -2.89, tag = $abc6)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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], %)', constraintType: 'horizontal', }) - const expectedLine = 'xLineTo(6.66, %) // angledLineToX' + const expectedLine = 'xLine(endAbsolute = 6.66) // angledLineToX' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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)', constraintType: 'vertical', }) - const expectedLine = 'yLineTo(2.53, %, $abc7)' + const expectedLine = 'yLine(endAbsolute = 2.53, tag = $abc7)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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], %)', constraintType: 'vertical', }) - const expectedLine = 'yLineTo(2.14, %) // angledLineToY' + const expectedLine = 'yLine(endAbsolute = 2.14) // angledLineToY' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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])', constraintType: 'horizontal', }) - const expectedLine = 'xLine(lineX, %)' + const expectedLine = 'xLine(length = lineX)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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])', constraintType: 'horizontal', }) - const expectedLine = 'xLineTo(lineToX, %)' + const expectedLine = 'xLine(endAbsolute = lineToX)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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], %)', constraintType: 'horizontal', }) - const expectedLine = 'xLine(angledLineOfXLengthX, %)' + const expectedLine = 'xLine(length = angledLineOfXLengthX)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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], %)', constraintType: 'vertical', }) - const expectedLine = 'yLine(-angledLineOfYLengthY, %)' + const expectedLine = 'yLine(length = -angledLineOfYLengthY)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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], %)', constraintType: 'horizontal', }) - const expectedLine = 'xLineTo(angledLineToXx, %)' + const expectedLine = 'xLine(endAbsolute = angledLineToXx)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line 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], %)', constraintType: 'vertical', }) - const expectedLine = 'yLineTo(angledLineToYy, %)' + const expectedLine = 'yLine(endAbsolute = angledLineToYy)' expect(newCode).toContain(expectedLine) // new line should start at the same place as the old line expect(originalRange[0]).toBe(newCode.indexOf(expectedLine)) @@ -366,9 +366,9 @@ describe('testing getSketchSegmentIndexFromSourceRange', () => { part001 = startSketchOn('XY') |> startProfileAt([0, 0.04], %) // segment-in-start |> line(end = [0, 0.4]) - |> xLine(3.48, %) + |> xLine(length = 3.48) |> line(end = [2.14, 1.35]) // normal-segment - |> xLine(3.54, %)` + |> xLine(length = 3.54)` it('normal case works', async () => { const execState = await enginelessExecutor(assertParse(code)) const index = code.indexOf('// normal-segment') - 7 diff --git a/src/lang/std/sketchConstraints.ts b/src/lang/std/sketchConstraints.ts index 06ccc9c5c..7f3049b41 100644 --- a/src/lang/std/sketchConstraints.ts +++ b/src/lang/std/sketchConstraints.ts @@ -94,10 +94,10 @@ export function isSketchVariablesLinked( to check or it finds a match. that way it can find fn calls that are linked to each other through variables eg: 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 = [0.41, baz]) - |> xLine(0.91, %) + |> xLine(length = 0.91) |> angledLine([37, 2], %) const yo = line(end = [myVar, 0.38], tag = part001) |> line(end = [1, 1]) diff --git a/src/lang/std/sketchcombos.test.ts b/src/lang/std/sketchcombos.test.ts index f362efb7d..648a190f3 100644 --- a/src/lang/std/sketchcombos.test.ts +++ b/src/lang/std/sketchcombos.test.ts @@ -59,16 +59,16 @@ describe('testing getConstraintType', () => { }) const helper2 = getConstraintTypeFromSourceHelper2 it('testing xLine', () => { - expect(helper2(`xLine(5, %)`)).toBe('yRelative') + expect(helper2(`xLine(length = 5)`)).toBe('yRelative') }) it('testing yLine', () => { - expect(helper2(`yLine(5, %)`)).toBe('xRelative') + expect(helper2(`yLine(length = 5)`)).toBe('xRelative') }) it('testing xLineTo', () => { - expect(helper2(`xLineTo(5, %)`)).toBe('yAbsolute') + expect(helper2(`xLine(endAbsolute = 5)`)).toBe('yAbsolute') }) it('testing yLineTo', () => { - expect(helper2(`yLineTo(5, %)`)).toBe('xAbsolute') + expect(helper2(`yLine(endAbsolute = 5)`)).toBe('xAbsolute') }) }) @@ -254,10 +254,10 @@ part001 = startSketchOn('XY') |> angledLineOfYLength([myAng, 0.7], %) // ln-angledLineOfYLength-angle should become angledLine |> angledLineOfYLength([35, myVar], %) // ln-angledLineOfYLength-yRelative use legAngY |> angledLineOfYLength([305, myVar], %) // ln-angledLineOfYLength-yRelative with angle > 90 use binExp - |> xLine(1.03, %) // ln-xLine-free should sub in segLen - |> yLine(1.04, %) // ln-yLine-free should sub in segLen - |> xLineTo(30, %) // ln-xLineTo-free should convert to xLine - |> yLineTo(20, %) // ln-yLineTo-free should convert to yLine + |> xLine(length = 1.03) // ln-xLine-free should sub in segLen + |> yLine(length = 1.04) // ln-yLine-free should sub in segLen + |> xLine(endAbsolute = 30) // ln-xLineTo-free should convert to xLine + |> yLine(endAbsolute = 20) // ln-yLineTo-free should convert to yLine ` const expectModifiedScript = `myVar = 3 myVar2 = 5 @@ -326,10 +326,10 @@ part001 = startSketchOn('XY') 270 + legAngY(segLen(seg01), myVar), min(segLen(seg01), myVar) ], %) // ln-angledLineOfYLength-yRelative with angle > 90 use binExp - |> xLine(segLen(seg01), %) // ln-xLine-free should sub in segLen - |> yLine(segLen(seg01), %) // ln-yLine-free should sub in segLen - |> xLine(segLen(seg01), %) // ln-xLineTo-free should convert to xLine - |> yLine(segLen(seg01), %) // ln-yLineTo-free should convert to yLine + |> xLine(length = segLen(seg01)) // ln-xLine-free should sub in segLen + |> yLine(length = segLen(seg01)) // ln-yLine-free should sub in segLen + |> xLine(length = segLen(seg01)) // ln-xLineTo-free should convert to xLine + |> yLine(length = segLen(seg01)) // ln-yLineTo-free should convert to yLine ` it('should transform the ast', async () => { const ast = assertParse(inputScript) @@ -400,25 +400,25 @@ myVar3 = -10 part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) |> 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 - |> 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 - |> xLineTo(5, %) // select for horizontal constraint 3 + |> xLine(endAbsolute = 5) // select for horizontal 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 - |> 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 - |> xLine(-myVar, %) // select for horizontal constraint 6 + |> xLine(length = -myVar) // select for horizontal 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 - |> xLine(-myVar, %) // select for horizontal constraint 8 + |> xLine(length = -myVar) // select for horizontal 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 - |> xLineTo(myVar3, %) // select for horizontal constraint 10 + |> xLine(endAbsolute = myVar3) // select for horizontal constraint 10 |> angledLineToY([301, myVar], %) // select for vertical constraint 10 ` const ast = assertParse(inputScript) @@ -461,25 +461,25 @@ part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) |> line(endAbsolute = [1, 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 - |> 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 - |> 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 - |> yLineTo(myVar2, %) // select for vertical constraint 4 + |> yLine(endAbsolute = myVar2) // select for vertical constraint 4 |> 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 - |> yLine(myVar, %) // select for vertical constraint 6 + |> yLine(length = myVar) // select for vertical constraint 6 |> 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 - |> yLine(-myVar, %) // select for vertical constraint 8 + |> yLine(length = -myVar) // select for vertical constraint 8 |> 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 - |> yLineTo(myVar, %) // select for vertical constraint 10 + |> yLine(endAbsolute = myVar) // select for vertical constraint 10 ` const ast = assertParse(inputScript) @@ -627,19 +627,19 @@ halfArmAngle = armAngle / 2 part001 = startSketchOn('XY') |> startProfileAt([-0.01, -0.05], %) |> line(end = [0.01, 0.94 + 0]) // partial - |> xLine(3.03, %) // partial + |> xLine(length = 3.03) // partial |> angledLine({ angle: halfArmAngle, length: 2.45, }, %, $seg01bing) // partial - |> xLine(4.4, %) // partial - |> yLine(-1, %) // partial - |> xLine(-4.2 + 0, %) // full + |> xLine(length = 4.4) // partial + |> yLine(length = -1) // partial + |> xLine(length = -4.2 + 0) // full |> angledLine([segAng(seg01bing) + 180, 1.79], %) // partial |> line(end = [1.44, -0.74]) // free - |> xLine(3.36, %) // partial + |> xLine(length = 3.36) // partial |> 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` const ast = assertParse(code) const constraintLevels: ConstraintLevel[] = ['full', 'partial', 'free'] diff --git a/src/lib/exampleKcl.ts b/src/lib/exampleKcl.ts index db7cbb423..b181c4795 100644 --- a/src/lib/exampleKcl.ts +++ b/src/lib/exampleKcl.ts @@ -21,11 +21,11 @@ mountingHoleDiameter = 0.5 sketch001 = startSketchOn('XZ') |> startProfileAt([0, 0], %) - |> xLine(shelfMountL - thickness, %, $seg01) - |> yLine(thickness, %, $seg02) - |> xLine(-shelfMountL, %, $seg03) - |> yLine(-wallMountL, %, $seg04) - |> xLine(thickness, %, $seg05) + |> xLine(length = shelfMountL - thickness, tag = $seg01) + |> yLine(length = thickness, tag = $seg02) + |> xLine(length = -shelfMountL, tag = $seg03) + |> yLine(length = -wallMountL, tag = $seg04) + |> xLine(length = thickness, tag = $seg05) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg06) |> close() |> extrude(%, length = width) diff --git a/src/lib/selections.test.ts b/src/lib/selections.test.ts index 391e05a28..14760d755 100644 --- a/src/lib/selections.test.ts +++ b/src/lib/selections.test.ts @@ -16,9 +16,9 @@ beforeAll(async () => { describe('testing source range to artifact conversion', () => { const MY_CODE = `sketch001 = startSketchOn('XZ') profile001 = startProfileAt([105.55, 105.55], sketch001) - |> xLine(332.55, %, $seg01) - |> yLine(-310.12, %, $seg02) - |> xLine(-373.65, %) + |> xLine(length = 332.55, tag = $seg01) + |> yLine(length = -310.12, tag = $seg02) + |> xLine(length = -373.65) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() extrude001 = extrude(profile001, length = 500) @@ -1126,7 +1126,7 @@ profile004 = circle({ [ 'segment 2', { - snippet: 'yLine(-310.12, %, $seg02)', + snippet: 'yLine(length = -310.12, tag = $seg02)', artifactDetails: { type: 'segment', range: [149, 149, 0], diff --git a/src/wasm-lib/kcl/src/execution/mod.rs b/src/wasm-lib/kcl/src/execution/mod.rs index bd0b16f72..9676be4f4 100644 --- a/src/wasm-lib/kcl/src/execution/mod.rs +++ b/src/wasm-lib/kcl/src/execution/mod.rs @@ -987,7 +987,7 @@ const objExpShouldNotBeIncluded = { a: 1, b: 2, c: 3 } const part001 = startSketchOn('XY') |> startProfileAt([0, 0], %) - |> yLineTo(1, %) + |> yLine(endAbsolute = 1) |> xLine(length = 3.84) // selection-range-7ish-before-this const variableBelowShouldNotBeIncluded = 3 @@ -1723,7 +1723,7 @@ let w = f() + f() let code = r#"sketch001 = startSketchOn('XZ') |> startProfileAt([61.74, 206.13], %) |> xLine(length = 305.11, tag = $seg01) -|> yLine(-291.85, %) +|> yLine(length = -291.85) |> xLine(length = -segLen(seg01)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -1748,7 +1748,7 @@ let w = f() + f() let code = r#"sketch001 = startSketchOn('XZ') |> startProfileAt([62.74, 206.13], %) |> xLine(length = 305.11, tag = $seg01) -|> yLine(-291.85, %) +|> yLine(length = -291.85) |> xLine(length = -segLen(seg01)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -1774,7 +1774,7 @@ let w = f() + f() let code = r#"sketch001 = startSketchOn('XZ') |> startProfileAt([61.74, 206.13], %) |> xLine(length = 305.11, tag = $seg01) -|> yLine(-291.85, %) +|> yLine(length = -291.85) |> xLine(length = -segLen(seg01)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() diff --git a/src/wasm-lib/kcl/src/parsing/parser.rs b/src/wasm-lib/kcl/src/parsing/parser.rs index 5a9fde800..c38aa7862 100644 --- a/src/wasm-lib/kcl/src/parsing/parser.rs +++ b/src/wasm-lib/kcl/src/parsing/parser.rs @@ -4202,7 +4202,7 @@ e /// angle = 30, /// length = 3 / cos(toRadians(30)), /// }, %) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close(%) /// /// example = extrude(5, exampleSketch) diff --git a/src/wasm-lib/kcl/src/std/math.rs b/src/wasm-lib/kcl/src/std/math.rs index b25c19f91..589417a9d 100644 --- a/src/wasm-lib/kcl/src/std/math.rs +++ b/src/wasm-lib/kcl/src/std/math.rs @@ -108,7 +108,7 @@ pub async fn sqrt(_exec_state: &mut ExecState, args: Args) -> Result yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 5) @@ -173,7 +173,7 @@ pub async fn round(_exec_state: &mut ExecState, args: Args) -> Result startProfileAt([0, 0], %) /// |> line(endAbsolute = [12, 10]) /// |> line(end = [round(7.02986), 0]) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// extrude001 = extrude(sketch001, length = 5) @@ -201,7 +201,7 @@ pub async fn floor(_exec_state: &mut ExecState, args: Args) -> Result startProfileAt([0, 0], %) /// |> line(endAbsolute = [12, 10]) /// |> line(end = [floor(7.02986), 0]) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// extrude001 = extrude(sketch001, length = 5) @@ -229,7 +229,7 @@ pub async fn ceil(_exec_state: &mut ExecState, args: Args) -> Result startProfileAt([0, 0], %) /// |> line(endAbsolute = [12, 10]) /// |> line(end = [ceil(7.02986), 0]) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// extrude001 = extrude(sketch001, length = 5) @@ -347,7 +347,7 @@ pub async fn pow(_exec_state: &mut ExecState, args: Args) -> Result yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 5) @@ -408,7 +408,7 @@ pub async fn asin(_exec_state: &mut ExecState, args: Args) -> Result yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// extrude001 = extrude(sketch001, length = 5) @@ -438,7 +438,7 @@ pub async fn atan(_exec_state: &mut ExecState, args: Args) -> Result yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// extrude001 = extrude(sketch001, length = 5) @@ -468,7 +468,7 @@ pub async fn atan2(_exec_state: &mut ExecState, args: Args) -> Result yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// extrude001 = extrude(sketch001, length = 5) @@ -632,7 +632,7 @@ pub async fn e(_exec_state: &mut ExecState, args: Args) -> Result yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 10) @@ -664,7 +664,7 @@ pub async fn tau(_exec_state: &mut ExecState, args: Args) -> Result yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 5) @@ -695,7 +695,7 @@ pub async fn to_radians(_exec_state: &mut ExecState, args: Args) -> Result yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 5) @@ -725,7 +725,7 @@ pub async fn to_degrees(_exec_state: &mut ExecState, args: Args) -> Result yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 5) diff --git a/src/wasm-lib/kcl/src/std/segment.rs b/src/wasm-lib/kcl/src/std/segment.rs index 40d0418c4..0d24d1ff4 100644 --- a/src/wasm-lib/kcl/src/std/segment.rs +++ b/src/wasm-lib/kcl/src/std/segment.rs @@ -657,7 +657,7 @@ pub async fn angle_to_match_length_y(exec_state: &mut ExecState, args: Args) -> /// angle = angleToMatchLengthY(seg01, 15, %), /// length = 5, /// }, %) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// extrusion = extrude(sketch001, length = 5) diff --git a/src/wasm-lib/kcl/src/unparser.rs b/src/wasm-lib/kcl/src/unparser.rs index 8e9a63e4d..a61f14f79 100644 --- a/src/wasm-lib/kcl/src/unparser.rs +++ b/src/wasm-lib/kcl/src/unparser.rs @@ -950,7 +950,7 @@ fn rect(x, y, w, h) { startSketchOn('XY') |> startProfileAt([x, y], %) |> xLine(length = w) - |> yLine(h, %) + |> yLine(length = h) |> xLine(length = -w) |> close() |> extrude(d, %) @@ -969,9 +969,9 @@ fn quad(x1, y1, x2, y2, x3, y3, x4, y4) { fn crosshair(x, y) { startSketchOn('XY') |> startProfileAt([x, y], %) - |> yLine(1, %) - |> yLine(-2, %) - |> yLine(1, %) + |> yLine(length = 1) + |> yLine(length = -2) + |> yLine(length = 1) |> xLine(length = 1) |> xLine(length = -2) } diff --git a/src/wasm-lib/kcl/std/math.kcl b/src/wasm-lib/kcl/std/math.kcl index b53b28fb5..d4eb5219b 100644 --- a/src/wasm-lib/kcl/std/math.kcl +++ b/src/wasm-lib/kcl/std/math.kcl @@ -21,7 +21,7 @@ export PI = 3.14159265358979323846264338327950288_ /// angle = 30, /// length = 2 * E ^ 2, /// }, %) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 10) @@ -37,7 +37,7 @@ export E = 2.71828182845904523536028747135266250_ /// angle = 50, /// length = 10 * TAU, /// }, %) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 5) @@ -53,7 +53,7 @@ export TAU = 6.28318530717958647692528676655900577_ /// angle = 30, /// length = 3 / cos(toRadians(30)), /// }, %) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 5) @@ -70,7 +70,7 @@ export fn cos(num: number(rad)): number(_) {} /// angle = 50, /// length = 15 / sin(toDegrees(135)), /// }, %) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 5) @@ -87,7 +87,7 @@ export fn sin(num: number(rad)): number(_) {} /// angle = 50, /// length = 50 * tan(1/2), /// }, %) -/// |> yLineTo(0, %) +/// |> yLine(endAbsolute = 0) /// |> close() /// /// example = extrude(exampleSketch, length = 5) diff --git a/src/wasm-lib/kcl/tests/i_shape/input.kcl b/src/wasm-lib/kcl/tests/i_shape/input.kcl index 9c89090b0..8fd8605bf 100644 --- a/src/wasm-lib/kcl/tests/i_shape/input.kcl +++ b/src/wasm-lib/kcl/tests/i_shape/input.kcl @@ -10,38 +10,38 @@ corner_radius = 5.0 brace_base = startSketchAt([corner_radius, 0]) |> line(end = [width - corner_radius, 0.0]) |> tangentialArcToRelative([corner_radius, corner_radius], %) - |> yLine(25.0 - corner_radius, %) + |> yLine(length = 25.0 - corner_radius) |> tangentialArcToRelative([-corner_radius, corner_radius], %) |> xLine(length = -(d_wrist_circumference[0] - (corner_radius * 2))) |> 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], %) |> xLine(length = 15.0 - (corner_radius * 2)) |> tangentialArcToRelative([corner_radius, corner_radius], %) - |> yLine(23.0 - corner_radius, %) + |> yLine(length = 23.0 - corner_radius) |> tangentialArcToRelative([-corner_radius, corner_radius], %) |> xLine(length = -(hand_thickness + 15.0 + 15.0 - (corner_radius * 2))) |> tangentialArcToRelative([-corner_radius, -corner_radius], %) - |> yLine(-(23.0 - corner_radius), %) + |> yLine(length = -(23.0 - corner_radius)) |> tangentialArcToRelative([corner_radius, -corner_radius], %) |> xLine(length = 15.0 - (corner_radius * 2)) |> 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], %) |> xLine(length = -(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius)) |> tangentialArcToRelative([-corner_radius, -corner_radius], %) - |> yLine(-(25.0 - corner_radius), %) + |> yLine(length = -(25.0 - corner_radius)) |> tangentialArcToRelative([corner_radius, -corner_radius], %) |> close(%) inner = startSketchAt([0, 0]) |> xLine(length = 1.0) |> tangentialArcToRelative([corner_radius, corner_radius], %) - |> yLine(25.0 - (corner_radius * 2), %) + |> yLine(length = 25.0 - (corner_radius * 2)) |> tangentialArcToRelative([-corner_radius, corner_radius], %) |> xLine(length = -1.0) |> tangentialArcToRelative([-corner_radius, -corner_radius], %) - |> yLine(-(25.0 - (corner_radius * 2)), %) + |> yLine(length = -(25.0 - (corner_radius * 2))) |> tangentialArcToRelative([corner_radius, -corner_radius], %) |> close(%) diff --git a/src/wasm-lib/kcl/tests/poop_chute/input.kcl b/src/wasm-lib/kcl/tests/poop_chute/input.kcl index 825d9843b..98c9d9155 100644 --- a/src/wasm-lib/kcl/tests/poop_chute/input.kcl +++ b/src/wasm-lib/kcl/tests/poop_chute/input.kcl @@ -13,9 +13,9 @@ sketch001 = startSketchOn('-YZ') |> startProfileAt([back_walls_width / 2, 0], %) |> xLine(length = wall_thickness / 2) |> angledLineToX({ angle = 45, to = back_walls_width }, %, $seg01) - |> yLineTo(height, %) + |> yLine(endAbsolute = height) |> xLine(length = -wall_thickness) - |> yLineTo(segEndY(seg01), %) + |> yLine(endAbsolute = segEndY(seg01)) |> angledLineToX({ angle = 45, to = back_walls_width / 2 + wall_thickness / 2 @@ -25,9 +25,9 @@ sketch001 = startSketchOn('-YZ') angle = 180 - 45, to = wall_thickness }, %) - |> yLineTo(height, %) + |> yLine(endAbsolute = height) |> xLine(endAbsolute = 0) - |> yLineTo(segEndY(seg01), %) + |> yLine(endAbsolute = segEndY(seg01)) |> angledLineToY({ angle = 180 - 45, to = 0 }, %) |> close(%) part001 = revolve({ @@ -44,9 +44,9 @@ sketch002 = startSketchOn('-YZ') |> startProfileAt([back_walls_width / 2, 0], %) |> xLine(length = wall_thickness / 2) |> angledLineToX({ angle = 45, to = back_walls_width }, %, $seg02) - |> yLineTo(height, %) + |> yLine(endAbsolute = height) |> xLine(length = -wall_thickness) - |> yLineTo(segEndY(seg01), %) + |> yLine(endAbsolute = segEndY(seg01)) |> angledLineToX({ angle = 45, to = back_walls_width / 2 + wall_thickness / 2 @@ -56,9 +56,9 @@ sketch002 = startSketchOn('-YZ') angle = 180 - 45, to = wall_thickness }, %) - |> yLineTo(height, %) + |> yLine(endAbsolute = height) |> xLine(endAbsolute = 0) - |> yLineTo(segEndY(seg02), %) + |> yLine(endAbsolute = segEndY(seg02)) |> angledLineToY({ angle = 180 - 45, to = 0 }, %) |> close(%) |> extrude(length = back_length - height) diff --git a/src/wasm-lib/kcl/tests/ssi_pattern/input.kcl b/src/wasm-lib/kcl/tests/ssi_pattern/input.kcl index fd7b10e98..71cb39ed6 100644 --- a/src/wasm-lib/kcl/tests/ssi_pattern/input.kcl +++ b/src/wasm-lib/kcl/tests/ssi_pattern/input.kcl @@ -1,9 +1,9 @@ sketch001 = startSketchOn('XZ') |> startProfileAt([-4.35, -12.26], %) - |> yLine(10.2, %) + |> yLine(length = 10.2) |> line(end = [0.54, -0.03]) |> tangentialArcTo([20.4, 14.61], %) - |> yLine(-26.76, %) + |> yLine(length = -26.76) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01) |> close() diff --git a/src/wasm-lib/tests/executor/inputs/i_shape.kcl b/src/wasm-lib/tests/executor/inputs/i_shape.kcl index 55d79db06..d09944209 100644 --- a/src/wasm-lib/tests/executor/inputs/i_shape.kcl +++ b/src/wasm-lib/tests/executor/inputs/i_shape.kcl @@ -10,38 +10,38 @@ let corner_radius = 5.0 let brace_base = startSketchAt([corner_radius, 0]) |> line(end = [width - corner_radius, 0.0]) |> tangentialArcToRelative([corner_radius, corner_radius], %) - |> yLine(25.0 - corner_radius, %) + |> yLine(length = 25.0 - corner_radius) |> tangentialArcToRelative([-corner_radius, corner_radius], %) |> xLine(length = -(d_wrist_circumference[0] - (corner_radius * 2))) |> 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], %) |> xLine(length = 15.0 - (corner_radius * 2)) |> tangentialArcToRelative([corner_radius, corner_radius], %) - |> yLine(23.0 - corner_radius, %) + |> yLine(length = 23.0 - corner_radius) |> tangentialArcToRelative([-corner_radius, corner_radius], %) |> xLine(length = -(hand_thickness + 15.0 + 15.0 - (corner_radius * 2))) |> tangentialArcToRelative([-corner_radius, -corner_radius], %) - |> yLine(-(23.0 - corner_radius), %) + |> yLine(length = -(23.0 - corner_radius)) |> tangentialArcToRelative([corner_radius, -corner_radius], %) |> xLine(length = 15.0 - (corner_radius * 2)) |> 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], %) |> xLine(length = -(d_wrist_circumference[1] + d_wrist_circumference[2] + d_wrist_circumference[3] - hand_thickness - corner_radius)) |> tangentialArcToRelative([-corner_radius, -corner_radius], %) - |> yLine(-(25.0 - corner_radius), %) + |> yLine(length = -(25.0 - corner_radius)) |> tangentialArcToRelative([corner_radius, -corner_radius], %) |> close() let inner = startSketchAt([0, 0]) |> xLine(length = 1.0) |> tangentialArcToRelative([corner_radius, corner_radius], %) - |> yLine(25.0 - (corner_radius * 2), %) + |> yLine(length = 25.0 - (corner_radius * 2)) |> tangentialArcToRelative([-corner_radius, corner_radius], %) |> xLine(length = -1.0) |> tangentialArcToRelative([-corner_radius, -corner_radius], %) - |> yLine(-(25.0 - (corner_radius * 2)), %) + |> yLine(length = -(25.0 - (corner_radius * 2))) |> tangentialArcToRelative([corner_radius, -corner_radius], %) |> close() diff --git a/src/wasm-lib/tests/executor/inputs/poop_chute.kcl b/src/wasm-lib/tests/executor/inputs/poop_chute.kcl index ecf361479..f5ad1b805 100644 --- a/src/wasm-lib/tests/executor/inputs/poop_chute.kcl +++ b/src/wasm-lib/tests/executor/inputs/poop_chute.kcl @@ -13,18 +13,18 @@ sketch001 = startSketchOn('-YZ') |> startProfileAt([back_walls_width / 2, 0], %) |> xLine(length = wall_thickness / 2) |> angledLineToX({ angle: 45, to: back_walls_width }, %, $seg01) - |> yLineTo(height, %) + |> yLine(endAbsolute = height) |> xLine(length = -wall_thickness) - |> yLineTo(segEndY(seg01), %) + |> yLine(endAbsolute = segEndY(seg01)) |> angledLineToX({ angle: 45, to: back_walls_width / 2 + wall_thickness / 2 }, %) |> xLine(length = -wall_thickness) |> angledLineToX({ angle: 180 - 45, to: wall_thickness }, %) - |> yLineTo(height, %) + |> yLine(endAbsolute = height) |> xLine(endAbsolute = 0) - |> yLineTo(segEndY(seg01), %) + |> yLine(endAbsolute = segEndY(seg01)) |> angledLineToY({ angle: 180 - 45, to: 0 }, %) |> close() part001 = revolve({ @@ -41,18 +41,18 @@ sketch002 = startSketchOn('-YZ') |> startProfileAt([back_walls_width / 2, 0], %) |> xLine(length = wall_thickness / 2) |> angledLineToX({ angle: 45, to: back_walls_width }, %, $seg02) - |> yLineTo(height, %) + |> yLine(endAbsolute = height) |> xLine(length = -wall_thickness) - |> yLineTo(segEndY(seg01), %) + |> yLine(endAbsolute = segEndY(seg01)) |> angledLineToX({ angle: 45, to: back_walls_width / 2 + wall_thickness / 2 }, %) |> xLine(length = -wall_thickness) |> angledLineToX({ angle: 180 - 45, to: wall_thickness }, %) - |> yLineTo(height, %) + |> yLine(endAbsolute = height) |> xLine(endAbsolute = 0) - |> yLineTo(segEndY(seg02), %) + |> yLine(endAbsolute = segEndY(seg02)) |> angledLineToY({ angle: 180 - 45, to: 0 }, %) |> close() |> extrude(length = back_length - height) \ No newline at end of file diff --git a/src/wasm-lib/tests/executor/inputs/router-template-slate.kcl b/src/wasm-lib/tests/executor/inputs/router-template-slate.kcl index 87ae33cf1..19c4a9382 100644 --- a/src/wasm-lib/tests/executor/inputs/router-template-slate.kcl +++ b/src/wasm-lib/tests/executor/inputs/router-template-slate.kcl @@ -17,14 +17,14 @@ const sketch001 = startSketchOn('XZ') angleStart: 90, radius: radius - templateGap }, %) - |> yLineTo(-templateGap * 2 - (templateDiameter / 2), %, $seg05) + |> yLine(endAbsolute = -templateGap * 2 - (templateDiameter / 2), tag = $seg05) |> xLineTo(endAbsolute = slateWidthHalf + templateThickness, tag = $seg04) - |> yLine(-length002, %, $seg03) + |> yLine(length = -length002, tag = $seg03) |> xLineTo(endAbsolute = 0, tag = $seg02) - |> xLine(length = -segLen(seg02), %) - |> yLine(segLen(seg03, %), %) - |> xLine(length = segLen(seg04), %) - |> yLine(segLen(seg05, %), %) + |> xLine(length = length = -segLen(seg02)) + |> yLine(length = segLen(seg03, %)) + |> xLine(length = length = segLen(seg04)) + |> yLine(length = segLen(seg05, %)) |> arc({ angleEnd: 90, angleStart: 180, diff --git a/src/wasm-lib/tests/executor/inputs/server-rack-heavy.kcl b/src/wasm-lib/tests/executor/inputs/server-rack-heavy.kcl index 8e660809c..0eae9505d 100644 --- a/src/wasm-lib/tests/executor/inputs/server-rack-heavy.kcl +++ b/src/wasm-lib/tests/executor/inputs/server-rack-heavy.kcl @@ -26,7 +26,7 @@ fn caster = (originStart) => { const sketch001c = startSketchOn(plane001c) |> startProfileAt([0, 0], %) |> xLine(length = 3.543) - |> yLine(3.543, %) + |> yLine(length = 3.543) |> xLine(length = -3.543) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -119,12 +119,12 @@ const extrude001l = extrude(sketch001l, length = 1) const sketch002l = startSketchOn(plane001) |> startProfileAt([serverDepth + .8, 0], %) - |> yLine(railHeight * 1.75 + 2, %) + |> yLine(length = railHeight * 1.75 + 2) |> angledLineToX({ angle: -135, to: serverDepth - 1 + .8 }, %) - |> yLine(-railHeight * 1.75, %) + |> yLine(length = -railHeight * 1.75) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() const extrude002l = extrude(sketch002l, length = 1) @@ -146,12 +146,12 @@ const extrude003l = extrude(sketch003l, length = 1) const sketch004l = startSketchOn(plane001) |> startProfileAt([0, 0], %) - |> yLine(railHeight * 1.75 + 2, %) + |> yLine(length = railHeight * 1.75 + 2) |> angledLineToY({ angle: 135, to: railHeight * 1.75 + 2 - 1 }, %) - |> yLine(-railHeight * 1.75, %) + |> yLine(length = -railHeight * 1.75) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() const extrude004l = extrude(sketch004l, length = 1) @@ -222,9 +222,9 @@ const extrude001w = extrude(sketch001w, length = 1) const sketch002w = startSketchOn(plane002) |> startProfileAt([depth, 0], %) - |> yLine(railHeight * 1.75 + 2, %) + |> yLine(length = railHeight * 1.75 + 2) |> angledLineToX({ angle: -135, to: depth - 1 }, %) - |> yLine(-railHeight * 1.75, %) + |> yLine(length = -railHeight * 1.75) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() const extrude002w = extrude(sketch002w, length = 1) @@ -243,12 +243,12 @@ const extrude003w = extrude(sketch003w, length = 1) const sketch004w = startSketchOn(plane002) |> startProfileAt([0, 0], %) - |> yLine(railHeight * 1.75 + 2, %) + |> yLine(length = railHeight * 1.75 + 2) |> angledLineToY({ angle: 135, to: railHeight * 1.75 + 2 - 1 }, %) - |> yLine(-railHeight * 1.75, %) + |> yLine(length = -railHeight * 1.75) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() 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 ], %) |> angledLineToX({ angle: -23 + 90, to: depth - 1 }, %) - |> yLine(2.56, %) + |> yLine(length = 2.56) |> angledLineThatIntersects({ angle: -23 + 90 + 180, intersectTag: lineToIntersect, @@ -357,7 +357,7 @@ const sketch013w = startSketchOn(plane002) ], %) |> angledLine({ angle: -23, length: 1 }, %) |> angledLineToX({ angle: -23 + 90, to: 1 }, %) - |> yLine(2.56, %) + |> yLine(length = 2.56) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() const extrude013w = extrude(sketch013w, length = 1) @@ -462,7 +462,7 @@ const extrude020w = extrude(sketch020w, length = 1) const sketch021w = startSketchOn(plane002) |> startProfileAt([1, 21.9], %) |> angledLineToX({ angle: -23, to: depth - 1 }, %) - |> yLine(-1.1, %) + |> yLine(length = -1.1) |> angledLineToX({ angle: -23, to: 1 }, %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -691,7 +691,7 @@ const sketch003fl = startSketchOn(planeXYfl) angleEnd: 270, radius: bendRad }, %) - |> yLine(-thickness, %) + |> yLine(length = -thickness) |> close() const extrude003fl = extrude(sketch003fl, length = railHeight * 1.75) @@ -965,7 +965,7 @@ const sketch003fr = startSketchOn(planeXYfr) angleEnd: -90, radius: bendRad }, %) - |> yLine(-thickness, %) + |> yLine(length = -thickness) |> arc({ angleStart: -90, angleEnd: 0, @@ -1259,7 +1259,7 @@ const sketch003rr = startSketchOn(planeXYrr) angleEnd: 90, radius: bendRad+thickness }, %) - |> yLine(-thickness, %) + |> yLine(length = -thickness) |> arc({ angleStart: 90, angleEnd: 0, @@ -1808,23 +1808,23 @@ fn streamServer = (serverPos) => { const sketch002s = startSketchOn(planeXZs) |> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %) - |> yLine(6.98, %) + |> yLine(length = 6.98) |> xLine(length = 0.2) - |> yLine(-0.36, %) + |> yLine(length = -0.36) |> xLine(length = 0.5) |> tangentialArcTo([ 0.3, 17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114 ], %) - |> yLine(-1.77, %) + |> yLine(length = -1.77) |> tangentialArcTo([ -0.13, 14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114 ], %) |> xLine(length = -0.52) - |> yLine(-0.42, %) + |> yLine(length = -0.42) |> line(end = [0.34, -0.15]) - |> yLine(-2.97, %) + |> yLine(length = -2.97) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -1832,23 +1832,23 @@ fn streamServer = (serverPos) => { const sketch003s = startSketchOn(planeXZs2) |> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %) - |> yLine(6.98, %) + |> yLine(length = 6.98) |> xLine(length = 0.2) - |> yLine(-0.36, %) + |> yLine(length = -0.36) |> xLine(length = 0.5) |> tangentialArcTo([ 0.3, 17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114 ], %) - |> yLine(-1.77, %) + |> yLine(length = -1.77) |> tangentialArcTo([ -0.13, 14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114 ], %) |> xLine(length = -0.52) - |> yLine(-0.42, %) + |> yLine(length = -0.42) |> line(end = [0.34, -0.15]) - |> yLine(-2.97, %) + |> yLine(length = -2.97) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() diff --git a/src/wasm-lib/tests/executor/inputs/server-rack-lite.kcl b/src/wasm-lib/tests/executor/inputs/server-rack-lite.kcl index 9639fec2b..39d9329de 100644 --- a/src/wasm-lib/tests/executor/inputs/server-rack-lite.kcl +++ b/src/wasm-lib/tests/executor/inputs/server-rack-lite.kcl @@ -24,7 +24,7 @@ fn caster = (originStart) => { const sketch001c = startSketchOn(plane001c) |> startProfileAt([0, 0], %) |> xLine(length = 3.543) - |> yLine(3.543, %) + |> yLine(length = 3.543) |> xLine(length = -3.543) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -117,12 +117,12 @@ const extrude001l = extrude(sketch001l, length = 1) const sketch002l = startSketchOn(plane001) |> startProfileAt([serverDepth + .8, 0], %) - |> yLine(railHeight * 1.75 + 2, %) + |> yLine(length = railHeight * 1.75 + 2) |> angledLineToX({ angle: -135, to: serverDepth - 1 + .8 }, %) - |> yLine(-railHeight * 1.75, %) + |> yLine(length = -railHeight * 1.75) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() const extrude002l = extrude(sketch002l, length = 1) @@ -144,12 +144,12 @@ const extrude003l = extrude(sketch003l, length = 1) const sketch004l = startSketchOn(plane001) |> startProfileAt([0, 0], %) - |> yLine(railHeight * 1.75 + 2, %) + |> yLine(length = railHeight * 1.75 + 2) |> angledLineToY({ angle: 135, to: railHeight * 1.75 + 2 - 1 }, %) - |> yLine(-railHeight * 1.75, %) + |> yLine(length = -railHeight * 1.75) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() const extrude004l = extrude(sketch004l, length = 1) @@ -220,9 +220,9 @@ const extrude001w = extrude(sketch001w, length = 1) const sketch002w = startSketchOn(plane002) |> startProfileAt([depth, 0], %) - |> yLine(railHeight * 1.75 + 2, %) + |> yLine(length = railHeight * 1.75 + 2) |> angledLineToX({ angle: -135, to: depth - 1 }, %) - |> yLine(-railHeight * 1.75, %) + |> yLine(length = -railHeight * 1.75) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() const extrude002w = extrude(sketch002w, length = 1) @@ -241,12 +241,12 @@ const extrude003w = extrude(sketch003w, length = 1) const sketch004w = startSketchOn(plane002) |> startProfileAt([0, 0], %) - |> yLine(railHeight * 1.75 + 2, %) + |> yLine(length = railHeight * 1.75 + 2) |> angledLineToY({ angle: 135, to: railHeight * 1.75 + 2 - 1 }, %) - |> yLine(-railHeight * 1.75, %) + |> yLine(length = -railHeight * 1.75) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() 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 ], %) |> angledLineToX({ angle: -23 + 90, to: depth - 1 }, %) - |> yLine(2.56, %) + |> yLine(length = 2.56) |> angledLineThatIntersects({ angle: -23 + 90 + 180, intersectTag: lineToIntersect, @@ -355,7 +355,7 @@ const sketch013w = startSketchOn(plane002) ], %) |> angledLine({ angle: -23, length: 1 }, %) |> angledLineToX({ angle: -23 + 90, to: 1 }, %) - |> yLine(2.56, %) + |> yLine(length = 2.56) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() const extrude013w = extrude(sketch013w, length = 1) @@ -460,7 +460,7 @@ const extrude020w = extrude(sketch020w, length = 1) const sketch021w = startSketchOn(plane002) |> startProfileAt([1, 21.9], %) |> angledLineToX({ angle: -23, to: depth - 1 }, %) - |> yLine(-1.1, %) + |> yLine(length = -1.1) |> angledLineToX({ angle: -23, to: 1 }, %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -700,7 +700,7 @@ const sketch003fl = startSketchOn(planeXYfl) angleEnd: 270, radius: bendRad }, %) - |> yLine(-thickness, %) + |> yLine(length = -thickness) |> close() const extrude003fl = extrude(sketch003fl, length = railHeight * 1.75) @@ -845,7 +845,7 @@ const sketch003fr = startSketchOn(planeXYfr) angleEnd: -90, radius: bendRad }, %) - |> yLine(-thickness, %) + |> yLine(length = -thickness) |> arc({ angleStart: -90, angleEnd: 0, @@ -995,7 +995,7 @@ const sketch003rr = startSketchOn(planeXYrr) angleEnd: 90, radius: bendRad + thickness }, %) - |> yLine(-thickness, %) + |> yLine(length = -thickness) |> arc({ angleStart: 90, angleEnd: 0, @@ -1255,23 +1255,23 @@ fn streamServer = (serverPos) => { const sketch002s = startSketchOn(planeXZs) |> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %) - |> yLine(6.98, %) + |> yLine(length = 6.98) |> xLine(length = 0.2) - |> yLine(-0.36, %) + |> yLine(length = -0.36) |> xLine(length = 0.5) |> tangentialArcTo([ 0.3, 17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114 ], %) - |> yLine(-1.77, %) + |> yLine(length = -1.77) |> tangentialArcTo([ -0.13, 14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114 ], %) |> xLine(length = -0.52) - |> yLine(-0.42, %) + |> yLine(length = -0.42) |> line(end = [0.34, -0.15]) - |> yLine(-2.97, %) + |> yLine(length = -2.97) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -1279,23 +1279,23 @@ fn streamServer = (serverPos) => { const sketch003s = startSketchOn(planeXZs2) |> startProfileAt([-1, 4.114 + 1 + serverPos * 1.75], %) - |> yLine(6.98, %) + |> yLine(length = 6.98) |> xLine(length = 0.2) - |> yLine(-0.36, %) + |> yLine(length = -0.36) |> xLine(length = 0.5) |> tangentialArcTo([ 0.3, 17.15 + 4.114 + 1 + serverPos * 1.75 - 11.114 ], %) - |> yLine(-1.77, %) + |> yLine(length = -1.77) |> tangentialArcTo([ -0.13, 14.89 + 4.114 + 1 + serverPos * 1.75 - 11.114 ], %) |> xLine(length = -0.52) - |> yLine(-0.42, %) + |> yLine(length = -0.42) |> line(end = [0.34, -0.15]) - |> yLine(-2.97, %) + |> yLine(length = -2.97) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() diff --git a/src/wasm-lib/tests/executor/main.rs b/src/wasm-lib/tests/executor/main.rs index 28e399311..721581b8c 100644 --- a/src/wasm-lib/tests/executor/main.rs +++ b/src/wasm-lib/tests/executor/main.rs @@ -1541,7 +1541,7 @@ async fn kcl_test_shell_with_tag() { let code = r#"sketch001 = startSketchOn('XZ') |> startProfileAt([61.74, 206.13], %) |> xLine(length = 305.11, tag = $seg01) - |> yLine(-291.85, %) + |> yLine(length = -291.85) |> xLine(length = -segLen(seg01)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close() @@ -2005,7 +2005,7 @@ async fn kcl_test_error_no_auth_websocket() { let code = r#"const sketch001 = startSketchOn('XZ') |> startProfileAt([61.74, 206.13], %) |> xLine(length = 305.11, tag = $seg01) - |> yLine(-291.85, %) + |> yLine(length = -291.85) |> xLine(length = -segLen(seg01)) |> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> close()