Kwargs: startProfileAt (#6424)
Previous: ``` startProfileAt([x, y], %) startProfileAt([x, y], sketch001) ``` New: ``` startProfile(%, at = [x, y]) startProfile(sketch001, at = [x, y]) ```
This commit is contained in:
@ -21,7 +21,7 @@ test.describe('Editor tests', () => {
|
||||
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -34,7 +34,7 @@ test.describe('Editor tests', () => {
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -49,7 +49,7 @@ sketch001 = startSketchOn(XY)
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -69,7 +69,7 @@ sketch001 = startSketchOn(XY)
|
||||
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -122,7 +122,7 @@ sketch001 = startSketchOn(XY)
|
||||
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -177,7 +177,7 @@ sketch001 = startSketchOn(XY)
|
||||
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -188,7 +188,7 @@ sketch001 = startSketchOn(XY)
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -210,7 +210,7 @@ sketch001 = startSketchOn(XY)
|
||||
|
||||
await u.codeLocator.click()
|
||||
await page.keyboard.type(`sketch_001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -239,7 +239,7 @@ sketch001 = startSketchOn(XY)
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch_001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -258,7 +258,7 @@ sketch_001 = startSketchOn(XY)
|
||||
|
||||
test('fold gutters work', async ({ page, homePage }) => {
|
||||
const fullCode = `sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -267,7 +267,7 @@ sketch_001 = startSketchOn(XY)
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -336,7 +336,7 @@ sketch_001 = startSketchOn(XY)
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -383,7 +383,7 @@ sketch_001 = startSketchOn(XY)
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -411,7 +411,7 @@ sketch_001 = startSketchOn(XY)
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`sketch001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -427,7 +427,7 @@ sketch_001 = startSketchOn(XY)
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch_001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -465,7 +465,7 @@ sketch_001 = startSketchOn(XY)
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`sketch_001 = startSketchOn(XY)
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> startProfile(at = [-10, -10])
|
||||
|> line(end = [20, 0])
|
||||
|> line(end = [0, 20])
|
||||
|> line(end = [-20, 0])
|
||||
@ -536,7 +536,7 @@ sketch_001 = startSketchOn(XY)
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([3.29, 7.86], %)
|
||||
|> startProfile(at = [3.29, 7.86])
|
||||
|> line(end = [2.48, 2.44])
|
||||
|> line(end = [2.66, 1.17])
|
||||
|> close()
|
||||
@ -661,7 +661,7 @@ sketch_001 = startSketchOn(XY)
|
||||
|
||||
fn squareHole = (l, w) => {
|
||||
squareHoleSketch = startSketchOn(XY)
|
||||
|> startProfileAt([-width / 2, -length / 2], %)
|
||||
|> startProfile(at = [-width / 2, -length / 2])
|
||||
|> line(endAbsolute = [width / 2, -length / 2])
|
||||
|> line(endAbsolute = [width / 2, length / 2])
|
||||
|> line(endAbsolute = [-width / 2, length / 2])
|
||||
@ -724,7 +724,7 @@ sketch_001 = startSketchOn(XY)
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`box = startSketchOn(XY)
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> line(end = [10, 0])
|
||||
|> line(end = [0, -10], tag = $revolveAxis)
|
||||
@ -732,7 +732,7 @@ sketch_001 = startSketchOn(XY)
|
||||
|> extrude(length = 10)
|
||||
|
||||
sketch001 = startSketchOn(box, face = revolveAxis)
|
||||
|> startProfileAt([5, 10], %)
|
||||
|> startProfile(at = [5, 10])
|
||||
|> line(end = [0, -10])
|
||||
|> line(end = [2, 0])
|
||||
|> line(end = [0, -10])
|
||||
@ -793,10 +793,10 @@ sketch_001 = startSketchOn(XY)
|
||||
|
||||
await page.keyboard.press('Tab')
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.type('12')
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.press('Tab')
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.type('12')
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.press('Tab')
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.press('Tab')
|
||||
@ -828,7 +828,7 @@ sketch_001 = startSketchOn(XY)
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([3.14, 12], %)
|
||||
|> startProfile(%, at = [3.14, 12])
|
||||
|> xLine(%, length = 5) // lin`.replaceAll('\n', '')
|
||||
)
|
||||
|
||||
@ -868,9 +868,9 @@ sketch001 = startSketchOn(XZ)
|
||||
await page.keyboard.press('Tab') // accepting the auto complete, not a new line
|
||||
|
||||
await page.keyboard.press('Tab')
|
||||
await page.keyboard.type('12')
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.press('Tab')
|
||||
await page.keyboard.type('12')
|
||||
await page.waitForTimeout(100)
|
||||
await page.keyboard.press('Tab')
|
||||
await page.waitForTimeout(100)
|
||||
@ -903,7 +903,7 @@ sketch001 = startSketchOn(XZ)
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`@settings(defaultLengthUnit = in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([3.14, 12], %)
|
||||
|> startProfile(%, at = [3.14, 12])
|
||||
|> xLine(%, length = 5) // lin`.replaceAll('\n', '')
|
||||
)
|
||||
})
|
||||
@ -918,7 +918,7 @@ sketch001 = startSketchOn(XZ)
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> startProfile(at = [4.61, -14.01])
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArc(endAbsolute = [24.95, -5.38])
|
||||
|> close()`
|
||||
@ -954,7 +954,7 @@ sketch001 = startSketchOn(XZ)
|
||||
})
|
||||
await page.waitForTimeout(100)
|
||||
|
||||
await page.getByText('startProfileAt([4.61, -14.01], %)').click()
|
||||
await page.getByText('startProfile(at = [4.61, -14.01])').click()
|
||||
await expect(page.getByRole('button', { name: 'Extrude' })).toBeVisible()
|
||||
await page.getByRole('button', { name: 'Extrude' }).click()
|
||||
|
||||
@ -969,7 +969,7 @@ sketch001 = startSketchOn(XZ)
|
||||
|
||||
// expect the code to have changed
|
||||
await expect(page.locator('.cm-content')).toHaveText(
|
||||
`sketch001 = startSketchOn(XZ) |> startProfileAt([4.61, -14.01], %) |> line(end = [12.73, -0.09]) |> tangentialArc(endAbsolute = [24.95, -5.38]) |> close()extrude001 = extrude(sketch001, length = 5)`
|
||||
`sketch001 = startSketchOn(XZ) |> startProfile(at = [4.61, -14.01]) |> line(end = [12.73, -0.09]) |> tangentialArc(endAbsolute = [24.95, -5.38]) |> close()extrude001 = extrude(sketch001, length = 5)`
|
||||
)
|
||||
|
||||
// Now hit undo
|
||||
@ -981,7 +981,7 @@ sketch001 = startSketchOn(XZ)
|
||||
await expect(
|
||||
page.locator('.cm-content')
|
||||
).toHaveText(`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([4.61, -14.01], %)
|
||||
|> startProfile(at = [4.61, -14.01])
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArc(endAbsolute = [24.95, -5.38])
|
||||
|> close()`)
|
||||
@ -998,7 +998,7 @@ sketch001 = startSketchOn(XZ)
|
||||
'persistCode',
|
||||
`@settings(defaultLengthUnit=in)
|
||||
sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([4.61, -10.01], %)
|
||||
|> startProfile(at = [4.61, -10.01])
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArc(endAbsolute = [24.95, -0.38])
|
||||
|> close()
|
||||
@ -1039,7 +1039,7 @@ sketch001 = startSketchOn(XZ)
|
||||
|
||||
const dragPX = 40
|
||||
|
||||
await page.getByText('startProfileAt([4.61, -10.01], %)').click()
|
||||
await page.getByText('startProfile(at = [4.61, -10.01])').click()
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Edit Sketch' })
|
||||
).toBeVisible()
|
||||
@ -1089,7 +1089,7 @@ sketch001 = startSketchOn(XZ)
|
||||
// expect the code to have changed
|
||||
await editor.expectEditor.toContain(
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([2.71, -2.71], %)
|
||||
|> startProfile(at = [2.71, -2.71])
|
||||
|> line(end = [15.4, -2.78])
|
||||
|> tangentialArc(endAbsolute = [27.6, -3.05])
|
||||
|> close()
|
||||
@ -1104,7 +1104,7 @@ sketch001 = startSketchOn(XZ)
|
||||
|
||||
await editor.expectEditor.toContain(
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([2.71, -2.71], %)
|
||||
|> startProfile(at = [2.71, -2.71])
|
||||
|> line(end = [15.4, -2.78])
|
||||
|> tangentialArc(endAbsolute = [24.95, -0.38])
|
||||
|> close()
|
||||
@ -1119,7 +1119,7 @@ sketch001 = startSketchOn(XZ)
|
||||
|
||||
await editor.expectEditor.toContain(
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([2.71, -2.71], %)
|
||||
|> startProfile(at = [2.71, -2.71])
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArc(endAbsolute = [24.95, -0.38])
|
||||
|> close()
|
||||
@ -1135,7 +1135,7 @@ sketch001 = startSketchOn(XZ)
|
||||
await page.waitForTimeout(100)
|
||||
await editor.expectEditor.toContain(
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
|> startProfileAt([4.61, -10.01], %)
|
||||
|> startProfile(at = [4.61, -10.01])
|
||||
|> line(end = [12.73, -0.09])
|
||||
|> tangentialArc(endAbsolute = [24.95, -0.38])
|
||||
|> close()
|
||||
@ -1288,7 +1288,7 @@ sketch001 = startSketchOn(XZ)
|
||||
localStorage.setItem(
|
||||
'persistCode',
|
||||
`sketch001 = startSketchOn(XZ)
|
||||
profile001 = startProfileAt([100.00, 100.0], sketch001)
|
||||
profile001 = startProfile(sketch001, at = [100.00, 100.0])
|
||||
|> yLine(length = -100.0)
|
||||
|> xLine(length = 200.0)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|
Reference in New Issue
Block a user