-
Notifications
You must be signed in to change notification settings - Fork 102
Fix sketchOnFace point&click for booleans #6713
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
Changes from all commits
d994b18
83a951f
09a9613
a0cfa6e
614bfe7
d9b8b72
5cab762
649e934
2876a6c
1ff012f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1256,6 +1256,97 @@ profile001 = startProfile(sketch001, at = [299.72, 230.82]) | |
| }).toPass({ timeout: 40_000, intervals: [1_000] }) | ||
| }) | ||
|
|
||
| test('sketch on face of a boolean works', async ({ | ||
| page, | ||
| homePage, | ||
| scene, | ||
| cmdBar, | ||
| toolbar, | ||
| editor, | ||
| }) => { | ||
| await page.setBodyDimensions({ width: 1000, height: 500 }) | ||
|
|
||
| await page.addInitScript(async () => { | ||
| localStorage.setItem( | ||
| 'persistCode', | ||
| `@settings(defaultLengthUnit = mm) | ||
|
|
||
| myVar = 50 | ||
| sketch001 = startSketchOn(XZ) | ||
| profile001 = circle(sketch001, center = [myVar, 43.9], radius = 41.05) | ||
| extrude001 = extrude(profile001, length = 200) | ||
| |> translate(x = 3.14, y = 3.14, z = -50.154) | ||
| sketch002 = startSketchOn(XY) | ||
| profile002 = startProfile(sketch002, at = [72.2, -52.05]) | ||
| |> angledLine(angle = 0, length = 181.26, tag = $rectangleSegmentA001) | ||
| |> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 21.54) | ||
| |> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $mySeg) | ||
| |> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01) | ||
| |> close() | ||
|
|
||
| extrude002 = extrude(profile002, length = 151) | ||
| |> chamfer( | ||
| %, | ||
| length = 15, | ||
| tags = [mySeg], | ||
| tag = $seg02, | ||
| ) | ||
| solid001 = subtract([extrude001], tools = [extrude002]) | ||
| ` | ||
| ) | ||
| }) | ||
|
|
||
| const [selectChamferFaceClk] = scene.makeMouseHelpers(671, 283) | ||
| const [circleCenterClk] = scene.makeMouseHelpers(700, 272) | ||
| const [circleRadiusClk] = scene.makeMouseHelpers(694, 264) | ||
|
|
||
| await test.step('Setup', async () => { | ||
| await homePage.goToModelingScene() | ||
| await scene.settled(cmdBar) | ||
|
|
||
| await scene.moveCameraTo( | ||
| { x: 180, y: -75, z: 116 }, | ||
| { x: 67, y: -114, z: -15 } | ||
| ) | ||
| }) | ||
|
|
||
| await test.step('sketch on chamfer face that is part of a boolean', async () => { | ||
| await toolbar.startSketchPlaneSelection() | ||
| await selectChamferFaceClk() | ||
|
|
||
| await expect | ||
| .poll(async () => { | ||
| const lineBtn = page.getByRole('button', { name: 'line Line' }) | ||
| return lineBtn.getAttribute('aria-pressed') | ||
| }) | ||
| .toBe('true') | ||
|
|
||
| await editor.expectEditor.toContain( | ||
| 'startSketchOn(solid001, face = seg02)' | ||
| ) | ||
| }) | ||
|
|
||
| await test.step('verify sketching still works', async () => { | ||
| await toolbar.circleBtn.click() | ||
| await expect | ||
| .poll(async () => { | ||
| const circleBtn = page.getByRole('button', { name: 'circle Circle' }) | ||
| return circleBtn.getAttribute('aria-pressed') | ||
| }) | ||
| .toBe('true') | ||
|
Comment on lines
+1331
to
+1336
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity: is this meant to ensure we're ready to start sketching? As in, the highlight on the button is async after click, I guess as we "equip" the tool yes?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. |
||
|
|
||
| await circleCenterClk() | ||
| await editor.expectEditor.toContain( | ||
| 'profile003 = circle(sketch003, center' | ||
| ) | ||
|
|
||
| await circleRadiusClk() | ||
| await editor.expectEditor.toContain( | ||
| 'profile003 = circle(sketch003, center = [119.41, -56.05], radius = 1.82)' | ||
| ) | ||
| }) | ||
| }) | ||
|
|
||
| test('Can sketch on face when user defined function was used in the sketch', async ({ | ||
| page, | ||
| homePage, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this looks handy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah seems like a good proxy for execution finished