Merge remote-tracking branch 'origin' into kurt-multi-profile-again

This commit is contained in:
Kurt Hutten Irev-Dev
2025-02-05 11:48:43 +11:00
555 changed files with 143164 additions and 139326 deletions

View File

@ -46,7 +46,15 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: check-rust-changes needs: check-rust-changes
steps: steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.GH_ORG_APP_ID }}
private-key: ${{ secrets.GH_ORG_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
@ -126,20 +134,20 @@ jobs:
- name: build web - name: build web
shell: bash shell: bash
run: yarn tronb:vite:dev run: yarn tronb:vite:dev
# - name: Run ubuntu/chrome snapshots - name: Run ubuntu/chrome snapshots
# if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }} if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
# shell: bash shell: bash
# # TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest, # TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest,
# # but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes. # but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes.
# run: | run: |
# PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot --shard=1/1 PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot --shard=1/1
# env: env:
# CI: true CI: true
# NODE_ENV: development NODE_ENV: development
# VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
# VITE_KC_SKIP_AUTH: true VITE_KC_SKIP_AUTH: true
# token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }} token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
# snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }} snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
if: ${{ !cancelled() && (success() || failure()) }} if: ${{ !cancelled() && (success() || failure()) }}
with: with:
@ -162,20 +170,20 @@ jobs:
then echo "modified=true" >> $GITHUB_OUTPUT then echo "modified=true" >> $GITHUB_OUTPUT
else echo "modified=false" >> $GITHUB_OUTPUT else echo "modified=false" >> $GITHUB_OUTPUT
fi fi
# - name: Commit changes, if any - name: Commit changes, if any
# if: steps.git-check.outputs.modified == 'true' if: steps.git-check.outputs.modified == 'true'
# shell: bash shell: bash
# run: | run: |
# git add . git add .
# git config --local user.email "github-actions[bot]@users.noreply.github.com" git config --local user.email "github-actions[bot]@users.noreply.github.com"
# git config --local user.name "github-actions[bot]" git config --local user.name "github-actions[bot]"
# git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
# git fetch origin git fetch origin
# echo ${{ github.head_ref }} echo ${{ github.head_ref }}
# git checkout ${{ github.head_ref }} git checkout ${{ github.head_ref }}
# git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true
# git push git push
# git push origin ${{ github.head_ref }} git push origin ${{ github.head_ref }}
# only upload artifacts if there's actually changes # only upload artifacts if there's actually changes
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
if: steps.git-check.outputs.modified == 'true' if: steps.git-check.outputs.modified == 'true'

1
.gitignore vendored
View File

@ -25,6 +25,7 @@ yarn-error.log*
.idea .idea
.vscode .vscode
.helix
src/wasm-lib/.idea src/wasm-lib/.idea
src/wasm-lib/.vscode src/wasm-lib/.vscode

2
.helix/config.toml Normal file
View File

@ -0,0 +1,2 @@
[editor]
auto-format = true

10
.helix/languages.toml Normal file
View File

@ -0,0 +1,10 @@
[language-server.eslint]
args = ["--stdio"]
command = "vscode-eslint-language-server"
[[language]]
name = "typescript"
auto-format = true
formatter = { command = "node_modules/.bin/prettier", args = ["--parser", "typescript"] }
language-servers = [ { name = "eslint", only-features = [ "diagnostics" ] }, "typescript-language-server" ]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -31,12 +31,12 @@ appearance(data: AppearanceData, solid_set: SolidSet) -> SolidSet
// Add color to an extruded solid. // Add color to an extruded solid.
exampleSketch = startSketchOn("XZ") exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> lineTo([10, 0], %) |> line(endAbsolute = [10, 0])
|> lineTo([0, 10], %) |> line(endAbsolute = [0, 10])
|> lineTo([-10, 0], %) |> line(endAbsolute = [-10, 0])
|> close(%) |> close()
example = extrude(5, exampleSketch) example = extrude(exampleSketch, length = 5)
|> appearance({ |> appearance({
color = '#ff0000', color = '#ff0000',
metalness = 50, metalness = 50,
@ -65,11 +65,11 @@ sketch001 = startSketchOn('XY')
fn cube(center) { fn cube(center) {
return startSketchOn('XY') return startSketchOn('XY')
|> startProfileAt([center[0] - 10, center[1] - 10], %) |> startProfileAt([center[0] - 10, center[1] - 10], %)
|> lineTo([center[0] + 10, center[1] - 10], %) |> line(endAbsolute = [center[0] + 10, center[1] - 10])
|> lineTo([center[0] + 10, center[1] + 10], %) |> line(endAbsolute = [center[0] + 10, center[1] + 10])
|> lineTo([center[0] - 10, center[1] + 10], %) |> line(endAbsolute = [center[0] - 10, center[1] + 10])
|> close(%) |> close()
|> extrude(10, %) |> extrude(length = 10)
} }
example0 = cube([0, 0]) example0 = cube([0, 0])
@ -95,11 +95,11 @@ appearance({
// This example shows setting the appearance _after_ the shell. // This example shows setting the appearance _after_ the shell.
firstSketch = startSketchOn('XY') firstSketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %) |> startProfileAt([-12, 12], %)
|> line([24, 0], %) |> line(end = [24, 0])
|> line([0, -24], %) |> line(end = [0, -24])
|> line([-24, 0], %) |> line(end = [-24, 0])
|> close(%) |> close()
|> extrude(6, %) |> extrude(length = 6)
shell({ faces = ['end'], thickness = 0.25 }, firstSketch) shell({ faces = ['end'], thickness = 0.25 }, firstSketch)
|> appearance({ |> appearance({
@ -116,11 +116,11 @@ shell({ faces = ['end'], thickness = 0.25 }, firstSketch)
// This example shows setting the appearance _before_ the shell. // This example shows setting the appearance _before_ the shell.
firstSketch = startSketchOn('XY') firstSketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %) |> startProfileAt([-12, 12], %)
|> line([24, 0], %) |> line(end = [24, 0])
|> line([0, -24], %) |> line(end = [0, -24])
|> line([-24, 0], %) |> line(end = [-24, 0])
|> close(%) |> close()
|> extrude(6, %) |> extrude(length = 6)
|> appearance({ |> appearance({
color = '#ff0000', color = '#ff0000',
metalness = 90, metalness = 90,
@ -137,12 +137,12 @@ shell({ faces = ['end'], thickness = 0.25 }, firstSketch)
// This example shows _before_ the pattern. // This example shows _before_ the pattern.
exampleSketch = startSketchOn('XZ') exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 2], %) |> line(end = [0, 2])
|> line([3, 1], %) |> line(end = [3, 1])
|> line([0, -4], %) |> line(end = [0, -4])
|> close(%) |> close()
example = extrude(1, exampleSketch) example = extrude(exampleSketch, length = 1)
|> appearance({ |> appearance({
color = '#ff0000', color = '#ff0000',
metalness = 90, metalness = 90,
@ -162,12 +162,12 @@ example = extrude(1, exampleSketch)
// This example shows _after_ the pattern. // This example shows _after_ the pattern.
exampleSketch = startSketchOn('XZ') exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 2], %) |> line(end = [0, 2])
|> line([3, 1], %) |> line(end = [3, 1])
|> line([0, -4], %) |> line(end = [0, -4])
|> close(%) |> close()
example = extrude(1, exampleSketch) example = extrude(exampleSketch, length = 1)
|> patternLinear3d({ |> patternLinear3d({
axis = [1, 0, 1], axis = [1, 0, 1],
instances = 7, instances = 7,
@ -186,10 +186,10 @@ example = extrude(1, exampleSketch)
// Color the result of a 2D pattern that was extruded. // Color the result of a 2D pattern that was extruded.
exampleSketch = startSketchOn('XZ') exampleSketch = startSketchOn('XZ')
|> startProfileAt([.5, 25], %) |> startProfileAt([.5, 25], %)
|> line([0, 5], %) |> line(end = [0, 5])
|> line([-1, 0], %) |> line(end = [-1, 0])
|> line([0, -5], %) |> line(end = [0, -5])
|> close(%) |> close()
|> patternCircular2d({ |> patternCircular2d({
center = [0, 0], center = [0, 0],
instances = 13, instances = 13,
@ -197,7 +197,7 @@ exampleSketch = startSketchOn('XZ')
rotateDuplicates = true rotateDuplicates = true
}, %) }, %)
example = extrude(1, exampleSketch) example = extrude(exampleSketch, length = 1)
|> appearance({ |> appearance({
color = '#ff0000', color = '#ff0000',
metalness = 90, metalness = 90,
@ -214,11 +214,11 @@ example = extrude(1, exampleSketch)
// Create a path for the sweep. // Create a path for the sweep.
sweepPath = startSketchOn('XZ') sweepPath = startSketchOn('XZ')
|> startProfileAt([0.05, 0.05], %) |> startProfileAt([0.05, 0.05], %)
|> line([0, 7], %) |> line(end = [0, 7])
|> tangentialArc({ offset = 90, radius = 5 }, %) |> tangentialArc({ offset = 90, radius = 5 }, %)
|> line([-3, 0], %) |> line(end = [-3, 0])
|> tangentialArc({ offset = -90, radius = 5 }, %) |> tangentialArc({ offset = -90, radius = 5 }, %)
|> line([0, 7], %) |> line(end = [0, 7])
pipeHole = startSketchOn('XY') pipeHole = startSketchOn('XY')
|> circle({ center = [0, 0], radius = 1.5 }, %) |> circle({ center = [0, 0], radius = 1.5 }, %)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -36,12 +36,12 @@ filletRadius = 2
mountingPlateSketch = startSketchOn("XY") mountingPlateSketch = startSketchOn("XY")
|> startProfileAt([-width / 2, -length / 2], %) |> startProfileAt([-width / 2, -length / 2], %)
|> lineTo([width / 2, -length / 2], %, $edge1) |> line(endAbsolute = [width / 2, -length / 2], tag = $edge1)
|> lineTo([width / 2, length / 2], %, $edge2) |> line(endAbsolute = [width / 2, length / 2], tag = $edge2)
|> lineTo([-width / 2, length / 2], %, $edge3) |> line(endAbsolute = [-width / 2, length / 2], tag = $edge3)
|> close(%, $edge4) |> close(tag = $edge4)
mountingPlate = extrude(thickness, mountingPlateSketch) mountingPlate = extrude(mountingPlateSketch, length = thickness)
|> fillet({ |> fillet({
radius = filletRadius, radius = filletRadius,
tags = [ tags = [
@ -63,12 +63,12 @@ filletRadius = 1
mountingPlateSketch = startSketchOn("XY") mountingPlateSketch = startSketchOn("XY")
|> startProfileAt([-width / 2, -length / 2], %) |> startProfileAt([-width / 2, -length / 2], %)
|> lineTo([width / 2, -length / 2], %, $edge1) |> line(endAbsolute = [width / 2, -length / 2], tag = $edge1)
|> lineTo([width / 2, length / 2], %, $edge2) |> line(endAbsolute = [width / 2, length / 2], tag = $edge2)
|> lineTo([-width / 2, length / 2], %, $edge3) |> line(endAbsolute = [-width / 2, length / 2], tag = $edge3)
|> close(%, $edge4) |> close(tag = $edge4)
mountingPlate = extrude(thickness, mountingPlateSketch) mountingPlate = extrude(mountingPlateSketch, length = thickness)
|> fillet({ |> fillet({
radius = filletRadius, radius = filletRadius,
tolerance = 0.000001, tolerance = 0.000001,

File diff suppressed because one or more lines are too long

View File

@ -29,14 +29,14 @@ getNextAdjacentEdge(tag: TagIdentifier) -> Uuid
```js ```js
exampleSketch = startSketchOn('XZ') exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line(end = [10, 0])
|> angledLine({ angle = 60, length = 10 }, %) |> angledLine({ angle = 60, length = 10 }, %)
|> angledLine({ angle = 120, length = 10 }, %) |> angledLine({ angle = 120, length = 10 }, %)
|> line([-10, 0], %) |> line(end = [-10, 0])
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge) |> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|> close(%) |> close()
example = extrude(5, exampleSketch) example = extrude(exampleSketch, length = 5)
|> fillet({ |> fillet({
radius = 3, radius = 3,
tags = [getNextAdjacentEdge(referenceEdge)] tags = [getNextAdjacentEdge(referenceEdge)]

View File

@ -29,14 +29,14 @@ getOppositeEdge(tag: TagIdentifier) -> Uuid
```js ```js
exampleSketch = startSketchOn('XZ') exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line(end = [10, 0])
|> angledLine({ angle = 60, length = 10 }, %) |> angledLine({ angle = 60, length = 10 }, %)
|> angledLine({ angle = 120, length = 10 }, %) |> angledLine({ angle = 120, length = 10 }, %)
|> line([-10, 0], %) |> line(end = [-10, 0])
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge) |> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|> close(%) |> close()
example = extrude(5, exampleSketch) example = extrude(exampleSketch, length = 5)
|> fillet({ |> fillet({
radius = 3, radius = 3,
tags = [getOppositeEdge(referenceEdge)] tags = [getOppositeEdge(referenceEdge)]

View File

@ -29,14 +29,14 @@ getPreviousAdjacentEdge(tag: TagIdentifier) -> Uuid
```js ```js
exampleSketch = startSketchOn('XZ') exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line(end = [10, 0])
|> angledLine({ angle = 60, length = 10 }, %) |> angledLine({ angle = 60, length = 10 }, %)
|> angledLine({ angle = 120, length = 10 }, %) |> angledLine({ angle = 120, length = 10 }, %)
|> line([-10, 0], %) |> line(end = [-10, 0])
|> angledLine({ angle = 240, length = 10 }, %, $referenceEdge) |> angledLine({ angle = 240, length = 10 }, %, $referenceEdge)
|> close(%) |> close()
example = extrude(5, exampleSketch) example = extrude(exampleSketch, length = 5)
|> fillet({ |> fillet({
radius = 3, radius = 3,
tags = [getPreviousAdjacentEdge(referenceEdge)] tags = [getPreviousAdjacentEdge(referenceEdge)]

View File

@ -49,7 +49,7 @@ springSketch = startSketchOn('YZ')
// Create a helix around an edge. // Create a helix around an edge.
helper001 = startSketchOn('XZ') helper001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 10], %, $edge001) |> line(end = [0, 10], tag = $edge001)
helixPath = helix({ helixPath = helix({
angleStart = 0, angleStart = 0,

View File

@ -30,7 +30,7 @@ helixRevolutions(data: HelixRevolutionsData, solid: Solid) -> Solid
```js ```js
part001 = startSketchOn('XY') part001 = startSketchOn('XY')
|> circle({ center = [5, 5], radius = 10 }, %) |> circle({ center = [5, 5], radius = 10 }, %)
|> extrude(10, %) |> extrude(length = 10)
|> helixRevolutions({ |> helixRevolutions({
angleStart = 0, angleStart = 0,
ccw = true, ccw = true,

File diff suppressed because one or more lines are too long

View File

@ -31,11 +31,11 @@ hollow(thickness: number, solid: Solid) -> Solid
// Hollow a basic sketch. // Hollow a basic sketch.
firstSketch = startSketchOn('XY') firstSketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %) |> startProfileAt([-12, 12], %)
|> line([24, 0], %) |> line(end = [24, 0])
|> line([0, -24], %) |> line(end = [0, -24])
|> line([-24, 0], %) |> line(end = [-24, 0])
|> close(%) |> close()
|> extrude(6, %) |> extrude(length = 6)
|> hollow(0.25, %) |> hollow(0.25, %)
``` ```
@ -45,11 +45,11 @@ firstSketch = startSketchOn('XY')
// Hollow a basic sketch. // Hollow a basic sketch.
firstSketch = startSketchOn('-XZ') firstSketch = startSketchOn('-XZ')
|> startProfileAt([-12, 12], %) |> startProfileAt([-12, 12], %)
|> line([24, 0], %) |> line(end = [24, 0])
|> line([0, -24], %) |> line(end = [0, -24])
|> line([-24, 0], %) |> line(end = [-24, 0])
|> close(%) |> close()
|> extrude(6, %) |> extrude(length = 6)
|> hollow(0.5, %) |> hollow(0.5, %)
``` ```
@ -60,25 +60,25 @@ firstSketch = startSketchOn('-XZ')
size = 100 size = 100
case = startSketchOn('-XZ') case = startSketchOn('-XZ')
|> startProfileAt([-size, -size], %) |> startProfileAt([-size, -size], %)
|> line([2 * size, 0], %) |> line(end = [2 * size, 0])
|> line([0, 2 * size], %) |> line(end = [0, 2 * size])
|> tangentialArcTo([-size, size], %) |> tangentialArcTo([-size, size], %)
|> close(%) |> close()
|> extrude(65, %) |> extrude(length = 65)
thing1 = startSketchOn(case, 'end') thing1 = startSketchOn(case, 'end')
|> circle({ |> circle({
center = [-size / 2, -size / 2], center = [-size / 2, -size / 2],
radius = 25 radius = 25
}, %) }, %)
|> extrude(50, %) |> extrude(length = 50)
thing2 = startSketchOn(case, 'end') thing2 = startSketchOn(case, 'end')
|> circle({ |> circle({
center = [size / 2, -size / 2], center = [size / 2, -size / 2],
radius = 25 radius = 25
}, %) }, %)
|> extrude(50, %) |> extrude(length = 50)
hollow(0.5, case) hollow(0.5, case)
``` ```

View File

@ -58,7 +58,6 @@ layout: manual
* [`legAngY`](kcl/legAngY) * [`legAngY`](kcl/legAngY)
* [`legLen`](kcl/legLen) * [`legLen`](kcl/legLen)
* [`line`](kcl/line) * [`line`](kcl/line)
* [`lineTo`](kcl/lineTo)
* [`ln`](kcl/ln) * [`ln`](kcl/ln)
* [`loft`](kcl/loft) * [`loft`](kcl/loft)
* [`log`](kcl/log) * [`log`](kcl/log)

View File

@ -38,7 +38,7 @@ assertEqual(n, 3, 0.0001, "5/2 = 2.5, rounded up makes 3")
// Draw n cylinders. // Draw n cylinders.
startSketchOn('XZ') startSketchOn('XZ')
|> circle({ center = [0, 0], radius = 2 }, %) |> circle({ center = [0, 0], radius = 2 }, %)
|> extrude(5, %) |> extrude(length = 5)
|> patternTransform(n, fn(id) { |> patternTransform(n, fn(id) {
return { translate = [4 * id, 0, 0] } return { translate = [4 * id, 0, 0] }
}, %) }, %)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,18 +34,18 @@ loft(sketches: [Sketch], v_degree: NonZeroU32, bez_approximate_rational: bool, b
// Loft a square and a triangle. // Loft a square and a triangle.
squareSketch = startSketchOn('XY') squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %) |> startProfileAt([-100, 200], %)
|> line([200, 0], %) |> line(end = [200, 0])
|> line([0, -200], %) |> line(end = [0, -200])
|> line([-200, 0], %) |> line(end = [-200, 0])
|> lineTo([profileStartX(%), profileStartY(%)], %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
triangleSketch = startSketchOn(offsetPlane('XY', 75)) triangleSketch = startSketchOn(offsetPlane('XY', 75))
|> startProfileAt([0, 125], %) |> startProfileAt([0, 125], %)
|> line([-15, -30], %) |> line(end = [-15, -30])
|> line([30, 0], %) |> line(end = [30, 0])
|> lineTo([profileStartX(%), profileStartY(%)], %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
loft([squareSketch, triangleSketch]) loft([squareSketch, triangleSketch])
``` ```
@ -56,11 +56,11 @@ loft([squareSketch, triangleSketch])
// Loft a square, a circle, and another circle. // Loft a square, a circle, and another circle.
squareSketch = startSketchOn('XY') squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %) |> startProfileAt([-100, 200], %)
|> line([200, 0], %) |> line(end = [200, 0])
|> line([0, -200], %) |> line(end = [0, -200])
|> line([-200, 0], %) |> line(end = [-200, 0])
|> lineTo([profileStartX(%), profileStartY(%)], %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
circleSketch0 = startSketchOn(offsetPlane('XY', 75)) circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|> circle({ center = [0, 100], radius = 50 }, %) |> circle({ center = [0, 100], radius = 50 }, %)
@ -81,11 +81,11 @@ loft([
// Loft a square, a circle, and another circle with options. // Loft a square, a circle, and another circle with options.
squareSketch = startSketchOn('XY') squareSketch = startSketchOn('XY')
|> startProfileAt([-100, 200], %) |> startProfileAt([-100, 200], %)
|> line([200, 0], %) |> line(end = [200, 0])
|> line([0, -200], %) |> line(end = [0, -200])
|> line([-200, 0], %) |> line(end = [-200, 0])
|> lineTo([profileStartX(%), profileStartY(%)], %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
circleSketch0 = startSketchOn(offsetPlane('XY', 75)) circleSketch0 = startSketchOn(offsetPlane('XY', 75))
|> circle({ center = [0, 100], radius = 50 }, %) |> circle({ center = [0, 100], radius = 50 }, %)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -31,7 +31,7 @@ patternCircular3d(data: CircularPattern3dData, solid_set: SolidSet) -> [Solid]
exampleSketch = startSketchOn('XZ') exampleSketch = startSketchOn('XZ')
|> circle({ center = [0, 0], radius = 1 }, %) |> circle({ center = [0, 0], radius = 1 }, %)
example = extrude(-5, exampleSketch) example = extrude(exampleSketch, length = -5)
|> patternCircular3d({ |> patternCircular3d({
axis = [1, -1, 0], axis = [1, -1, 0],
center = [10, -20, 0], center = [10, -20, 0],

File diff suppressed because one or more lines are too long

View File

@ -30,12 +30,12 @@ patternLinear3d(data: LinearPattern3dData, solid_set: SolidSet) -> [Solid]
```js ```js
exampleSketch = startSketchOn('XZ') exampleSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 2], %) |> line(end = [0, 2])
|> line([3, 1], %) |> line(end = [3, 1])
|> line([0, -4], %) |> line(end = [0, -4])
|> close(%) |> close()
example = extrude(1, exampleSketch) example = extrude(exampleSketch, length = 1)
|> patternLinear3d({ |> patternLinear3d({
axis = [1, 0, 1], axis = [1, 0, 1],
instances = 7, instances = 7,

View File

@ -63,7 +63,7 @@ fn transform(id) {
// Sketch 4 cylinders. // Sketch 4 cylinders.
sketch001 = startSketchOn('XZ') sketch001 = startSketchOn('XZ')
|> circle({ center = [0, 0], radius = 2 }, %) |> circle({ center = [0, 0], radius = 2 }, %)
|> extrude(5, %) |> extrude(length = 5)
|> patternTransform(4, transform, %) |> patternTransform(4, transform, %)
``` ```
@ -79,7 +79,7 @@ fn transform(id) {
sketch001 = startSketchOn('XZ') sketch001 = startSketchOn('XZ')
|> circle({ center = [0, 0], radius = 2 }, %) |> circle({ center = [0, 0], radius = 2 }, %)
|> extrude(5, %) |> extrude(length = 5)
|> patternTransform(4, transform, %) |> patternTransform(4, transform, %)
``` ```
@ -97,12 +97,12 @@ fn cube(length, center) {
return startSketchOn('XY') return startSketchOn('XY')
|> startProfileAt(p0, %) |> startProfileAt(p0, %)
|> lineTo(p1, %) |> line(endAbsolute = p1)
|> lineTo(p2, %) |> line(endAbsolute = p2)
|> lineTo(p3, %) |> line(endAbsolute = p3)
|> lineTo(p0, %) |> line(endAbsolute = p0)
|> close(%) |> close()
|> extrude(length, %) |> extrude(length = length)
} }
width = 20 width = 20
@ -135,12 +135,12 @@ fn cube(length, center) {
return startSketchOn('XY') return startSketchOn('XY')
|> startProfileAt(p0, %) |> startProfileAt(p0, %)
|> lineTo(p1, %) |> line(endAbsolute = p1)
|> lineTo(p2, %) |> line(endAbsolute = p2)
|> lineTo(p3, %) |> line(endAbsolute = p3)
|> lineTo(p0, %) |> line(endAbsolute = p0)
|> close(%) |> close()
|> extrude(length, %) |> extrude(length = length)
} }
width = 20 width = 20
@ -179,7 +179,7 @@ fn layer() {
return startSketchOn("XY") return startSketchOn("XY")
// or some other plane idk // or some other plane idk
|> circle({ center = [0, 0], radius = 1 }, %, $tag1) |> circle({ center = [0, 0], radius = 1 }, %, $tag1)
|> extrude(h, %) |> extrude(length = h)
} }
// The vase is 100 layers tall. // The vase is 100 layers tall.
// The 100 layers are replica of each other, with a slight transformation applied to each. // The 100 layers are replica of each other, with a slight transformation applied to each.
@ -205,7 +205,7 @@ startSketchOn('XY')
center = [0, 0], center = [0, 0],
inscribed = false inscribed = false
}, %) }, %)
|> extrude(4, %) |> extrude(length = 4)
|> patternTransform(3, transform, %) |> patternTransform(3, transform, %)
``` ```

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -30,12 +30,12 @@ segEnd(tag: TagIdentifier) -> [number]
w = 15 w = 15
cube = startSketchOn('XY') cube = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([w, 0], %, $line1) |> line(end = [w, 0], tag = $line1)
|> line([0, w], %, $line2) |> line(end = [0, w], tag = $line2)
|> line([-w, 0], %, $line3) |> line(end = [-w, 0], tag = $line3)
|> line([0, -w], %, $line4) |> line(end = [0, -w], tag = $line4)
|> close(%) |> close()
|> extrude(5, %) |> extrude(length = 5)
fn cylinder(radius, tag) { fn cylinder(radius, tag) {
return startSketchOn('XY') return startSketchOn('XY')
@ -44,7 +44,7 @@ fn cylinder(radius, tag) {
radius = radius, radius = radius,
center = segEnd(tag) center = segEnd(tag)
}, %) }, %)
|> extrude(radius, %) |> extrude(length = radius)
} }
cylinder(1, line1) cylinder(1, line1)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -30,12 +30,12 @@ segStart(tag: TagIdentifier) -> [number]
w = 15 w = 15
cube = startSketchOn('XY') cube = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([w, 0], %, $line1) |> line(end = [w, 0], tag = $line1)
|> line([0, w], %, $line2) |> line(end = [0, w], tag = $line2)
|> line([-w, 0], %, $line3) |> line(end = [-w, 0], tag = $line3)
|> line([0, -w], %, $line4) |> line(end = [0, -w], tag = $line4)
|> close(%) |> close()
|> extrude(5, %) |> extrude(length = 5)
fn cylinder(radius, tag) { fn cylinder(radius, tag) {
return startSketchOn('XY') return startSketchOn('XY')
@ -44,7 +44,7 @@ fn cylinder(radius, tag) {
radius = radius, radius = radius,
center = segStart(tag) center = segStart(tag)
}, %) }, %)
|> extrude(radius, %) |> extrude(length = radius)
} }
cylinder(1, line1) cylinder(1, line1)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -31,11 +31,11 @@ shell(data: ShellData, solid_set: SolidSet) -> SolidSet
// Remove the end face for the extrusion. // Remove the end face for the extrusion.
firstSketch = startSketchOn('XY') firstSketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %) |> startProfileAt([-12, 12], %)
|> line([24, 0], %) |> line(end = [24, 0])
|> line([0, -24], %) |> line(end = [0, -24])
|> line([-24, 0], %) |> line(end = [-24, 0])
|> close(%) |> close()
|> extrude(6, %) |> extrude(length = 6)
// Remove the end face for the extrusion. // Remove the end face for the extrusion.
shell({ faces = ['end'], thickness = 0.25 }, firstSketch) shell({ faces = ['end'], thickness = 0.25 }, firstSketch)
@ -47,11 +47,11 @@ shell({ faces = ['end'], thickness = 0.25 }, firstSketch)
// Remove the start face for the extrusion. // Remove the start face for the extrusion.
firstSketch = startSketchOn('-XZ') firstSketch = startSketchOn('-XZ')
|> startProfileAt([-12, 12], %) |> startProfileAt([-12, 12], %)
|> line([24, 0], %) |> line(end = [24, 0])
|> line([0, -24], %) |> line(end = [0, -24])
|> line([-24, 0], %) |> line(end = [-24, 0])
|> close(%) |> close()
|> extrude(6, %) |> extrude(length = 6)
// Remove the start face for the extrusion. // Remove the start face for the extrusion.
shell({ faces = ['start'], thickness = 0.25 }, firstSketch) shell({ faces = ['start'], thickness = 0.25 }, firstSketch)
@ -63,11 +63,11 @@ shell({ faces = ['start'], thickness = 0.25 }, firstSketch)
// Remove a tagged face and the end face for the extrusion. // Remove a tagged face and the end face for the extrusion.
firstSketch = startSketchOn('XY') firstSketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %) |> startProfileAt([-12, 12], %)
|> line([24, 0], %) |> line(end = [24, 0])
|> line([0, -24], %) |> line(end = [0, -24])
|> line([-24, 0], %, $myTag) |> line(end = [-24, 0], tag = $myTag)
|> close(%) |> close()
|> extrude(6, %) |> extrude(length = 6)
// Remove a tagged face for the extrusion. // Remove a tagged face for the extrusion.
shell({ faces = [myTag], thickness = 0.25 }, firstSketch) shell({ faces = [myTag], thickness = 0.25 }, firstSketch)
@ -79,11 +79,11 @@ shell({ faces = [myTag], thickness = 0.25 }, firstSketch)
// Remove multiple faces at once. // Remove multiple faces at once.
firstSketch = startSketchOn('XY') firstSketch = startSketchOn('XY')
|> startProfileAt([-12, 12], %) |> startProfileAt([-12, 12], %)
|> line([24, 0], %) |> line(end = [24, 0])
|> line([0, -24], %) |> line(end = [0, -24])
|> line([-24, 0], %, $myTag) |> line(end = [-24, 0], tag = $myTag)
|> close(%) |> close()
|> extrude(6, %) |> extrude(length = 6)
// Remove a tagged face and the end face for the extrusion. // Remove a tagged face and the end face for the extrusion.
shell({ shell({
@ -99,25 +99,25 @@ shell({
size = 100 size = 100
case = startSketchOn('-XZ') case = startSketchOn('-XZ')
|> startProfileAt([-size, -size], %) |> startProfileAt([-size, -size], %)
|> line([2 * size, 0], %) |> line(end = [2 * size, 0])
|> line([0, 2 * size], %) |> line(end = [0, 2 * size])
|> tangentialArcTo([-size, size], %) |> tangentialArcTo([-size, size], %)
|> close(%) |> close()
|> extrude(65, %) |> extrude(length = 65)
thing1 = startSketchOn(case, 'end') thing1 = startSketchOn(case, 'end')
|> circle({ |> circle({
center = [-size / 2, -size / 2], center = [-size / 2, -size / 2],
radius = 25 radius = 25
}, %) }, %)
|> extrude(50, %) |> extrude(length = 50)
thing2 = startSketchOn(case, 'end') thing2 = startSketchOn(case, 'end')
|> circle({ |> circle({
center = [size / 2, -size / 2], center = [size / 2, -size / 2],
radius = 25 radius = 25
}, %) }, %)
|> extrude(50, %) |> extrude(length = 50)
// We put "case" in the shell function to shell the entire object. // We put "case" in the shell function to shell the entire object.
shell({ faces = ['start'], thickness = 5 }, case) shell({ faces = ['start'], thickness = 5 }, case)
@ -130,25 +130,25 @@ shell({ faces = ['start'], thickness = 5 }, case)
size = 100 size = 100
case = startSketchOn('XY') case = startSketchOn('XY')
|> startProfileAt([-size, -size], %) |> startProfileAt([-size, -size], %)
|> line([2 * size, 0], %) |> line(end = [2 * size, 0])
|> line([0, 2 * size], %) |> line(end = [0, 2 * size])
|> tangentialArcTo([-size, size], %) |> tangentialArcTo([-size, size], %)
|> close(%) |> close()
|> extrude(65, %) |> extrude(length = 65)
thing1 = startSketchOn(case, 'end') thing1 = startSketchOn(case, 'end')
|> circle({ |> circle({
center = [-size / 2, -size / 2], center = [-size / 2, -size / 2],
radius = 25 radius = 25
}, %) }, %)
|> extrude(50, %) |> extrude(length = 50)
thing2 = startSketchOn(case, 'end') thing2 = startSketchOn(case, 'end')
|> circle({ |> circle({
center = [size / 2, -size / 2], center = [size / 2, -size / 2],
radius = 25 radius = 25
}, %) }, %)
|> extrude(50, %) |> extrude(length = 50)
// We put "thing1" in the shell function to shell the end face of the object. // We put "thing1" in the shell function to shell the end face of the object.
shell({ faces = ['end'], thickness = 5 }, thing1) shell({ faces = ['end'], thickness = 5 }, thing1)
@ -164,25 +164,25 @@ shell({ faces = ['end'], thickness = 5 }, thing1)
size = 100 size = 100
case = startSketchOn('XY') case = startSketchOn('XY')
|> startProfileAt([-size, -size], %) |> startProfileAt([-size, -size], %)
|> line([2 * size, 0], %) |> line(end = [2 * size, 0])
|> line([0, 2 * size], %) |> line(end = [0, 2 * size])
|> tangentialArcTo([-size, size], %) |> tangentialArcTo([-size, size], %)
|> close(%) |> close()
|> extrude(65, %) |> extrude(length = 65)
thing1 = startSketchOn(case, 'end') thing1 = startSketchOn(case, 'end')
|> circle({ |> circle({
center = [-size / 2, -size / 2], center = [-size / 2, -size / 2],
radius = 25 radius = 25
}, %) }, %)
|> extrude(50, %) |> extrude(length = 50)
thing2 = startSketchOn(case, 'end') thing2 = startSketchOn(case, 'end')
|> circle({ |> circle({
center = [size / 2, -size / 2], center = [size / 2, -size / 2],
radius = 25 radius = 25
}, %) }, %)
|> extrude(50, %) |> extrude(length = 50)
// We put "thing1" and "thing2" in the shell function to shell the end face of the object. // We put "thing1" and "thing2" in the shell function to shell the end face of the object.
shell({ faces = ['end'], thickness = 5 }, [thing1, thing2]) shell({ faces = ['end'], thickness = 5 }, [thing1, thing2])

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -34,11 +34,11 @@ sweep(data: SweepData, sketch: Sketch) -> Solid
// Create a path for the sweep. // Create a path for the sweep.
sweepPath = startSketchOn('XZ') sweepPath = startSketchOn('XZ')
|> startProfileAt([0.05, 0.05], %) |> startProfileAt([0.05, 0.05], %)
|> line([0, 7], %) |> line(end = [0, 7])
|> tangentialArc({ offset = 90, radius = 5 }, %) |> tangentialArc({ offset = 90, radius = 5 }, %)
|> line([-3, 0], %) |> line(end = [-3, 0])
|> tangentialArc({ offset = -90, radius = 5 }, %) |> tangentialArc({ offset = -90, radius = 5 }, %)
|> line([0, 7], %) |> line(end = [0, 7])
// Create a hole for the pipe. // Create a hole for the pipe.
pipeHole = startSketchOn('XY') pipeHole = startSketchOn('XY')

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -151,7 +151,7 @@ async function doBasicSketch(
|> xLine(-segLen(seg01), %)`) |> xLine(-segLen(seg01), %)`)
} }
test.describe('Basic sketch', () => { test.describe('Basic sketch', { tag: ['@skipWin'] }, () => {
test.fixme('code pane open at start', async ({ page, homePage }) => { test.fixme('code pane open at start', async ({ page, homePage }) => {
await doBasicSketch(page, homePage, ['code']) await doBasicSketch(page, homePage, ['code'])
}) })

View File

@ -4,111 +4,124 @@ import { getUtils } from './test-utils'
import { EngineCommand } from 'lang/std/artifactGraph' import { EngineCommand } from 'lang/std/artifactGraph'
import { uuidv4 } from 'lib/utils' import { uuidv4 } from 'lib/utils'
test.describe('Can create sketches on all planes and their back sides', () => { test.describe(
const sketchOnPlaneAndBackSideTest = async ( 'Can create sketches on all planes and their back sides',
page: Page, { tag: ['@skipWin'] },
homePage: HomePageFixture, () => {
plane: string, const sketchOnPlaneAndBackSideTest = async (
clickCoords: { x: number; y: number } page: Page,
) => { homePage: HomePageFixture,
const u = await getUtils(page) plane: string,
const PUR = 400 / 37.5 //pixeltoUnitRatio clickCoords: { x: number; y: number }
await page.setBodyDimensions({ width: 1200, height: 500 }) ) => {
const u = await getUtils(page)
const PUR = 400 / 37.5 //pixeltoUnitRatio
await page.setBodyDimensions({ width: 1200, height: 500 })
await homePage.goToModelingScene() await homePage.goToModelingScene()
await u.openDebugPanel() await u.openDebugPanel()
const coord = const coord =
plane === '-XY' || plane === '-YZ' || plane === 'XZ' ? -100 : 100 plane === '-XY' || plane === '-YZ' || plane === 'XZ' ? -100 : 100
const camCommand: EngineCommand = { const camCommand: EngineCommand = {
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd_id: uuidv4(), cmd_id: uuidv4(),
cmd: { cmd: {
type: 'default_camera_look_at', type: 'default_camera_look_at',
center: { x: 0, y: 0, z: 0 }, center: { x: 0, y: 0, z: 0 },
vantage: { x: coord, y: coord, z: coord }, vantage: { x: coord, y: coord, z: coord },
up: { x: 0, y: 0, z: 1 }, up: { x: 0, y: 0, z: 1 },
}, },
} }
const updateCamCommand: EngineCommand = { const updateCamCommand: EngineCommand = {
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd_id: uuidv4(), cmd_id: uuidv4(),
cmd: { cmd: {
type: 'default_camera_get_settings', type: 'default_camera_get_settings',
}, },
}
const code = `sketch001 = startSketchOn('${plane}')profile001 = startProfileAt([0.9, -1.22], sketch001)`
await u.openDebugPanel()
await u.clearCommandLogs()
await page.getByRole('button', { name: 'Start Sketch' }).click()
await u.sendCustomCmd(camCommand)
await page.waitForTimeout(100)
await u.sendCustomCmd(updateCamCommand)
await u.closeDebugPanel()
await page.mouse.click(clickCoords.x, clickCoords.y)
await page.waitForTimeout(300) // wait for animation
await expect(
page.getByRole('button', { name: 'line Line', exact: true })
).toBeVisible()
// draw a line
const startXPx = 600
await u.closeDebugPanel()
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
await expect(page.locator('.cm-content')).toHaveText(code)
await page
.getByRole('button', { name: 'line Line', exact: true })
.first()
.click()
await u.openAndClearDebugPanel()
await page.getByRole('button', { name: 'Exit Sketch' }).click()
await u.expectCmdLog('[data-message-type="execution-done"]')
await u.clearCommandLogs()
await u.removeCurrentCode()
} }
test('XY', async ({ page, homePage }) => {
await sketchOnPlaneAndBackSideTest(
page,
homePage,
'XY',
{ x: 600, y: 388 } // red plane
// { x: 600, y: 400 }, // red plane // clicks grid helper and that causes problems, should fix so that these coords work too.
)
})
const code = `sketch001 = startSketchOn('${plane}')profile001 = startProfileAt([0.9, -1.22], sketch001)` test('YZ', async ({ page, homePage }) => {
await sketchOnPlaneAndBackSideTest(page, homePage, 'YZ', {
x: 700,
y: 250,
}) // green plane
})
await u.openDebugPanel() test('XZ', async ({ page, homePage }) => {
await sketchOnPlaneAndBackSideTest(page, homePage, '-XZ', {
x: 700,
y: 80,
}) // blue plane
})
await u.clearCommandLogs() test('-XY', async ({ page, homePage }) => {
await page.getByRole('button', { name: 'Start Sketch' }).click() await sketchOnPlaneAndBackSideTest(page, homePage, '-XY', {
x: 600,
y: 118,
}) // back of red plane
})
await u.sendCustomCmd(camCommand) test('-YZ', async ({ page, homePage }) => {
await page.waitForTimeout(100) await sketchOnPlaneAndBackSideTest(page, homePage, '-YZ', {
await u.sendCustomCmd(updateCamCommand) x: 700,
y: 219,
}) // back of green plan
})
await u.closeDebugPanel() test('-XZ', async ({ page, homePage }) => {
await page.mouse.click(clickCoords.x, clickCoords.y) await sketchOnPlaneAndBackSideTest(page, homePage, 'XZ', {
await page.waitForTimeout(300) // wait for animation x: 700,
y: 427,
await expect( }) // back of blue plane
page.getByRole('button', { name: 'line Line', exact: true }) })
).toBeVisible()
// draw a line
const startXPx = 600
await u.closeDebugPanel()
await page.mouse.click(startXPx + PUR * 10, 500 - PUR * 10)
await expect(page.locator('.cm-content')).toHaveText(code)
await page
.getByRole('button', { name: 'line Line', exact: true })
.first()
.click()
await u.openAndClearDebugPanel()
await page.getByRole('button', { name: 'Exit Sketch' }).click()
await u.expectCmdLog('[data-message-type="execution-done"]')
await u.clearCommandLogs()
await u.removeCurrentCode()
} }
test('XY', async ({ page, homePage }) => { )
await sketchOnPlaneAndBackSideTest(
page,
homePage,
'XY',
{ x: 600, y: 388 } // red plane
// { x: 600, y: 400 }, // red plane // clicks grid helper and that causes problems, should fix so that these coords work too.
)
})
test('YZ', async ({ page, homePage }) => {
await sketchOnPlaneAndBackSideTest(page, homePage, 'YZ', { x: 700, y: 250 }) // green plane
})
test('XZ', async ({ page, homePage }) => {
await sketchOnPlaneAndBackSideTest(page, homePage, '-XZ', { x: 700, y: 80 }) // blue plane
})
test('-XY', async ({ page, homePage }) => {
await sketchOnPlaneAndBackSideTest(page, homePage, '-XY', {
x: 600,
y: 118,
}) // back of red plane
})
test('-YZ', async ({ page, homePage }) => {
await sketchOnPlaneAndBackSideTest(page, homePage, '-YZ', {
x: 700,
y: 219,
}) // back of green plan
})
test('-XZ', async ({ page, homePage }) => {
await sketchOnPlaneAndBackSideTest(page, homePage, 'XZ', { x: 700, y: 427 }) // back of blue plane
})
})

View File

@ -6,7 +6,7 @@ import { bracket } from 'lib/exampleKcl'
import { TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW } from './storageStates' import { TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW } from './storageStates'
import fsp from 'fs/promises' import fsp from 'fs/promises'
test.describe('Code pane and errors', () => { test.describe('Code pane and errors', { tag: ['@skipWin'] }, () => {
test('Typing KCL errors induces a badge on the code pane button', async ({ test('Typing KCL errors induces a badge on the code pane button', async ({
page, page,
homePage, homePage,
@ -20,11 +20,11 @@ test.describe('Code pane and errors', () => {
`// Extruded Triangle `// Extruded Triangle
sketch001 = startSketchOn('XZ') sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([10, 0], %) |> line(end = [10, 0])
|> line([-5, 10], %) |> line(end = [-5, 10])
|> lineTo([profileStartX(%), profileStartY(%)], %) |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close(%) |> close()
extrude001 = extrude(5, sketch001)` extrude001 = extrude(sketch001, length = 5)`
) )
}) })
@ -79,8 +79,10 @@ test.describe('Code pane and errors', () => {
// Delete a character to break the KCL // Delete a character to break the KCL
await editor.openPane() await editor.openPane()
await editor.scrollToText('thickness, bracketLeg1Sketch)') await editor.scrollToText('bracketLeg1Sketch, length = thickness)')
await page.getByText('extrude(thickness, bracketLeg1Sketch)').click() await page
.getByText('extrude(bracketLeg1Sketch, length = thickness)')
.click()
await page.keyboard.press('Backspace') await page.keyboard.press('Backspace')
// Ensure that a badge appears on the button // Ensure that a badge appears on the button
@ -107,7 +109,7 @@ test.describe('Code pane and errors', () => {
await editor.openPane() await editor.openPane()
// Go to our problematic code again (missing closing paren!) // Go to our problematic code again (missing closing paren!)
await editor.scrollToText('extrude(thickness, bracketLeg1Sketch') await editor.scrollToText('extrude(bracketLeg1Sketch, length = thickness')
// Ensure that a badge appears on the button // Ensure that a badge appears on the button
await expect(codePaneButtonHolder).toContainText('notification') await expect(codePaneButtonHolder).toContainText('notification')

View File

@ -4,7 +4,7 @@ import { executorInputPath, getUtils } from './test-utils'
import { KCL_DEFAULT_LENGTH } from 'lib/constants' import { KCL_DEFAULT_LENGTH } from 'lib/constants'
import path from 'path' import path from 'path'
test.describe('Command bar tests', () => { test.describe('Command bar tests', { tag: ['@skipWin'] }, () => {
test('Extrude from command bar selects extrude line after', async ({ test('Extrude from command bar selects extrude line after', async ({
page, page,
homePage, homePage,
@ -14,10 +14,10 @@ test.describe('Command bar tests', () => {
'persistCode', 'persistCode',
`sketch001 = startSketchOn('XY') `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([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()
@ -42,7 +42,47 @@ test.describe('Command bar tests', () => {
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
await page.waitForTimeout(200) await page.waitForTimeout(200)
await expect(page.locator('.cm-activeLine')).toHaveText( await expect(page.locator('.cm-activeLine')).toHaveText(
`extrude001 = extrude(${KCL_DEFAULT_LENGTH}, sketch001)` `extrude001 = extrude(sketch001, length = ${KCL_DEFAULT_LENGTH})`
)
})
// TODO: fix this test after the electron migration
test.fixme('Fillet from command bar', async ({ page, homePage }) => {
await page.addInitScript(async () => {
localStorage.setItem(
'persistCode',
`sketch001 = startSketchOn('XY')
|> startProfileAt([-5, -5], %)
|> line(end = [0, 10])
|> line(end = [10, 0])
|> line(end = [0, -10])
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude001 = extrude(sketch001, length = -10)`
)
})
const u = await getUtils(page)
await page.setBodyDimensions({ width: 1000, height: 500 })
await homePage.goToModelingScene()
await u.openDebugPanel()
await u.expectCmdLog('[data-message-type="execution-done"]')
await u.closeDebugPanel()
const selectSegment = () => page.getByText(`line(end = [0, -10])`).click()
await selectSegment()
await page.waitForTimeout(100)
await page.getByRole('button', { name: 'Fillet' }).click()
await page.waitForTimeout(100)
await page.keyboard.press('Enter') // skip selection
await page.waitForTimeout(100)
await page.keyboard.press('Enter') // accept default radius
await page.waitForTimeout(100)
await page.keyboard.press('Enter') // submit
await page.waitForTimeout(100)
await expect(page.locator('.cm-activeLine')).toContainText(
`fillet({ radius = ${KCL_DEFAULT_LENGTH}, tags = [seg01] }, %)`
) )
}) })
@ -183,10 +223,10 @@ test.describe('Command bar tests', () => {
`distance = sqrt(20) `distance = sqrt(20)
sketch001 = startSketchOn('XZ') sketch001 = startSketchOn('XZ')
|> startProfileAt([-6.95, 10.98], %) |> startProfileAt([-6.95, 10.98], %)
|> line([25.1, 0.41], %) |> line(end = [25.1, 0.41])
|> line([0.73, -20.93], %) |> line(end = [0.73, -20.93])
|> line([-23.44, 0.52], %) |> line(end = [-23.44, 0.52])
|> close(%) |> close()
` `
) )
}) })
@ -251,7 +291,7 @@ test.describe('Command bar tests', () => {
await u.waitForCmdReceive('extrude') await u.waitForCmdReceive('extrude')
await expect(page.locator('.cm-content')).toContainText( await expect(page.locator('.cm-content')).toContainText(
'extrude001 = extrude(distance001, sketch001)' 'extrude001 = extrude(sketch001, length = distance001)'
) )
}) })

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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %) ` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %) ` `sketch001 = startSketchOn('XZ')fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `{thing: "blah"}fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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([0, scale], %) |> line([scale, 0], %) |> line([0, -scale], %) return sg}part001 = cube([0,0], 20) |> close(%) |> extrude(20, %)` `fn cube = (pos, scale) => { sg = startSketchOn('XY') |> startProfileAt(pos, %) |> line(end = [0, scale], %) |> line(end = [scale, 0]) |> line(end = [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

@ -20,7 +20,7 @@ test.describe('Debug pane', () => {
}) => { }) => {
const code = `sketch001 = startSketchOn('XZ') const code = `sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([1, 1], %) |> line(end = [1, 1])
` `
const u = await getUtils(page) const u = await getUtils(page)
await page.setBodyDimensions({ width: 1200, height: 500 }) await page.setBodyDimensions({ width: 1200, height: 500 })
@ -61,7 +61,7 @@ test.describe('Debug pane', () => {
} }
}) })
await test.step('Enter a comment', async () => { await test.step('Enter a comment', async () => {
await page.keyboard.type('|> line([2, 2], %)', { delay: 0 }) await page.keyboard.type('|> line(end = [2, 2])', { delay: 0 })
// Wait for keyboard input debounce and updated artifact graph. // Wait for keyboard input debounce and updated artifact graph.
await page.waitForTimeout(1000) await page.waitForTimeout(1000)
}) })

View File

@ -10,7 +10,7 @@ import {
import { join } from 'path' import { join } from 'path'
test.describe('Editor tests', () => { test.describe('Editor tests', { tag: ['@skipWin'] }, () => {
test('can comment out code with ctrl+/', async ({ page, homePage }) => { test('can comment out code with ctrl+/', async ({ page, homePage }) => {
const u = await getUtils(page) const u = await getUtils(page)
await page.setBodyDimensions({ width: 1000, height: 500 }) await page.setBodyDimensions({ width: 1000, height: 500 })
@ -23,10 +23,10 @@ test.describe('Editor tests', () => {
await u.codeLocator.click() await u.codeLocator.click()
await page.keyboard.type(`sketch001 = startSketchOn('XY') await page.keyboard.type(`sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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('/')
@ -35,10 +35,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XY') .toHaveText(`sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-20, 0], %) |> line(end = [-20, 0])
// |> close(%)`) // |> close()`)
// uncomment the code // uncomment the code
await page.keyboard.down('ControlOrMeta') await page.keyboard.down('ControlOrMeta')
@ -48,10 +48,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XY') .toHaveText(`sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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 ({
@ -67,10 +67,10 @@ test.describe('Editor tests', () => {
await u.codeLocator.click() await u.codeLocator.click()
await page.keyboard.type(`sketch001 = startSketchOn('XY') await page.keyboard.type(`sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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()
@ -116,10 +116,10 @@ test.describe('Editor tests', () => {
await u.codeLocator.click() await u.codeLocator.click()
await page.keyboard.type(`sketch001 = startSketchOn('XY') await page.keyboard.type(`sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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()
@ -171,20 +171,20 @@ test.describe('Editor tests', () => {
await u.codeLocator.click() await u.codeLocator.click()
await page.keyboard.type(`sketch001 = startSketchOn('XY') await page.keyboard.type(`sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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()
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XY') .toHaveText(`sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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 ({
@ -202,10 +202,10 @@ test.describe('Editor tests', () => {
await u.codeLocator.click() await u.codeLocator.click()
await page.keyboard.type(`sketch_001 = startSketchOn('XY') await page.keyboard.type(`sketch_001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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"]')
@ -230,10 +230,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch_001 = startSketchOn('XY') .toHaveText(`sketch_001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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()
@ -248,19 +248,19 @@ test.describe('Editor tests', () => {
test('fold gutters work', async ({ page, homePage }) => { test('fold gutters work', async ({ page, homePage }) => {
const fullCode = `sketch001 = startSketchOn('XY') const fullCode = `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-20, 0], %) |> line(end = [-20, 0])
|> close(%)` |> close()`
await page.addInitScript(async () => { await page.addInitScript(async () => {
localStorage.setItem( localStorage.setItem(
'persistCode', 'persistCode',
`sketch001 = startSketchOn('XY') `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-20, 0], %) |> line(end = [-20, 0])
|> close(%)` |> close()`
) )
}) })
await page.setBodyDimensions({ width: 1000, height: 500 }) await page.setBodyDimensions({ width: 1000, height: 500 })
@ -326,10 +326,10 @@ test.describe('Editor tests', () => {
'persistCode', 'persistCode',
`sketch001 = startSketchOn('XY') `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-20, 0], %) |> line(end = [-20, 0])
|> close(%)` |> close()`
) )
}) })
await page.setBodyDimensions({ width: 1000, height: 500 }) await page.setBodyDimensions({ width: 1000, height: 500 })
@ -358,7 +358,9 @@ test.describe('Editor tests', () => {
// Hover over the line function // Hover over the line function
await page.getByText('line').first().hover() await page.getByText('line').first().hover()
await expect(page.locator('.hover-tooltip')).toBeVisible() await expect(page.locator('.hover-tooltip')).toBeVisible()
await expect(page.getByText('Draw a line')).toBeVisible() await expect(
page.getByText('Extend the current sketch with a new straight line.')
).toBeVisible()
}) })
test('if you use the format keyboard binding it formats your code', async ({ test('if you use the format keyboard binding it formats your code', async ({
@ -371,10 +373,10 @@ test.describe('Editor tests', () => {
'persistCode', 'persistCode',
`sketch001 = startSketchOn('XY') `sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-20, 0], %) |> line(end = [-20, 0])
|> close(%)` |> close()`
) )
localStorage.setItem('disableAxis', 'true') localStorage.setItem('disableAxis', 'true')
}) })
@ -398,10 +400,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XY') .toHaveText(`sketch001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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 ({
@ -414,10 +416,10 @@ test.describe('Editor tests', () => {
'persistCode', 'persistCode',
`sketch_001 = startSketchOn('XY') `sketch_001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-20, 0], %) |> line(end = [-20, 0])
|> close(%)` |> close()`
) )
localStorage.setItem('disableAxis', 'true') localStorage.setItem('disableAxis', 'true')
}) })
@ -451,10 +453,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch_001 = startSketchOn('XY') .toHaveText(`sketch_001 = startSketchOn('XY')
|> startProfileAt([-10, -10], %) |> startProfileAt([-10, -10], %)
|> line([20, 0], %) |> line(end = [20, 0])
|> line([0, 20], %) |> line(end = [0, 20])
|> line([-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()
@ -519,9 +521,9 @@ test.describe('Editor tests', () => {
'persistCode', 'persistCode',
`sketch001 = startSketchOn('XZ') `sketch001 = startSketchOn('XZ')
|> startProfileAt([3.29, 7.86], %) |> startProfileAt([3.29, 7.86], %)
|> line([2.48, 2.44], %) |> line(end = [2.48, 2.44])
|> line([2.66, 1.17], %) |> line(end = [2.66, 1.17])
|> close(%) |> close()
` `
) )
}) })
@ -535,7 +537,7 @@ test.describe('Editor tests', () => {
await u.codeLocator.click() await u.codeLocator.click()
await page.getByText(' |> line([2.48, 2.44], %)').click() await page.getByText(' |> line(end = [2.48, 2.44])').click()
await expect( await expect(
page.locator('.cm-lint-marker-error').first() page.locator('.cm-lint-marker-error').first()
@ -643,10 +645,10 @@ test.describe('Editor tests', () => {
fn squareHole = (l, w) => { fn squareHole = (l, w) => {
squareHoleSketch = startSketchOn('XY') squareHoleSketch = startSketchOn('XY')
|> startProfileAt([-width / 2, -length / 2], %) |> startProfileAt([-width / 2, -length / 2], %)
|> lineTo([width / 2, -length / 2], %) |> line(endAbsolute = [width / 2, -length / 2])
|> lineTo([width / 2, length / 2], %) |> line(endAbsolute = [width / 2, length / 2])
|> lineTo([-width / 2, length / 2], %) |> line(endAbsolute = [-width / 2, length / 2])
|> close(%) |> close()
return squareHoleSketch return squareHoleSketch
} }
` `
@ -684,7 +686,7 @@ test.describe('Editor tests', () => {
await page.keyboard.type(`extrusion = startSketchOn('XY') await page.keyboard.type(`extrusion = startSketchOn('XY')
|> circle({ center: [0, 0], radius: dia/2 }, %) |> circle({ center: [0, 0], radius: dia/2 }, %)
|> hole(squareHole(length, width, height), %) |> hole(squareHole(length, width, height), %)
|> extrude(height, %)`) |> extrude(length = height)`)
// error in gutter // error in gutter
await expect(page.locator('.cm-lint-marker-error').first()).toBeVisible() await expect(page.locator('.cm-lint-marker-error').first()).toBeVisible()
@ -707,18 +709,18 @@ test.describe('Editor tests', () => {
'persistCode', 'persistCode',
`box = startSketchOn('XY') `box = startSketchOn('XY')
|> startProfileAt([0, 0], %) |> startProfileAt([0, 0], %)
|> line([0, 10], %) |> line(end = [0, 10])
|> line([10, 0], %) |> line(end = [10, 0])
|> line([0, -10], %, $revolveAxis) |> line(end = [0, -10], tag = $revolveAxis)
|> close(%) |> close()
|> extrude(10, %) |> extrude(length = 10)
sketch001 = startSketchOn(box, revolveAxis) sketch001 = startSketchOn(box, revolveAxis)
|> startProfileAt([5, 10], %) |> startProfileAt([5, 10], %)
|> line([0, -10], %) |> line(end = [0, -10])
|> line([2, 0], %) |> line(end = [2, 0])
|> line([0, -10], %) |> line(end = [0, -10])
|> close(%) |> close()
|> revolve({ |> revolve({
axis: revolveAxis, axis: revolveAxis,
angle: 90 angle: 90
@ -789,8 +791,7 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-tooltip-autocomplete')).toBeVisible() await expect(page.locator('.cm-tooltip-autocomplete')).toBeVisible()
await page.waitForTimeout(100) await page.waitForTimeout(100)
// press arrow down twice then enter to accept xLine // press arrow down then enter to accept xLine
await page.keyboard.press('ArrowDown')
await page.keyboard.press('ArrowDown') await page.keyboard.press('ArrowDown')
await page.keyboard.press('Enter') await page.keyboard.press('Enter')
// finish line with comment // finish line with comment
@ -863,8 +864,7 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-tooltip-autocomplete')).toBeVisible() await expect(page.locator('.cm-tooltip-autocomplete')).toBeVisible()
await page.waitForTimeout(100) await page.waitForTimeout(100)
// press arrow down twice then tab to accept xLine // press arrow down then tab to accept xLine
await page.keyboard.press('ArrowDown')
await page.keyboard.press('ArrowDown') await page.keyboard.press('ArrowDown')
await page.keyboard.press('Tab') await page.keyboard.press('Tab')
// finish line with comment // finish line with comment
@ -899,9 +899,9 @@ test.describe('Editor tests', () => {
'persistCode', 'persistCode',
`sketch001 = startSketchOn('XZ') `sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([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([12.73, -0.09], %) |> tangentialArcTo([24.95, -5.38], %) |> close(%)extrude001 = extrude(5, sketch001)` `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
@ -961,9 +961,9 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ') .toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -14.01], %) |> startProfileAt([4.61, -14.01], %)
|> line([12.73, -0.09], %) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -5.38], %) |> tangentialArcTo([24.95, -5.38], %)
|> close(%)`) |> close()`)
}) })
test( test(
@ -976,10 +976,10 @@ test.describe('Editor tests', () => {
'persistCode', 'persistCode',
`sketch001 = startSketchOn('XZ') `sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -10.01], %) |> startProfileAt([4.61, -10.01], %)
|> line([12.73, -0.09], %) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -0.38], %) |> tangentialArcTo([24.95, -0.38], %)
|> close(%) |> close()
|> extrude(5, %)` |> extrude(length = 5)`
) )
}) })
@ -1067,10 +1067,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ') .toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt([2.71, -2.71], %) |> startProfileAt([2.71, -2.71], %)
|> line([15.4, -2.78], %) |> line(end = [15.4, -2.78])
|> tangentialArcTo([27.6, -3.05], %) |> tangentialArcTo([27.6, -3.05], %)
|> close(%) |> close()
|> extrude(5, %) |> extrude(length = 5)
`) `)
// Hit undo // Hit undo
@ -1081,10 +1081,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ') .toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt([2.71, -2.71], %) |> startProfileAt([2.71, -2.71], %)
|> line([15.4, -2.78], %) |> line(end = [15.4, -2.78])
|> tangentialArcTo([24.95, -0.38], %) |> tangentialArcTo([24.95, -0.38], %)
|> close(%) |> close()
|> extrude(5, %)`) |> extrude(length = 5)`)
// Hit undo again. // Hit undo again.
await page.keyboard.down('Control') await page.keyboard.down('Control')
@ -1094,10 +1094,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ') .toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt([2.71, -2.71], %) |> startProfileAt([2.71, -2.71], %)
|> line([12.73, -0.09], %) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -0.38], %) |> tangentialArcTo([24.95, -0.38], %)
|> close(%) |> close()
|> extrude(5, %) |> extrude(length = 5)
`) `)
// Hit undo again. // Hit undo again.
@ -1109,10 +1109,10 @@ test.describe('Editor tests', () => {
await expect(page.locator('.cm-content')) await expect(page.locator('.cm-content'))
.toHaveText(`sketch001 = startSketchOn('XZ') .toHaveText(`sketch001 = startSketchOn('XZ')
|> startProfileAt([4.61, -10.01], %) |> startProfileAt([4.61, -10.01], %)
|> line([12.73, -0.09], %) |> line(end = [12.73, -0.09])
|> tangentialArcTo([24.95, -0.38], %) |> tangentialArcTo([24.95, -0.38], %)
|> close(%) |> close()
|> extrude(5, %)`) |> extrude(length = 5)`)
} }
) )

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