Skip to content

Warnings and warn on angle defaults #7502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/playwright/editor-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ a1 = startSketchOn(offsetPlane(XY, offset = 10))
|> close()
|> revolve(
axis = revolveAxis,
angle = 90
angle = 90deg
)
`
)
Expand Down
130 changes: 64 additions & 66 deletions e2e/playwright/point-click.spec.ts

Large diffs are not rendered by default.

88 changes: 49 additions & 39 deletions e2e/playwright/sketch-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2100,11 +2100,11 @@
)
await crnRect1point2()
await editor.expectEditor.toContain(
`|> angledLine(angle = 0, length = 2.37, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 7.8)
`|> angledLine(angle = 0deg, length = 2.37, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 7.8)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()`.replaceAll('\n', '')

Check warning on line 2107 in e2e/playwright/sketch-tests.spec.ts

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

no-replaceall

The string method replaceAll is not supported in all versions of javascript and is not supported by older browser versions. Consider using replace with a regex as the first argument instead like mystring.replacebadg good instead of mystring.replaceAllbad good httpsdiscourse.threejs.orgtreplaceallisnotafunction14585
)

await crnRect2point1()
Expand All @@ -2115,11 +2115,11 @@
await crnRect2point2()
await page.waitForTimeout(300)
await editor.expectEditor.toContain(
`|> angledLine(angle = 0, length = 5.49, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 4.14)
`|> angledLine(angle = 0deg, length = 5.49, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90deg, length = 4.14)
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()`.replaceAll('\n', '')

Check warning on line 2122 in e2e/playwright/sketch-tests.spec.ts

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

no-replaceall

The string method replaceAll is not supported in all versions of javascript and is not supported by older browser versions. Consider using replace with a regex as the first argument instead like mystring.replacebadg good instead of mystring.replaceAllbad good httpsdiscourse.threejs.orgtreplaceallisnotafunction14585
)
})

Expand All @@ -2134,11 +2134,11 @@
await cntrRect1point2()
await page.waitForTimeout(300)
await editor.expectEditor.toContain(
`|> angledLine(angle = 0, length = 7.06, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) + 90, length = 4.34)
`|> angledLine(angle = 0deg, length = 7.06, tag = $rectangleSegmentA003)
|> angledLine(angle = segAng(rectangleSegmentA003) + 90deg, length = 4.34)
|> angledLine(angle = segAng(rectangleSegmentA003), length = -segLen(rectangleSegmentA003))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()`.replaceAll('\n', '')

Check warning on line 2141 in e2e/playwright/sketch-tests.spec.ts

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

no-replaceall

The string method replaceAll is not supported in all versions of javascript and is not supported by older browser versions. Consider using replace with a regex as the first argument instead like mystring.replacebadg good instead of mystring.replaceAllbad good httpsdiscourse.threejs.orgtreplaceallisnotafunction14585
)
await page.waitForTimeout(300)

Expand All @@ -2150,11 +2150,11 @@
await cntrRect2point2()
await page.waitForTimeout(300)
await editor.expectEditor.toContain(
`|> angledLine(angle = 0, length = 3.12, tag = $rectangleSegmentA004)
|> angledLine(angle = segAng(rectangleSegmentA004) + 90, length = 6.24)
`|> angledLine(angle = 0deg, length = 3.12, tag = $rectangleSegmentA004)
|> angledLine(angle = segAng(rectangleSegmentA004) + 90deg, length = 6.24)
|> angledLine(angle = segAng(rectangleSegmentA004), length = -segLen(rectangleSegmentA004))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()`.replaceAll('\n', '')

Check warning on line 2157 in e2e/playwright/sketch-tests.spec.ts

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

no-replaceall

The string method replaceAll is not supported in all versions of javascript and is not supported by older browser versions. Consider using replace with a regex as the first argument instead like mystring.replacebadg good instead of mystring.replaceAllbad good httpsdiscourse.threejs.orgtreplaceallisnotafunction14585
)
})

Expand Down Expand Up @@ -2300,8 +2300,8 @@
|> line(end = [8.61, 0.74])
|> line(end = [10.99, -5.22])
profile002 = startProfile(sketch001, at = [11.19, 5.02])
|> angledLine(angle = 0, length = 10.78, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 4.14)
|> angledLine(angle = 0deg, length = 10.78, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 4.14)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
Expand Down Expand Up @@ -2373,7 +2373,7 @@
await page.mouse.up()
await page.waitForTimeout(200)
await editor.expectEditor.toContain(
`angledLine(angle = -7, length = 10.27, tag = $rectangleSegmentA001)`
`angledLine(angle = -7deg, length = 10.27, tag = $rectangleSegmentA001)`
)
})

Expand Down Expand Up @@ -2415,11 +2415,11 @@
await page.waitForTimeout(100)
await rectEnd()
await editor.expectEditor.toContain(
`|> angledLine(angle = 180, length = 1.97, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) + 90, length = 3.89)
`|> angledLine(angle = 180deg, length = 1.97, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) + 90deg, length = 3.89)
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()`.replaceAll('\n', '')

Check warning on line 2422 in e2e/playwright/sketch-tests.spec.ts

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

no-replaceall

The string method replaceAll is not supported in all versions of javascript and is not supported by older browser versions. Consider using replace with a regex as the first argument instead like mystring.replacebadg good instead of mystring.replaceAllbad good httpsdiscourse.threejs.orgtreplaceallisnotafunction14585
)
})
})
Expand All @@ -2441,8 +2441,8 @@
|> line(end = [8.61, 0.74])
|> line(end = [10.99, -5.22])
profile002 = startProfile(sketch001, at = [11.19, 5.02])
|> angledLine(angle = 0, length = 10.78, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 4.14)
|> angledLine(angle = 0deg, length = 10.78, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 4.14)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
Expand Down Expand Up @@ -2771,8 +2771,8 @@
|> line(end = [4.52, 3.79])
|> line(end = [5.98, -2.81])
profile003 = startProfile(sketch002, at = [3.19, 13.3])
|> angledLine(angle = 0, length = 6.64, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 2.81)
|> angledLine(angle = 0deg, length = 6.64, tag = $rectangleSegmentA001)
|> angledLine(angle = segAng(rectangleSegmentA001) - 90deg, length = 2.81)
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
Expand All @@ -2789,7 +2789,7 @@
|> close()
revolve001 = revolve(
profile004,
angle = 45,
angle = 45deg,
axis = getNextAdjacentEdge(seg01)
)
extrude002 = extrude(profile006, length = 4)
Expand All @@ -2813,8 +2813,8 @@
radius = 2.67
)
profile011 = startProfile(sketch003, at = [5.07, -6.39])
|> angledLine(angle = 0, length = 4.54, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = 4.17)
|> angledLine(angle = 0deg, length = 4.54, tag = $rectangleSegmentA002)
|> angledLine(angle = segAng(rectangleSegmentA002) - 90deg, length = 4.17)
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002))
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
Expand Down Expand Up @@ -2966,7 +2966,7 @@
)
await rect1Crn2()
await editor.expectEditor.toContain(
`angledLine(angle = 0, length = 113.01, tag = $rectangleSegmentA001)`
`angledLine(angle = 0deg, length = 113.01, tag = $rectangleSegmentA001)`
)
})
test('Can enter sketch loft edges offsetPlane and continue sketch', async ({
Expand Down Expand Up @@ -3035,7 +3035,7 @@
)
await rect1Crn2()
await editor.expectEditor.toContain(
`angledLine(angle = 0, length = 106.42], tag = $rectangleSegmentA001)`
`angledLine(angle = 0deg, length = 106.42], tag = $rectangleSegmentA001)`
)
await page.waitForTimeout(100)
})
Expand Down Expand Up @@ -3257,8 +3257,8 @@
extrude001 = extrude(profile001, length = 500)
sketch002 = startSketchOn(extrude001, face = seg01)
profile002 = startProfile(sketch002, at = [83.39, 329.15])
|> angledLine(angle = 0, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 156.54, angle = -28)
|> angledLine(angle = 0deg, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 156.54, angle = -28deg)
|> angledLine(
angle = -151,
length = 116.27,
Expand Down Expand Up @@ -3296,7 +3296,9 @@
await expect
.poll(
async () => {
await editor.expectEditor.toContain('length = 156.54, angle = -28')
await editor.expectEditor.toContain(
'length = 156.54, angle = -28deg'
)
await page.mouse.move(handle1Location.x, handle1Location.y)
await page.mouse.down()
await page.mouse.move(
Expand All @@ -3307,7 +3309,9 @@
}
)
await page.mouse.up()
await editor.expectEditor.toContain('length = 231.59, angle = -34')
await editor.expectEditor.toContain(
'length = 231.59, angle = -34deg'
)
return true
},
{ timeout: 10_000 }
Expand All @@ -3325,7 +3329,7 @@

const handle2Location = { x: 872, y: 273 }
await test.step('Edit sketch again', async () => {
await editor.expectEditor.toContain('length = 231.59, angle = -34')
await editor.expectEditor.toContain('length = 231.59, angle = -34deg')
await page.waitForTimeout(500)
await expect
.poll(
Expand All @@ -3336,7 +3340,9 @@
steps: 5,
})
await page.mouse.up()
await editor.expectEditor.toContain('length = 167.36, angle = -14')
await editor.expectEditor.toContain(
'length = 167.36, angle = -14deg'
)
return true
},
{ timeout: 10_000 }
Expand All @@ -3361,14 +3367,18 @@
await expect
.poll(
async () => {
await editor.expectEditor.toContain('length = 167.36, angle = -14')
await editor.expectEditor.toContain(
'length = 167.36, angle = -14deg'
)
await page.mouse.move(handle3Location.x, handle3Location.y)
await page.mouse.down()
await page.mouse.move(handle3Location.x, handle3Location.y + 110, {
steps: 5,
})
await page.mouse.up()
await editor.expectEditor.toContain('length = 219.2, angle = -56')
await editor.expectEditor.toContain(
'length = 219.2, angle = -56deg'
)
return true
},
{ timeout: 10_000 }
Expand All @@ -3393,9 +3403,9 @@
extrude001 = extrude(profile001, length = 500)
sketch002 = startSketchOn(extrude001, face = seg01)
profile002 = startProfile(sketch002, at = [83.39, 329.15])
|> angledLine(angle = 0, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 219.2, angle = -56)
|> angledLine(angle = -151, length = 116.27)
|> angledLine(angle = 0deg, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 219.2, angle = -56deg)
|> angledLine(angle = -151deg, length = 116.27)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
profile003 = startProfile(sketch002, at = [-201.08, 254.17])
Expand Down Expand Up @@ -3432,10 +3442,10 @@
extrude001 = extrude(profile001, length = 500)
sketch002 = startSketchOn(extrude001, face = seg01)
profile002 = startProfile(sketch002, at = [83.39, 329.15])
|> angledLine(angle = 0, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 156.54, angle = -28)
|> angledLine(angle = 0deg, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 156.54, angle = -28deg)
|> angledLine(
angle = -151,
angle = -151deg,
length = 116.27,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
Expand Down Expand Up @@ -3496,10 +3506,10 @@
extrude001 = extrude(profile001, length = 500)
sketch002 = startSketchOn(extrude001, face = seg01)
profile002 = startProfile(sketch002, at = [83.39, 329.15])
|> angledLine(angle = 0, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 156.54, angle = -28)
|> angledLine(angle = 0deg, length = 119.61, tag = $rectangleSegmentA001)
|> angledLine(length = 156.54, angle = -28deg)
|> angledLine(
angle = -151,
angle = -151deg,
length = 116.27,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
Expand Down
18 changes: 9 additions & 9 deletions e2e/playwright/snapshot-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,14 +845,14 @@ test.describe('code color goober', { tag: '@snapshot' }, () => {
sweepPath = startSketchOn(XZ)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> tangentialArc(angle = 90deg, radius = 5)
|> line(end = [-3, 0])
|> tangentialArc(angle = -90, radius = 5)
|> tangentialArc(angle = -90deg, radius = 5)
|> line(end = [0, 7])

sweepSketch = startSketchOn(XY)
|> startProfile(at = [2, 0])
|> arc(angleStart = 0, angleEnd = 360, radius = 2)
|> arc(angleStart = 0, angleEnd = 360deg, radius = 2)
|> sweep(path = sweepPath)
|> appearance(
color = "#bb00ff",
Expand Down Expand Up @@ -889,14 +889,14 @@ sweepSketch = startSketchOn(XY)
sweepPath = startSketchOn(XZ)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> tangentialArc(angle = 90deg, radius = 5)
|> line(end = [-3, 0])
|> tangentialArc(angle = -90, radius = 5)
|> tangentialArc(angle = -90deg, radius = 5)
|> line(end = [0, 7])

sweepSketch = startSketchOn(XY)
|> startProfile(at = [2, 0])
|> arc(angleStart = 0, angleEnd = 360, radius = 2)
|> arc(angleStart = 0deg, angleEnd = 360deg, radius = 2)
|> sweep(path = sweepPath)
|> appearance(
color = '#bb00ff',
Expand Down Expand Up @@ -934,14 +934,14 @@ sweepSketch = startSketchOn(XY)
sweepPath = startSketchOn(XZ)
|> startProfile(at = [0.05, 0.05])
|> line(end = [0, 7])
|> tangentialArc(angle = 90, radius = 5)
|> tangentialArc(angle = 90deg, radius = 5)
|> line(end = [-3, 0])
|> tangentialArc(angle = -90, radius = 5)
|> tangentialArc(angle = -90deg, radius = 5)
|> line(end = [0, 7])

sweepSketch = startSketchOn(XY)
|> startProfile(at = [2, 0])
|> arc(angleStart = 0, angleEnd = 360, radius = 2)
|> arc(angleStart = 0deg, angleEnd = 360deg, radius = 2)
|> sweep(path = sweepPath)
|> appearance(
color = "#bb00ff",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading