Update e2e test code with new syntax

This commit is contained in:
Adam Chalmers
2025-01-21 13:11:37 -06:00
committed by Nick Cameron
parent 8e343a254f
commit 1227b38e12
23 changed files with 192 additions and 191 deletions

View File

@ -23,7 +23,7 @@ test.describe('Code pane and errors', () => {
|> line(end = [10, 0]) |> line(end = [10, 0])
|> line(end = [-5, 10]) |> line(end = [-5, 10])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 5)` extrude001 = extrude(sketch001, length = 5)`
) )
}) })

View File

@ -17,7 +17,7 @@ test.describe('Command bar tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> xLine(-20, %) |> xLine(-20, %)
|> close(%) |> close()
` `
) )
}) })
@ -32,7 +32,7 @@ test.describe('Command bar tests', () => {
await u.closeDebugPanel() await u.closeDebugPanel()
// Click the line of code for xLine. // Click the line of code for xLine.
await page.getByText(`close(%)`).click() // TODO remove this and reinstate // await topHorzSegmentClick() await page.getByText(`close()`).click() // TODO remove this and reinstate // await topHorzSegmentClick()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByRole('button', { name: 'Extrude' }).click() await page.getByRole('button', { name: 'Extrude' }).click()
@ -69,7 +69,7 @@ test.describe('Command bar tests', () => {
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()
const selectSegment = () => page.getByText(`line([0, -10], %)`).click() const selectSegment = () => page.getByText(`line(end = [0, -10])`).click()
await selectSegment() await selectSegment()
await page.waitForTimeout(100) await page.waitForTimeout(100)
@ -226,7 +226,7 @@ test.describe('Command bar tests', () => {
|> line(end = [25.1, 0.41]) |> line(end = [25.1, 0.41])
|> line(end = [0.73, -20.93]) |> line(end = [0.73, -20.93])
|> line(end = [-23.44, 0.52]) |> line(end = [-23.44, 0.52])
|> close(%) |> close()
` `
) )
}) })

View File

@ -20,7 +20,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -29,7 +29,7 @@ test.describe('Copilot ghost text', () => {
// We should be able to hit Tab to accept the completion. // We should be able to hit Tab to accept the completion.
await page.keyboard.press('Tab') await page.keyboard.press('Tab')
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
// Hit enter a few times. // Hit enter a few times.
@ -37,7 +37,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20) ` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20) `
) )
await expect(page.locator('.cm-ghostText')).not.toBeVisible() await expect(page.locator('.cm-ghostText')).not.toBeVisible()
@ -80,7 +80,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -89,7 +89,7 @@ test.describe('Copilot ghost text', () => {
// We should be able to hit Tab to accept the completion. // We should be able to hit Tab to accept the completion.
await page.keyboard.press('Tab') await page.keyboard.press('Tab')
await expect(page.locator('.cm-content')).toContainText( await expect(page.locator('.cm-content')).toContainText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
}) })
@ -156,7 +156,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -165,7 +165,7 @@ test.describe('Copilot ghost text', () => {
// We should be able to hit Tab to accept the completion. // We should be able to hit Tab to accept the completion.
await page.keyboard.press('Tab') await page.keyboard.press('Tab')
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
// Hit enter a few times. // Hit enter a few times.
@ -173,7 +173,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20) ` `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20) `
) )
await expect(page.locator('.cm-ghostText')).not.toBeVisible() await expect(page.locator('.cm-ghostText')).not.toBeVisible()
@ -194,7 +194,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -225,7 +225,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -256,7 +256,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -287,7 +287,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -315,7 +315,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -326,7 +326,7 @@ test.describe('Copilot ghost text', () => {
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
}) })
@ -348,7 +348,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -409,7 +409,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`{thing: "blah"}fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `{thing: "blah"}fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -450,7 +450,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -483,7 +483,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`
@ -514,7 +514,7 @@ test.describe('Copilot ghost text', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await expect(page.locator('.cm-ghostText').first()).toBeVisible() await expect(page.locator('.cm-ghostText').first()).toBeVisible()
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(length = 20)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line([0, -scale]) return sg}part001 = cube([0,0], 20) |> close() |> extrude(length = 20)`
) )
await expect(page.locator('.cm-ghostText').first()).toHaveText( await expect(page.locator('.cm-ghostText').first()).toHaveText(
`fn cube = (pos, scale) => {` `fn cube = (pos, scale) => {`

View File

@ -26,7 +26,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
await page.keyboard.down('ControlOrMeta') await page.keyboard.down('ControlOrMeta')
await page.keyboard.press('/') await page.keyboard.press('/')
@ -38,7 +38,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
// |> close(%)`) // |> close()`)
// uncomment the code // uncomment the code
await page.keyboard.down('ControlOrMeta') await page.keyboard.down('ControlOrMeta')
@ -51,7 +51,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
}) })
test('ensure we use the cache, and do not re-execute', async ({ test('ensure we use the cache, and do not re-execute', async ({
@ -70,7 +70,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
// Ensure we execute the first time. // Ensure we execute the first time.
await u.openDebugPanel() await u.openDebugPanel()
@ -119,7 +119,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
// Ensure we execute the first time. // Ensure we execute the first time.
await u.openDebugPanel() await u.openDebugPanel()
@ -174,7 +174,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
await page.locator('#code-pane button:first-child').click() await page.locator('#code-pane button:first-child').click()
await page.locator('button:has-text("Format code")').click() await page.locator('button:has-text("Format code")').click()
@ -184,7 +184,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
}) })
test('if you click the format button it formats your code and executes so lints are still there', async ({ test('if you click the format button it formats your code and executes so lints are still there', async ({
@ -205,7 +205,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
await u.openDebugPanel() await u.openDebugPanel()
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
@ -233,7 +233,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
// error in guter // error in guter
await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible() await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible()
@ -251,7 +251,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)` |> close()`
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
@ -260,7 +260,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)` |> close()`
) )
}) })
await page.setBodyDimensions({ width: 1000, height: 500 }) await page.setBodyDimensions({ width: 1000, height: 500 })
@ -329,7 +329,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)` |> close()`
) )
}) })
await page.setBodyDimensions({ width: 1000, height: 500 }) await page.setBodyDimensions({ width: 1000, height: 500 })
@ -374,7 +374,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)` |> close()`
) )
localStorage.setItem('disableAxis', 'true') localStorage.setItem('disableAxis', 'true')
}) })
@ -401,7 +401,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
}) })
test('if you use the format keyboard binding it formats your code and executes so lints are shown', async ({ test('if you use the format keyboard binding it formats your code and executes so lints are shown', async ({
@ -417,7 +417,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)` |> close()`
) )
localStorage.setItem('disableAxis', 'true') localStorage.setItem('disableAxis', 'true')
}) })
@ -454,7 +454,7 @@ test.describe('Editor tests', () => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%)`) |> close()`)
// error in guter // error in guter
await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible() await expect(page.locator('.cm-lint-marker-info').first()).toBeVisible()
@ -521,7 +521,7 @@ test.describe('Editor tests', () => {
|> startProfileAt([3.29, 7.86], %) |> startProfileAt([3.29, 7.86], %)
|> line(end = [2.48, 2.44]) |> line(end = [2.48, 2.44])
|> line(end = [2.66, 1.17]) |> line(end = [2.66, 1.17])
|> close(%) |> close()
` `
) )
}) })
@ -646,7 +646,7 @@ test.describe('Editor tests', () => {
|> line(endAbsolute = [width / 2, -length / 2]) |> line(endAbsolute = [width / 2, -length / 2])
|> line(endAbsolute = [width / 2, length / 2]) |> line(endAbsolute = [width / 2, length / 2])
|> line(endAbsolute = [-width / 2, length / 2]) |> line(endAbsolute = [-width / 2, length / 2])
|> close(%) |> close()
return squareHoleSketch return squareHoleSketch
} }
` `
@ -710,7 +710,7 @@ test.describe('Editor tests', () => {
|> line(end = [0, 10]) |> line(end = [0, 10])
|> line(end = [10, 0]) |> line(end = [10, 0])
|> line(end = [0, -10], tag = $revolveAxis) |> line(end = [0, -10], tag = $revolveAxis)
|> close(%) |> close()
|> extrude(length = 10) |> extrude(length = 10)
sketch001 = startSketchOn(box, revolveAxis) sketch001 = startSketchOn(box, revolveAxis)
@ -718,7 +718,7 @@ test.describe('Editor tests', () => {
|> line(end = [0, -10]) |> line(end = [0, -10])
|> line(end = [2, 0]) |> line(end = [2, 0])
|> line(end = [0, -10]) |> line(end = [0, -10])
|> close(%) |> close()
|> revolve({ |> revolve({
axis: revolveAxis, axis: revolveAxis,
angle: 90 angle: 90
@ -901,7 +901,7 @@ test.describe('Editor tests', () => {
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], %)
|> close(%)` |> close()`
) )
}) })
@ -949,7 +949,7 @@ test.describe('Editor tests', () => {
// expect the code to have changed // expect the code to have changed
await expect(page.locator('.cm-content')).toHaveText( await expect(page.locator('.cm-content')).toHaveText(
`sketch001 = startSketchOn('XZ') |> startProfileAt([4.61, -14.01], %) |> line(end = [12.73, -0.09], %) |> tangentialArcTo([24.95, -5.38]) |> close(%)extrude001 = extrude(sketch001, length = 5)` `sketch001 = startSketchOn('XZ') |> startProfileAt([4.61, -14.01], %) |> line(end = [12.73, -0.09], %) |> tangentialArcTo([24.95, -5.38]) |> close()extrude001 = extrude(sketch001, length = 5)`
) )
// Now hit undo // Now hit undo
@ -963,7 +963,7 @@ test.describe('Editor tests', () => {
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], %)
|> close(%)`) |> close()`)
}) })
test('Can undo a sketch modification with ctrl+z', async ({ test('Can undo a sketch modification with ctrl+z', async ({
@ -978,7 +978,7 @@ test.describe('Editor tests', () => {
|> startProfileAt([4.61, -10.01], %) |> startProfileAt([4.61, -10.01], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -0.38], %) |> tangentialArcTo([24.95, -0.38], %)
|> close(%) |> close()
|> extrude(length = 5)` |> extrude(length = 5)`
) )
}) })
@ -1069,7 +1069,7 @@ test.describe('Editor tests', () => {
|> startProfileAt([2.71, -2.71], %) |> startProfileAt([2.71, -2.71], %)
|> line(end = [15.4, -2.78]) |> line(end = [15.4, -2.78])
|> tangentialArcTo([27.6, -3.05], %) |> tangentialArcTo([27.6, -3.05], %)
|> close(%) |> close()
|> extrude(length = 5) |> extrude(length = 5)
`) `)
@ -1083,7 +1083,7 @@ test.describe('Editor tests', () => {
|> startProfileAt([2.71, -2.71], %) |> startProfileAt([2.71, -2.71], %)
|> line(end = [15.4, -2.78]) |> line(end = [15.4, -2.78])
|> tangentialArcTo([24.95, -0.38], %) |> tangentialArcTo([24.95, -0.38], %)
|> close(%) |> close()
|> extrude(length = 5)`) |> extrude(length = 5)`)
// Hit undo again. // Hit undo again.
@ -1096,7 +1096,7 @@ test.describe('Editor tests', () => {
|> startProfileAt([2.71, -2.71], %) |> startProfileAt([2.71, -2.71], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -0.38], %) |> tangentialArcTo([24.95, -0.38], %)
|> close(%) |> close()
|> extrude(length = 5) |> extrude(length = 5)
`) `)
@ -1111,7 +1111,7 @@ test.describe('Editor tests', () => {
|> startProfileAt([4.61, -10.01], %) |> startProfileAt([4.61, -10.01], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -0.38], %) |> tangentialArcTo([24.95, -0.38], %)
|> close(%) |> close()
|> extrude(length = 5)`) |> extrude(length = 5)`)
}) })

View File

@ -11,7 +11,7 @@ export fn triangle() {
|> xLine(10, %) |> xLine(10, %)
|> line(end = [-10, -5]) |> line(end = [-10, -5])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
} }
length001 = timesFive(1) * 5 length001 = timesFive(1) * 5
@ -20,7 +20,7 @@ sketch001 = startSketchOn('XZ')
|> line(end = [10, 10]) |> line(end = [10, 10])
|> angledLine([-45, length001], %) |> angledLine([-45, length001], %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
revolve001 = revolve({ axis = "X" }, sketch001) revolve001 = revolve({ axis = "X" }, sketch001)
triangle() triangle()
|> extrude(length = 30) |> extrude(length = 30)
@ -31,7 +31,7 @@ sketch002 = startSketchOn(plane001)
|> xLine(-10, %) |> xLine(-10, %)
|> line(endAbsolute = [-40, 0]) |> line(endAbsolute = [-40, 0])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch002, length = 10) extrude001 = extrude(sketch002, length = 10)
` `

View File

@ -229,7 +229,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA002) -segLen(rectangleSegmentA002)
], %, $rectangleSegmentC001) ], %, $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)`, |> close()`,
}) })
await sketchOnAChamfer({ await sketchOnAChamfer({
@ -260,7 +260,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA003) -segLen(rectangleSegmentA003)
], %, $rectangleSegmentC002) ], %, $rectangleSegmentC002)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)`, |> close()`,
}) })
await sketchOnAChamfer({ await sketchOnAChamfer({
clickCoords: { x: 677, y: 87 }, clickCoords: { x: 677, y: 87 },
@ -285,7 +285,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA003) -segLen(rectangleSegmentA003)
], %, $rectangleSegmentC002) ], %, $rectangleSegmentC002)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)`, |> close()`,
}) })
/// last one /// last one
await sketchOnAChamfer({ await sketchOnAChamfer({
@ -309,7 +309,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA005) -segLen(rectangleSegmentA005)
], %, $rectangleSegmentC004) ], %, $rectangleSegmentC004)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)`, |> close()`,
}) })
await test.step('verify at the end of the test that final code is what is expected', async () => { await test.step('verify at the end of the test that final code is what is expected', async () => {
@ -327,7 +327,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA001) -segLen(rectangleSegmentA001)
], %, $yo) ], %, $yo)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 100) extrude001 = extrude(sketch001, length = 100)
|> chamfer({ |> chamfer({
length = 30, length = 30,
@ -354,7 +354,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA005) -segLen(rectangleSegmentA005)
], %, $rectangleSegmentC004) ], %, $rectangleSegmentC004)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
sketch004 = startSketchOn(extrude001, seg05) sketch004 = startSketchOn(extrude001, seg05)
|> startProfileAt([82.57,322.96], %) |> startProfileAt([82.57,322.96], %)
|> angledLine([0, 11.16], %, $rectangleSegmentA004) |> angledLine([0, 11.16], %, $rectangleSegmentA004)
@ -367,7 +367,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA004) -segLen(rectangleSegmentA004)
], %, $rectangleSegmentC003) ], %, $rectangleSegmentC003)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
sketch003 = startSketchOn(extrude001, seg04) sketch003 = startSketchOn(extrude001, seg04)
|> startProfileAt([-209.64,255.28], %) |> startProfileAt([-209.64,255.28], %)
|> angledLine([0, 11.56], %, $rectangleSegmentA003) |> angledLine([0, 11.56], %, $rectangleSegmentA003)
@ -380,7 +380,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA003) -segLen(rectangleSegmentA003)
], %, $rectangleSegmentC002) ], %, $rectangleSegmentC002)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
sketch002 = startSketchOn(extrude001, seg03) sketch002 = startSketchOn(extrude001, seg03)
|> startProfileAt([205.96,254.59], %) |> startProfileAt([205.96,254.59], %)
|> angledLine([0, 11.39], %, $rectangleSegmentA002) |> angledLine([0, 11.39], %, $rectangleSegmentA002)
@ -393,7 +393,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA002) -segLen(rectangleSegmentA002)
], %, $rectangleSegmentC001) ], %, $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
`, `,
{ shouldNormalise: true } { shouldNormalise: true }
) )
@ -448,7 +448,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA002) -segLen(rectangleSegmentA002)
], %, $rectangleSegmentC001) ], %, $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)`, |> close()`,
}) })
await editor.expectEditor.toContain( await editor.expectEditor.toContain(
`sketch001 = startSketchOn('XZ') `sketch001 = startSketchOn('XZ')
@ -463,7 +463,7 @@ test.describe('verify sketch on chamfer works', () => {
-segLen(rectangleSegmentA001) -segLen(rectangleSegmentA001)
], %, $yo) ], %, $yo)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 100) extrude001 = extrude(sketch001, length = 100)
chamf = chamfer({ chamf = chamfer({
length = 30, length = 30,
@ -489,7 +489,7 @@ sketch002 = startSketchOn(extrude001, seg03)
-segLen(rectangleSegmentA002) -segLen(rectangleSegmentA002)
], %, $rectangleSegmentC001) ], %, $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
`, `,
{ shouldNormalise: true } { shouldNormalise: true }
) )
@ -1095,11 +1095,11 @@ test(`Fillet point-and-click`, async ({
// Code samples // Code samples
const initialCode = `sketch001 = startSketchOn('XY') const initialCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-12, -6], %) |> startProfileAt([-12, -6], %)
|> line([0, 12], %) |> line(end = [0, 12])
|> line([24, 0], %) |> line(end = [24, 0])
|> line([0, -12], %) |> line(end = [0, -12])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(-12, sketch001) extrude001 = extrude(-12, sketch001)
` `
const firstFilletDeclaration = 'fillet({ radius = 5, tags = [seg01] }, %)' const firstFilletDeclaration = 'fillet({ radius = 5, tags = [seg01] }, %)'
@ -1314,7 +1314,7 @@ test(`Chamfer point-and-click`, async ({
|> line(end = [24, 0]) |> line(end = [24, 0])
|> line(end = [0, -12]) |> line(end = [0, -12])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = -12) extrude001 = extrude(sketch001, length = -12)
` `
const firstChamferDeclaration = 'chamfer({ length = 5, tags = [seg01] }, %)' const firstChamferDeclaration = 'chamfer({ length = 5, tags = [seg01] }, %)'
@ -1628,7 +1628,7 @@ test('Shell point-and-click wall', async ({
|> yLine(-60, %) |> yLine(-60, %)
|> xLine(-40, %) |> xLine(-40, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 40) extrude001 = extrude(sketch001, length = 40)
` `
await context.addInitScript((initialCode) => { await context.addInitScript((initialCode) => {

View File

@ -1465,7 +1465,7 @@ test.fixme(
|> line(end = [118.328, -291.754]) |> line(end = [118.328, -291.754])
|> line(end = [-180.04, -202.08]) |> line(end = [-180.04, -202.08])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 200)`) extrude001 = extrude(sketch001, length = 200)`)
await page.waitForTimeout(800) await page.waitForTimeout(800)

View File

@ -9,7 +9,7 @@ profile001 = startProfileAt([57.81, 250.51], sketch001)
|> line(end = [19.66, -116.4]) |> line(end = [19.66, -116.4])
|> line(end = [-221.8, -41.69]) |> line(end = [-221.8, -41.69])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(profile001, length = 200) extrude001 = extrude(profile001, length = 200)
sketch002 = startSketchOn('XZ') sketch002 = startSketchOn('XZ')
|> startProfileAt([-73.64, -42.89], %) |> startProfileAt([-73.64, -42.89], %)
@ -17,7 +17,7 @@ sketch002 = startSketchOn('XZ')
|> line(end = [-22.12, -94.4]) |> line(end = [-22.12, -94.4])
|> xLine(-156.98, %) |> xLine(-156.98, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude002 = extrude(sketch002, length = 50) extrude002 = extrude(sketch002, length = 50)
sketch003 = startSketchOn('XY') sketch003 = startSketchOn('XY')
|> startProfileAt([52.92, 157.81], %) |> startProfileAt([52.92, 157.81], %)
@ -31,7 +31,7 @@ sketch003 = startSketchOn('XY')
-segLen(rectangleSegmentA001) -segLen(rectangleSegmentA001)
], %, $rectangleSegmentC001) ], %, $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude003 = extrude(sketch003, length = 20) extrude003 = extrude(sketch003, length = 20)
` `

View File

@ -24,7 +24,7 @@ test.describe('Regression tests', () => {
|> line(end = [0, 0]) |> line(end = [0, 0])
|> line(end = [-4.84, -5.29]) |> line(end = [-4.84, -5.29])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)` |> close()`
) )
}) })
@ -68,7 +68,7 @@ test.describe('Regression tests', () => {
-segLen(rectangleSegmentA001) -segLen(rectangleSegmentA001)
], %, $rectangleSegmentC001) ], %, $rectangleSegmentC001)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 50) extrude001 = extrude(sketch001, length = 50)
` `
) )
@ -190,7 +190,7 @@ extrude001 = extrude(sketch001, length = 50)
|> line(end = [0, 1]) |> line(end = [0, 1])
|> line(end = [1, 0]) |> line(end = [1, 0])
|> line(end = [0, -1]) |> line(end = [0, -1])
|> close(%) |> close()
|> extrude(length = 1) |> extrude(length = 1)
|> patternLinear3d({ |> patternLinear3d({
axis: [1, 0, 1], axis: [1, 0, 1],
@ -255,7 +255,7 @@ extrude001 = extrude(sketch001, length = 50)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle: 50, length: 45 }, %) |> angledLine({ angle: 50, length: 45 }, %)
|> yLineTo(0, %) |> yLineTo(0, %)
|> close(%) |> close()
|> |>
example = extrude(exampleSketch, length = 5) example = extrude(exampleSketch, length = 5)
@ -311,7 +311,7 @@ extrude001 = extrude(sketch001, length = 50)
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> angledLine({ angle: 50, length: 45 }, %) |> angledLine({ angle: 50, length: 45 }, %)
|> yLineTo(0, %) |> yLineTo(0, %)
|> close(%) |> close()
thing: "blah"`) thing: "blah"`)

View File

@ -48,7 +48,7 @@ test.describe('Sketch tests', () => {
|> xLine(width * .5, %) |> xLine(width * .5, %)
|> yLine(height, %) |> yLine(height, %)
|> xLine(-width * .5, %) |> xLine(-width * .5, %)
|> close(%) |> close()
|> hole(screwHole, %) |> hole(screwHole, %)
|> extrude(length = thickness) |> extrude(length = thickness)
@ -65,7 +65,7 @@ test.describe('Sketch tests', () => {
}, %) }, %)
|> yLine(-wireOffset, %) |> yLine(-wireOffset, %)
|> xLine(-width / 4, %) |> xLine(-width / 4, %)
|> close(%) |> close()
|> extrude(length = -height) |> extrude(length = -height)
` `
) )
@ -190,7 +190,7 @@ test.describe('Sketch tests', () => {
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], %)
|> close(%)` |> close()`
) )
}) })
@ -230,7 +230,7 @@ test.describe('Sketch tests', () => {
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], %)
|> close(%)`) |> close()`)
} else { } else {
// Ensure we don't see the code. // Ensure we don't see the code.
await expect(u.codeLocator).not.toBeVisible() await expect(u.codeLocator).not.toBeVisible()
@ -308,7 +308,7 @@ test.describe('Sketch tests', () => {
|> line(end = [14.72, 1.97]) |> line(end = [14.72, 1.97])
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], %)
|> line(end = [1.97, 2.06]) |> line(end = [1.97, 2.06])
|> close(%)`) |> close()`)
} }
test('code pane open at start-handles', async ({ page, homePage }) => { test('code pane open at start-handles', async ({ page, homePage }) => {
// Load the app with the code panes // Load the app with the code panes
@ -441,7 +441,7 @@ test.describe('Sketch tests', () => {
|> startProfileAt([4.61, -10.01], %) |> startProfileAt([4.61, -10.01], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -0.38], %) |> tangentialArcTo([24.95, -0.38], %)
|> close(%) |> close()
|> extrude(length = 5)` |> extrude(length = 5)`
) )
}) })
@ -527,7 +527,7 @@ test.describe('Sketch tests', () => {
|> startProfileAt([7.12, -12.68], %) |> startProfileAt([7.12, -12.68], %)
|> line(end = [12.68, -1.09]) |> line(end = [12.68, -1.09])
|> tangentialArcTo([24.89, 0.68], %) |> tangentialArcTo([24.89, 0.68], %)
|> close(%) |> close()
|> extrude(length = 5) |> extrude(length = 5)
`) `)
}) })
@ -544,7 +544,7 @@ test.describe('Sketch tests', () => {
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line(end = [12.73, -0.09]) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], %)
|> close(%) |> close()
|> revolve({ axis = "X",}, %)` |> revolve({ axis = "X",}, %)`
) )
}) })
@ -630,7 +630,7 @@ test.describe('Sketch tests', () => {
|> line(end = [14.72, 1.97]) |> line(end = [14.72, 1.97])
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], %)
|> line(end = [1.97, 2.06]) |> line(end = [1.97, 2.06])
|> close(%) |> close()
|> revolve({ axis = "X" }, %)`) |> revolve({ axis = "X" }, %)`)
}) })
test('Can add multiple sketches', async ({ page, homePage }) => { test('Can add multiple sketches', async ({ page, homePage }) => {
@ -745,7 +745,7 @@ test.describe('Sketch tests', () => {
|> xLine(${roundOff(scale * 139.19)}, %) |> xLine(${roundOff(scale * 139.19)}, %)
|> yLine(-${roundOff(scale * 139.2)}, %) |> yLine(-${roundOff(scale * 139.2)}, %)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)` |> close()`
await expect( await expect(
page.getByRole('button', { name: 'Start Sketch' }) page.getByRole('button', { name: 'Start Sketch' })
@ -845,7 +845,7 @@ test.describe('Sketch tests', () => {
|> line(end = [1.02, -1.32], tag = $seg01) |> line(end = [1.02, -1.32], tag = $seg01)
|> line(end = [-1.01, -0.77]) |> line(end = [-1.01, -0.77])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
` `
) )
}) })
@ -860,8 +860,8 @@ test.describe('Sketch tests', () => {
await u.expectCmdLog('[data-message-type="execution-done"]') await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel() await u.closeDebugPanel()
// click "line([1.32, 0.38], %)" // click "line(end = [1.32, 0.38])"
await page.getByText(`line([1.32, 0.38], %)`).click() await page.getByText(`line(end = [1.32, 0.38])`).click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await expect(page.getByRole('button', { name: 'Edit Sketch' })).toBeEnabled( await expect(page.getByRole('button', { name: 'Edit Sketch' })).toBeEnabled(
{ timeout: 10_000 } { timeout: 10_000 }
@ -903,7 +903,7 @@ test.describe('Sketch tests', () => {
|> line(end = [1.02, -1.32], tag = $seg01) |> line(end = [1.02, -1.32], tag = $seg01)
|> line(end = [-1.01, -0.77]) |> line(end = [-1.01, -0.77])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 5) extrude001 = extrude(sketch001, length = 5)
` `
) )
@ -943,7 +943,7 @@ test.describe('Sketch tests', () => {
|> line(end = [1.02, -1.32], tag = $seg01) |> line(end = [1.02, -1.32], tag = $seg01)
|> line(end = [-1.01, -0.77]) |> line(end = [-1.01, -0.77])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 5) extrude001 = extrude(sketch001, length = 5)
sketch002 = startSketchOn(extrude001, 'END') sketch002 = startSketchOn(extrude001, 'END')
|> |>
@ -1070,7 +1070,7 @@ test.describe('Sketch tests', () => {
|> angledLineOfYLength({ angle = 60, length = lugHeadLength }, %) |> angledLineOfYLength({ angle = 60, length = lugHeadLength }, %)
|> xLineTo(0 + .001, %) |> xLineTo(0 + .001, %)
|> yLineTo(0, %) |> yLineTo(0, %)
|> close(%) |> close()
|> revolve({ axis = "Y" }, %) |> revolve({ axis = "Y" }, %)
return lugSketch return lugSketch
@ -1162,7 +1162,7 @@ test.describe('Sketch tests', () => {
-railTop / 2, -railTop / 2,
railClampable + railBaseLength railClampable + railBaseLength
]) ])
|> close(%) |> close()
|> extrude(length = in2mm(2))` |> extrude(length = in2mm(2))`
) )
}) })

View File

@ -105,7 +105,7 @@ part001 = startSketchOn('-XZ')
}, %) }, %)
|> angledLineToY([segAng(seg02, %) + 180, -baseHeight], %) |> angledLineToY([segAng(seg02, %) + 180, -baseHeight], %)
|> xLineTo(ZERO, %) |> xLineTo(ZERO, %)
|> close(%) |> close()
|> extrude(length = 4)` |> extrude(length = 4)`
) )
}) })
@ -344,7 +344,7 @@ const extrudeDefaultPlane = async (context: any, page: any, plane: string) => {
|> line(end = [2.80, 5.00]) |> line(end = [2.80, 5.00])
|> line(end = [-5.60, 4.40]) |> line(end = [-5.60, 4.40])
|> line(end = [-5.40, -3.80]) |> line(end = [-5.40, -3.80])
|> close(%) |> close()
|> extrude(length = 10.00) |> extrude(length = 10.00)
` `
await page.addInitScript(async (code: string) => { await page.addInitScript(async (code: string) => {
@ -816,13 +816,13 @@ test(
|> startProfileAt([1.4, 2.47], %) |> startProfileAt([1.4, 2.47], %)
|> line(end = [9.31, 10.55], tag = $seg01) |> line(end = [9.31, 10.55], tag = $seg01)
|> line(end = [11.91, -10.42]) |> line(end = [11.91, -10.42])
|> close(%) |> close()
|> extrude(length = ${KCL_DEFAULT_LENGTH}) |> extrude(length = ${KCL_DEFAULT_LENGTH})
part002 = startSketchOn(part001, seg01) part002 = startSketchOn(part001, seg01)
|> startProfileAt([8, 8], %) |> startProfileAt([8, 8], %)
|> line(end = [4.68, 3.05]) |> line(end = [4.68, 3.05])
|> line(end = [0, -7.79]) |> line(end = [0, -7.79])
|> close(%) |> close()
|> extrude(length = ${KCL_DEFAULT_LENGTH}) |> extrude(length = ${KCL_DEFAULT_LENGTH})
` `
) )
@ -882,7 +882,7 @@ test(
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%) |> close()
` `
) )
}, KCL_DEFAULT_LENGTH) }, KCL_DEFAULT_LENGTH)
@ -925,7 +925,7 @@ test(
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%) |> close()
|> extrude(length = 10) |> extrude(length = 10)
` `
) )
@ -1114,7 +1114,7 @@ test.fixme('theme persists', async ({ page, context }) => {
|> line(end = [20, 0]) |> line(end = [20, 0])
|> line(end = [0, 20]) |> line(end = [0, 20])
|> line(end = [-20, 0]) |> line(end = [-20, 0])
|> close(%) |> close()
|> extrude(length = 10) |> extrude(length = 10)
` `
) )

View File

@ -92,7 +92,7 @@ export const TEST_CODE_GIZMO = `part001 = startSketchOn('XZ')
offset: 0 offset: 0
}, %) }, %)
|> tangentialArcTo([13.14 + 0, 13.14], %) |> tangentialArcTo([13.14 + 0, 13.14], %)
|> close(%) |> close()
|> extrude(length = 5 + 7) |> extrude(length = 5 + 7)
` `
@ -106,7 +106,7 @@ keychain = startSketchOn("XY")
|> line(endAbsolute = [width, 0]) |> line(endAbsolute = [width, 0])
|> line(endAbsolute = [width, height]) |> line(endAbsolute = [width, height])
|> line(endAbsolute = [0, height]) |> line(endAbsolute = [0, height])
|> close(%) |> close()
|> extrude(length = thickness) |> extrude(length = thickness)
keychain1 = startSketchOn("XY") keychain1 = startSketchOn("XY")
@ -114,7 +114,7 @@ keychain1 = startSketchOn("XY")
|> line(endAbsolute = [width, 0]) |> line(endAbsolute = [width, 0])
|> line(endAbsolute = [width, height]) |> line(endAbsolute = [width, height])
|> line(endAbsolute = [0, height]) |> line(endAbsolute = [0, height])
|> close(%) |> close()
|> extrude(length = thickness) |> extrude(length = thickness)
keychain2 = startSketchOn("XY") keychain2 = startSketchOn("XY")
@ -122,7 +122,7 @@ keychain2 = startSketchOn("XY")
|> line(endAbsolute = [width, 0]) |> line(endAbsolute = [width, 0])
|> line(endAbsolute = [width, height]) |> line(endAbsolute = [width, height])
|> line(endAbsolute = [0, height]) |> line(endAbsolute = [0, height])
|> close(%) |> close()
|> extrude(length = thickness) |> extrude(length = thickness)
box = startSketchOn('XY') box = startSketchOn('XY')
@ -130,7 +130,7 @@ box = startSketchOn('XY')
|> line(end = [0, 10]) |> line(end = [0, 10])
|> line(end = [10, 0]) |> line(end = [10, 0])
|> line(end = [0, -10], tag = $revolveAxis) |> line(end = [0, -10], tag = $revolveAxis)
|> close(%) |> close()
|> extrude(length = 10) |> extrude(length = 10)
sketch001 = startSketchOn(box, revolveAxis) sketch001 = startSketchOn(box, revolveAxis)
@ -138,7 +138,7 @@ sketch001 = startSketchOn(box, revolveAxis)
|> line(end = [0, -10]) |> line(end = [0, -10])
|> line(end = [2, 0]) |> line(end = [2, 0])
|> line(end = [0, -10]) |> line(end = [0, -10])
|> close(%) |> close()
|> revolve({ |> revolve({
axis: revolveAxis, axis: revolveAxis,
angle: 90 angle: 90
@ -147,7 +147,7 @@ sketch001 = startSketchOn(box, revolveAxis)
sketch001 = startSketchOn('XZ') sketch001 = startSketchOn('XZ')
|> startProfileAt([0.0, 0.0], %) |> startProfileAt([0.0, 0.0], %)
|> xLine(0.0, %) |> xLine(0.0, %)
|> close(%) |> close()
` `

View File

@ -35,7 +35,7 @@ test.describe('Testing constraints', () => {
await u.closeDebugPanel() await u.closeDebugPanel()
// Click the line of code for line. // Click the line of code for line.
await page.getByText(`line([0, 20], %)`).click() // TODO remove this and reinstate // await topHorzSegmentClick() await page.getByText(`line(end = [0, 20])`).click() // TODO remove this and reinstate // await topHorzSegmentClick()
await page.waitForTimeout(100) await page.waitForTimeout(100)
// enter sketch again // enter sketch again
@ -46,7 +46,7 @@ test.describe('Testing constraints', () => {
const startXPx = 500 const startXPx = 500
await page.getByText(`line([0, 20], %)`).click() await page.getByText(`line(end = [0, 20])`).click()
await page.waitForTimeout(100) await page.waitForTimeout(100)
await page.getByTestId('constraint-length').click() await page.getByTestId('constraint-length').click()
await page.getByTestId('cmd-bar-arg-value').getByRole('textbox').fill('20') await page.getByTestId('cmd-bar-arg-value').getByRole('textbox').fill('20')
@ -101,7 +101,7 @@ test.describe('Testing constraints', () => {
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([74.36, 130.4], %, $seg01)').click() await page.getByText('line(end = [74.36, 130.4], tag = $seg01)').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
// Wait for overlays to populate // Wait for overlays to populate
@ -118,7 +118,7 @@ test.describe('Testing constraints', () => {
.click() .click()
await page.getByRole('button', { name: 'remove constraints' }).click() await page.getByRole('button', { name: 'remove constraints' }).click()
await page.getByText('line([39.13, 68.63], %)').click() await page.getByText('line(end = [39.13, 68.63])').click()
await pollEditorLinesSelectedLength(page, 1) await pollEditorLinesSelectedLength(page, 1)
const activeLinesContent = await page.locator('.cm-activeLine').all() const activeLinesContent = await page.locator('.cm-activeLine').all()
await expect(activeLinesContent[0]).toHaveText( await expect(activeLinesContent[0]).toHaveText(
@ -192,7 +192,7 @@ test.describe('Testing constraints', () => {
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([74.36, 130.4], %, $seg01)').click() await page.getByText('line(end = [74.36, 130.4], tag = $seg01)').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
// Give time for overlays to populate // Give time for overlays to populate
@ -301,7 +301,7 @@ test.describe('Testing constraints', () => {
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([74.36, 130.4], %)').click() await page.getByText('line(end = [74.36, 130.4])').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
// Wait for overlays to populate // Wait for overlays to populate
@ -411,7 +411,7 @@ test.describe('Testing constraints', () => {
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([74.36, 130.4], %)').click() await page.getByText('line(end = [74.36, 130.4])').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
// Wait for overlays to populate // Wait for overlays to populate
@ -526,7 +526,7 @@ test.describe('Testing constraints', () => {
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([74.36, 130.4], %)').click() await page.getByText('line(end = [74.36, 130.4])').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
// Wait for overlays to populate // Wait for overlays to populate
@ -628,7 +628,7 @@ test.describe('Testing constraints', () => {
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([74.36, 130.4], %)').click() await page.getByText('line(end = [74.36, 130.4])').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
// Wait for overlays to populate // Wait for overlays to populate
@ -715,7 +715,7 @@ part002 = startSketchOn('XZ')
await homePage.goToModelingScene() await homePage.goToModelingScene()
await page.getByText('line([74.36, 130.4], %)').click() await page.getByText('line(end = [74.36, 130.4])').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
const line3 = await u.getSegmentBodyCoords( const line3 = await u.getSegmentBodyCoords(
@ -794,7 +794,7 @@ part002 = startSketchOn('XZ')
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([74.36, 130.4], %)').click() await page.getByText('line(end = [74.36, 130.4])').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
// Wait for overlays to populate // Wait for overlays to populate
@ -896,7 +896,7 @@ part002 = startSketchOn('XZ')
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([74.36, 130.4], %)').click() await page.getByText('line(end = [74.36, 130.4])').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
// Wait for overlays to populate // Wait for overlays to populate
@ -977,7 +977,7 @@ part002 = startSketchOn('XZ')
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([74.36, 130.4], %)').click() await page.getByText('line(end = [74.36, 130.4])').click()
await page.getByRole('button', { name: 'Edit Sketch' }).click() await page.getByRole('button', { name: 'Edit Sketch' }).click()
// Wait for overlays to populate // Wait for overlays to populate
@ -1032,7 +1032,7 @@ part002 = startSketchOn('XZ')
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.waitForPageLoad() await u.waitForPageLoad()
await page.getByText('line([3.79, 2.68], %, $seg01)').click() await page.getByText('line(end = [3.79, 2.68], tag = $seg01)').click()
await expect( await expect(
page.getByRole('button', { name: 'Edit Sketch' }) page.getByRole('button', { name: 'Edit Sketch' })
).toBeEnabled({ timeout: 10_000 }) ).toBeEnabled({ timeout: 10_000 })

View File

@ -269,7 +269,7 @@ test.describe(`Testing gizmo, fixture-based`, () => {
segAng(rectangleSegmentA001), segAng(rectangleSegmentA001),
-segLen(rectangleSegmentA001) -segLen(rectangleSegmentA001)
], %) ], %)
|> close(%) |> close()
const sketch001 = startSketchOn('XZ') const sketch001 = startSketchOn('XZ')
|> circle({ |> circle({
center: [818.33, 168.1], center: [818.33, 168.1],

View File

@ -290,7 +290,7 @@ test.describe('Testing segment overlays', () => {
hoverPos: { x: line.x, y: line.y }, hoverPos: { x: line.x, y: line.y },
constraintType: 'xRelative', constraintType: 'xRelative',
expectBeforeUnconstrained: '|> line(end = [0.5, yRel001])', expectBeforeUnconstrained: '|> line(end = [0.5, yRel001])',
expectAfterUnconstrained: 'line([xRel001, yRel001], %)', expectAfterUnconstrained: 'line(end = [xRel001, yRel001])',
expectFinal: '|> line(end = [0.5, yRel001])', expectFinal: '|> line(end = [0.5, yRel001])',
ang: ang + 180, ang: ang + 180,
locator: '[data-overlay-index="0"]', locator: '[data-overlay-index="0"]',
@ -1137,7 +1137,7 @@ test.describe('Testing segment overlays', () => {
ang = await u.getAngle(`[data-overlay-index="${0}"]`) ang = await u.getAngle(`[data-overlay-index="${0}"]`)
await deleteSegmentSequence({ await deleteSegmentSequence({
hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y }, hoverPos: { x: segmentToDelete.x, y: segmentToDelete.y },
codeToBeDeleted: 'line([0.5, -14 + 0], %)', codeToBeDeleted: 'line(end = [0.5, -14 + 0])',
stdLibFnName: 'line', stdLibFnName: 'line',
ang: ang + 180, ang: ang + 180,
}) })
@ -1147,7 +1147,7 @@ test.describe('Testing segment overlays', () => {
}) })
test.describe('Testing delete with dependent segments', () => { test.describe('Testing delete with dependent segments', () => {
const cases = [ const cases = [
'line([22, 2], %, $seg01)', 'line(end = [22, 2], tag = $seg01)',
'angledLine([5, 23.03], %, $seg01)', 'angledLine([5, 23.03], %, $seg01)',
'xLine(23, %, $seg01)', 'xLine(23, %, $seg01)',
'yLine(-8, %, $seg01)', 'yLine(-8, %, $seg01)',
@ -1283,45 +1283,45 @@ test.describe('Testing segment overlays', () => {
test.describe('Testing remove constraints segments', () => { test.describe('Testing remove constraints segments', () => {
const cases = [ const cases = [
{ {
before: `line([22 + 0, 2 + 0], %, $seg01)`, before: `line(end = [22 + 0, 2 + 0], tag = $seg01)`,
after: `line([22, 2], %, $seg01)`, after: `line(end = [22, 2], tag = $seg01)`,
}, },
{ {
before: `angledLine([5 + 0, 23.03 + 0], %, $seg01)`, before: `angledLine([5 + 0, 23.03 + 0], %, $seg01)`,
after: `line([22.94, 2.01], %, $seg01)`, after: `line(end = [22.94, 2.01], tag = $seg01)`,
}, },
{ {
before: `xLine(23 + 0, %, $seg01)`, before: `xLine(23 + 0, %, $seg01)`,
after: `line([23, 0], %, $seg01)`, after: `line(end = [23, 0], tag = $seg01)`,
}, },
{ {
before: `yLine(-8 + 0, %, $seg01)`, before: `yLine(-8 + 0, %, $seg01)`,
after: `line([0, -8], %, $seg01)`, after: `line(end = [0, -8], tag = $seg01)`,
}, },
{ {
before: `xLineTo(30 + 0, %, $seg01)`, before: `xLineTo(30 + 0, %, $seg01)`,
after: `line([25, 0], %, $seg01)`, after: `line(end = [25, 0], tag = $seg01)`,
}, },
{ {
before: `yLineTo(-4 + 0, %, $seg01)`, before: `yLineTo(-4 + 0, %, $seg01)`,
after: `line([0, -10], %, $seg01)`, after: `line(end = [0, -10], tag = $seg01)`,
}, },
{ {
before: `angledLineOfXLength({ angle = 3 + 0, length = 30 + 0 }, %, $seg01)`, before: `angledLineOfXLength({ angle = 3 + 0, length = 30 + 0 }, %, $seg01)`,
after: `line([30, 1.57], %, $seg01)`, after: `line(end = [30, 1.57], tag = $seg01)`,
}, },
{ {
before: `angledLineOfYLength({ angle = 3 + 0, length = 1.5 + 0 }, %, $seg01)`, before: `angledLineOfYLength({ angle = 3 + 0, length = 1.5 + 0 }, %, $seg01)`,
after: `line([28.62, 1.5], %, $seg01)`, after: `line(end = [28.62, 1.5], tag = $seg01)`,
}, },
{ {
before: `angledLineToX({ angle = 3 + 0, to = 30 + 0 }, %, $seg01)`, before: `angledLineToX({ angle = 3 + 0, to = 30 + 0 }, %, $seg01)`,
after: `line([25, 1.31], %, $seg01)`, after: `line(end = [25, 1.31], tag = $seg01)`,
}, },
{ {
before: `angledLineToY({ angle = 3 + 0, to = 7 + 0 }, %, $seg01)`, before: `angledLineToY({ angle = 3 + 0, to = 7 + 0 }, %, $seg01)`,
after: `line([19.08, 1], %, $seg01)`, after: `line(end = [19.08, 1], tag = $seg01)`,
}, },
] ]

View File

@ -267,7 +267,7 @@ test.describe('Testing selections', () => {
|> line(end = [112.54, 127.64], tag = $seg02) |> line(end = [112.54, 127.64], tag = $seg02)
|> line(end = [170.36, -121.61], tag = $seg01) |> line(end = [170.36, -121.61], tag = $seg01)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 50) extrude001 = extrude(sketch001, length = 50)
sketch005 = startSketchOn(extrude001, 'END') sketch005 = startSketchOn(extrude001, 'END')
|> startProfileAt([23.24, 136.52], %) |> startProfileAt([23.24, 136.52], %)
@ -275,19 +275,19 @@ test.describe('Testing selections', () => {
|> line(end = [49.4, 2.05]) |> line(end = [49.4, 2.05])
|> line(end = [29.69, -46.95]) |> line(end = [29.69, -46.95])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
sketch003 = startSketchOn(extrude001, seg01) sketch003 = startSketchOn(extrude001, seg01)
|> startProfileAt([21.23, 17.81], %) |> startProfileAt([21.23, 17.81], %)
|> line(end = [51.97, 21.32]) |> line(end = [51.97, 21.32])
|> line(end = [4.07, -22.75]) |> line(end = [4.07, -22.75])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
sketch002 = startSketchOn(extrude001, seg02) sketch002 = startSketchOn(extrude001, seg02)
|> startProfileAt([-100.54, 16.99], %) |> startProfileAt([-100.54, 16.99], %)
|> line(end = [0, 20.03]) |> line(end = [0, 20.03])
|> line(end = [62.61, 0], tag = $seg03) |> line(end = [62.61, 0], tag = $seg03)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude002 = extrude(sketch002, length = 50) extrude002 = extrude(sketch002, length = 50)
sketch004 = startSketchOn(extrude002, seg03) sketch004 = startSketchOn(extrude002, seg03)
|> startProfileAt([57.07, 134.77], %) |> startProfileAt([57.07, 134.77], %)
@ -295,7 +295,7 @@ test.describe('Testing selections', () => {
|> line(end = [28.8, 6.71]) |> line(end = [28.8, 6.71])
|> line(end = [9.19, -25.33]) |> line(end = [9.19, -25.33])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude003 = extrude(sketch004, length = 20) extrude003 = extrude(sketch004, length = 20)
pipeLength = 40 pipeLength = 40
pipeSmallDia = 10 pipeSmallDia = 10
@ -320,7 +320,7 @@ test.describe('Testing selections', () => {
|> angledLineToX({ angle = 120, to = pipeSmallDia }, %) |> angledLineToX({ angle = 120, to = pipeSmallDia }, %)
|> line(end = [0, pipeLength]) |> line(end = [0, pipeLength])
|> angledLineToX({ angle = 60, to = pipeLargeDia }, %) |> angledLineToX({ angle = 60, to = pipeLargeDia }, %)
|> close(%) |> close()
rev = revolve({ axis: 'y' }, part009) rev = revolve({ axis: 'y' }, part009)
` `
) )
@ -436,7 +436,7 @@ test.describe('Testing selections', () => {
|> line(end = [112.54, 127.64], tag = $seg02) |> line(end = [112.54, 127.64], tag = $seg02)
|> line(end = [170.36, -121.61], tag = $seg01) |> line(end = [170.36, -121.61], tag = $seg01)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 50) extrude001 = extrude(sketch001, length = 50)
launderExtrudeThroughVar = extrude001 launderExtrudeThroughVar = extrude001
sketch002 = startSketchOn(launderExtrudeThroughVar, seg02) sketch002 = startSketchOn(launderExtrudeThroughVar, seg02)
@ -444,7 +444,7 @@ test.describe('Testing selections', () => {
|> line(end = [0, 20.03]) |> line(end = [0, 20.03])
|> line(end = [62.61, 0], tag = $seg03) |> line(end = [62.61, 0], tag = $seg03)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
` `
) )
}, KCL_DEFAULT_LENGTH) }, KCL_DEFAULT_LENGTH)
@ -516,7 +516,7 @@ test.describe('Testing selections', () => {
offset = 0 offset = 0
}, %) }, %)
|> tangentialArcTo([13.14 + 0, 13.14], %) |> tangentialArcTo([13.14 + 0, 13.14], %)
|> close(%) |> close()
|> extrude(length = 5 + 7) |> extrude(length = 5 + 7)
` `
) )
@ -678,26 +678,26 @@ test.describe('Testing selections', () => {
await checkCodeAtHoverPosition( await checkCodeAtHoverPosition(
'close', 'close',
close, close,
'close(%)extrude(5+7,%)', 'close()extrude(5+7,%)',
'close(%)' 'close()'
) )
await checkCodeAtHoverPosition( await checkCodeAtHoverPosition(
'closeEdge', 'closeEdge',
closeEdge, closeEdge,
`close(%)`, `close()`,
'close(%)' 'close()'
) )
await checkCodeAtHoverPosition( await checkCodeAtHoverPosition(
'closeAdjacentEdge', 'closeAdjacentEdge',
closeAdjacentEdge, closeAdjacentEdge,
`close(%)`, `close()`,
'close(%)' 'close()'
) )
await checkCodeAtHoverPosition( await checkCodeAtHoverPosition(
'closeOppositeEdge', 'closeOppositeEdge',
closeOppositeEdge, closeOppositeEdge,
`close(%)`, `close()`,
'close(%)' 'close()'
) )
await checkCodeAtHoverPosition( await checkCodeAtHoverPosition(
@ -734,7 +734,7 @@ test.describe('Testing selections', () => {
-segLen(rectangleSegmentA001) -segLen(rectangleSegmentA001)
], %, $yo) ], %, $yo)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02) |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 100) extrude001 = extrude(sketch001, length = 100)
|> chamfer({ |> chamfer({
length = 30, length = 30,
@ -853,7 +853,7 @@ test.describe('Testing selections', () => {
|> line(end = [-0.18, -3.36]) |> line(end = [-0.18, -3.36])
|> line(end = [-3.86, -2.73]) |> line(end = [-3.86, -2.73])
|> line(end = [-17.67, 0.85]) |> line(end = [-17.67, 0.85])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 10) extrude001 = extrude(sketch001, length = 10)
` `
) )
@ -869,8 +869,8 @@ test.describe('Testing selections', () => {
await u.closeDebugPanel() await u.closeDebugPanel()
const selectUnExtrudable = async () => { const selectUnExtrudable = async () => {
await editor.scrollToText(`line([4.99, -0.46], %, $seg01)`) await editor.scrollToText(`line(end = [4.99, -0.46], tag = $seg01)`)
await page.getByText(`line([4.99, -0.46], %, $seg01)`).click() await page.getByText(`line(end = [4.99, -0.46], tag = $seg01)`).click()
} }
const clickEmpty = () => page.mouse.click(700, 460) const clickEmpty = () => page.mouse.click(700, 460)
await selectUnExtrudable() await selectUnExtrudable()
@ -889,7 +889,7 @@ test.describe('Testing selections', () => {
|> line(end = [2.45, -0.2]) |> line(end = [2.45, -0.2])
|> line(end = [-2, -1.25]) |> line(end = [-2, -1.25])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
` `
await u.codeLocator.fill(codeToAdd) await u.codeLocator.fill(codeToAdd)
@ -921,7 +921,7 @@ test.describe('Testing selections', () => {
const cases = [ const cases = [
{ {
pos: [694, 185], pos: [694, 185],
expectedCode: 'line([74.36, 130.4], %, $seg01)', expectedCode: 'line(end = [74.36, 130.4], tag = $seg01)',
}, },
{ {
pos: [816, 244], pos: [816, 244],
@ -994,7 +994,7 @@ test.describe('Testing selections', () => {
|> line(end = [112.54, 127.64]) |> line(end = [112.54, 127.64])
|> line(end = [170.36, -121.61], tag = $seg01) |> line(end = [170.36, -121.61], tag = $seg01)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 50) extrude001 = extrude(sketch001, length = 50)
` `
) )
@ -1025,7 +1025,7 @@ test.describe('Testing selections', () => {
let selectColor: [number, number, number] = [155, 155, 105] let selectColor: [number, number, number] = [155, 155, 105]
const extrudeWall = { x: 670, y: 275 } const extrudeWall = { x: 670, y: 275 }
const extrudeText = `line([170.36, -121.61], %, $seg01)` const extrudeText = `line(end = [170.36, -121.61], tag = $seg01)`
const cap = { x: 594, y: 283 } const cap = { x: 594, y: 283 }
const capText = `startProfileAt([-79.26, 95.04], %)` const capText = `startProfileAt([-79.26, 95.04], %)`
@ -1109,7 +1109,7 @@ test.describe('Testing selections', () => {
|> line(end = [5.25, -5.72]) |> line(end = [5.25, -5.72])
|> line(end = [-2.01, -10.35]) |> line(end = [-2.01, -10.35])
|> line(end = [-27.65, -2.78]) |> line(end = [-27.65, -2.78])
|> close(%) |> close()
|> extrude(length = 5) |> extrude(length = 5)
sketch002 = startSketchOn('XZ') sketch002 = startSketchOn('XZ')
${extrudeAndEditAllowed} ${extrudeAndEditAllowed}
@ -1117,7 +1117,7 @@ test.describe('Testing selections', () => {
|> line(end = [9.71, -6.16]) |> line(end = [9.71, -6.16])
|> line(end = [-3.08, -9.86]) |> line(end = [-3.08, -9.86])
|> line(end = [-12.02, -1.54]) |> line(end = [-12.02, -1.54])
|> close(%) |> close()
sketch003 = startSketchOn('XZ') sketch003 = startSketchOn('XZ')
${editOnly} ${editOnly}
|> line(end = [27.55, -1.65]) |> line(end = [27.55, -1.65])

View File

@ -718,7 +718,7 @@ test.describe('Testing settings', () => {
|> line(end = [0, 5]) |> line(end = [0, 5])
|> line(end = [-5, 0]) |> line(end = [-5, 0])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 5) extrude001 = extrude(sketch001, length = 5)
` `
) )

View File

@ -76,7 +76,7 @@ part001 = startSketchOn('-XZ')
}, %) }, %)
|> angledLineToY([segAng(seg02) + 180, -baseHeight], %) |> angledLineToY([segAng(seg02) + 180, -baseHeight], %)
|> xLineTo(ZERO, %) |> xLineTo(ZERO, %)
|> close(%) |> close()
|> extrude(length = 4)` |> extrude(length = 4)`
) )
}) })
@ -462,7 +462,7 @@ test('Sketch on face', async ({ page, homePage }) => {
|> line(end = [-0.18, -3.36]) |> line(end = [-0.18, -3.36])
|> line(end = [-3.86, -2.73]) |> line(end = [-3.86, -2.73])
|> line(end = [-17.67, 0.85]) |> line(end = [-17.67, 0.85])
|> close(%) |> close()
extrude001 = extrude(sketch001, length = 5 + 7)` extrude001 = extrude(sketch001, length = 5 + 7)`
) )
}) })
@ -523,7 +523,7 @@ extrude001 = extrude(sketch001, length = 5 + 7)`
|> line(end = [2.45, -0.2]) |> line(end = [2.45, -0.2])
|> line(end = [-2.6, -1.25]) |> line(end = [-2.6, -1.25])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
`) `)
) )
@ -561,7 +561,7 @@ extrude001 = extrude(sketch001, length = 5 + 7)`
|> line(end = [${[2.28, 2.35]}, -${0.07}]) |> line(end = [${[2.28, 2.35]}, -${0.07}])
|> line(end = [-3.05, -1.47]) |> line(end = [-3.05, -1.47])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)]) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%)` |> close()`
await expect(page.locator('.cm-content')).toHaveText(result.regExp) await expect(page.locator('.cm-content')).toHaveText(result.regExp)

View File

@ -209,5 +209,6 @@
"wasm-pack": "^0.13.1", "wasm-pack": "^0.13.1",
"ws": "^8.17.0", "ws": "^8.17.0",
"yarn": "^1.22.22" "yarn": "^1.22.22"
} },
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
} }

View File

@ -92,14 +92,14 @@ export function isSketchVariablesLinked(
that way it can find fn calls that are linked to each other through variables eg: that way it can find fn calls that are linked to each other through variables eg:
const part001 = startSketchAt([0, 0]) const part001 = startSketchAt([0, 0])
|> xLineTo(1.69, %) |> xLineTo(1.69, %)
|> line([myVar, 0.38], %) // ❗️ <- cursor in this fn call (the primary) |> line(end = [myVar, 0.38]) // ❗️ <- cursor in this fn call (the primary)
|> line([0.41, baz], %) |> line(end = [0.41, baz])
|> xLine(0.91, %) |> xLine(0.91, %)
|> angledLine([37, 2], %) |> angledLine([37, 2], %)
const yo = line([myVar, 0.38], part001) const yo = line([myVar, 0.38], part001)
|> line([1, 1], %) |> line(end = [1, 1])
const yo2 = line([myVar, 0.38], yo) const yo2 = line([myVar, 0.38], yo)
|> line([1, 1], %) // ❗️ <- and cursor here (secondary) is linked to the one above through variables |> line(end = [1, 1]) // ❗️ <- and cursor here (secondary) is linked to the one above through variables
*/ */
const secondaryVarName = secondaryVarDec?.id?.name const secondaryVarName = secondaryVarDec?.id?.name
if (!secondaryVarName) return false if (!secondaryVarName) return false

View File

@ -174,7 +174,7 @@ export type SimplifiedArgDetails =
* @property {Expr} callExp - This is the main result; recasting the expression should give the user the new function call. * @property {Expr} callExp - This is the main result; recasting the expression should give the user the new function call.
* @property {number} [valueUsedInTransform] - Aside from `callExp`, we also return the number used in the transform, which is useful for constraints. * @property {number} [valueUsedInTransform] - Aside from `callExp`, we also return the number used in the transform, which is useful for constraints.
* For example, when adding a "horizontal distance" constraint, we don't want the segments to move, just constrain them in place. * For example, when adding a "horizontal distance" constraint, we don't want the segments to move, just constrain them in place.
* So the second segment will probably be something like `lineTo([segEndX($firstSegTag) + someLiteral, 123], %)` where `someLiteral` is * So the second segment will probably be something like `line(endAbsolute = [segEndX($firstSegTag) + someLiteral, 123])` where `someLiteral` is
* the value of the current horizontal distance, That is we calculate the value needed to constrain the second segment without it moving. * the value of the current horizontal distance, That is we calculate the value needed to constrain the second segment without it moving.
* We can run the ast-mod to get this constraint `valueUsedInTransform` without applying the mod so that we can surface this to the user in a modal. * We can run the ast-mod to get this constraint `valueUsedInTransform` without applying the mod so that we can surface this to the user in a modal.
* We show them the modal where they can specify the distance they want to constrain to. * We show them the modal where they can specify the distance they want to constrain to.

View File

@ -25,10 +25,10 @@ thickness = sqrt(moment * factorOfSafety * 6 / (sigmaAllow * width)) // this is
// Sketch the bracket body and fillet the inner and outer edges of the bend // Sketch the bracket body and fillet the inner and outer edges of the bend
bracketLeg1Sketch = startSketchOn('XY') bracketLeg1Sketch = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([shelfMountL - filletRadius, 0], %, $fillet1) |> line(end = [shelfMountL - filletRadius, 0], tag = $fillet1)
|> line([0, width], %, $fillet2) |> line(end = [0, width], tag = $fillet2)
|> line([-shelfMountL + filletRadius, 0], %) |> line(end = [-shelfMountL + filletRadius, 0])
|> close(%) |> close()
|> hole(circle({ |> hole(circle({
center = [1, 1], center = [1, 1],
radius = mountingHoleDiameter / 2 radius = mountingHoleDiameter / 2
@ -59,13 +59,13 @@ bracketLeg1Extrude = extrude(thickness, bracketLeg1Sketch)
// Sketch the fillet arc // Sketch the fillet arc
filletSketch = startSketchOn('XZ') filletSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, thickness], %) |> line(end = [0, thickness])
|> arc({ |> arc({
angleEnd = 180, angleEnd = 180,
angleStart = 90, angleStart = 90,
radius = filletRadius + thickness radius = filletRadius + thickness
}, %) }, %)
|> line([thickness, 0], %) |> line(end = [thickness, 0])
|> arc({ |> arc({
angleEnd = 90, angleEnd = 90,
angleStart = 180, angleStart = 180,
@ -88,10 +88,10 @@ customPlane = {
// Create a sketch for the second leg // Create a sketch for the second leg
bracketLeg2Sketch = startSketchOn(customPlane) bracketLeg2Sketch = startSketchOn(customPlane)
|> startProfileAt([0, -filletRadius], %) |> startProfileAt([0, -filletRadius], %)
|> line([width, 0], %) |> line(end = [width, 0])
|> line([0, -wallMountL], %, $fillet3) |> line(end = [0, -wallMountL], tag = $fillet3)
|> line([-width, 0], %, $fillet4) |> line(end = [-width, 0], tag = $fillet4)
|> close(%) |> close()
|> hole(circle({ |> hole(circle({
center = [1, -1.5], center = [1, -1.5],
radius = mountingHoleDiameter / 2 radius = mountingHoleDiameter / 2

View File

@ -27,7 +27,7 @@ import {
* |> angledLine([0, 0], %, $a) * |> angledLine([0, 0], %, $a)
* |> angledLine([segAng(a) - 90, 0], %, $b) * |> angledLine([segAng(a) - 90, 0], %, $b)
* |> angledLine([segAng(a), -segLen(a)], %, $c) * |> angledLine([segAng(a), -segLen(a)], %, $c)
* |> close(%) * |> close()
*/ */
export const getRectangleCallExpressions = ( export const getRectangleCallExpressions = (
rectangleOrigin: [number, number], rectangleOrigin: [number, number],