Skip to content
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

Sketch on chamfer UI #3918

Merged
merged 21 commits into from
Sep 26, 2024
Merged

Sketch on chamfer UI #3918

merged 21 commits into from
Sep 26, 2024

Conversation

Irev-Dev
Copy link
Collaborator

@Irev-Dev Irev-Dev commented Sep 19, 2024

Screenshare.-.2024-09-23.3_42_37.PM.mp4

Related to https://github.com/KittyCAD/engine/issues/2651

Copy link

qa-wolf bot commented Sep 19, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Sep 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Sep 26, 2024 5:56am

@Irev-Dev Irev-Dev changed the title [WIP] Sketch on chamfer UI Sketch on chamfer UI Sep 23, 2024
@Irev-Dev Irev-Dev marked this pull request as ready for review September 23, 2024 05:17
@@ -436,10 +436,10 @@ export function getArtifactsToUpdate({
response.data.modeling_response.type === 'solid3d_get_opposite_edge' &&
response.data.modeling_response.data.edge) ||
// or is adjacent edge
(cmd.type === 'solid3d_get_prev_adjacent_edge' &&
(cmd.type === 'solid3d_get_next_adjacent_edge' &&
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is related to https://github.com/KittyCAD/engine/issues/2467 and the fix for it engine side, writing the tests for sketch on chamfer I a bug and this is the fix (along with a rust change)

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.20%. Comparing base (90f0f13) to head (b78cc66).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3918   +/-   ##
=======================================
  Coverage   87.20%   87.20%           
=======================================
  Files          70       70           
  Lines       25255    25255           
=======================================
  Hits        22023    22023           
  Misses       3232     3232           
Flag Coverage Δ
wasm-lib 87.20% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

expressionName: string
) {
expressionName: string,
edgeCutMeta: EdgeCutInfo | null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you've probably explained it already, sorry if asking again, but what is edge cut meta ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

It's some metadata that needed to know how to break up the chamfer call expressions

i.e.

chamfer({
       length: 18,
       tags: [getNextAdjacentEdge(seg01), seg02]
     }, %)

needs to be broken into two chamfer calls for each of the tags in the array, so that a tag declorator can be added to one of them, but some extra information is needed to know which one needs the tag declorator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most the changes in this file are work-arounds that will ultimately be resolved by #3836

But bumping int this again is really motivating me to do the above ☝️

I left a todo comment referencing that issue too.

* initial break up

* rename main fixture file

* add more expect state pattern
Copy link
Contributor

@lf94 lf94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! I still need to try it out in-app but the code review is done.

src/components/ModelingMachineProvider.tsx Show resolved Hide resolved
src/hooks/useEngineConnectionSubscriptions.ts Show resolved Hide resolved
src/lang/std/artifactGraph.ts Show resolved Hide resolved
src/lang/std/sketch.ts Show resolved Hide resolved
src/lib/selections.ts Show resolved Hide resolved
@Irev-Dev Irev-Dev mentioned this pull request Sep 25, 2024
@Irev-Dev
Copy link
Collaborator Author

Think this is ready for another look @lf94
Though now it is a bit cluttered with the diff from #3964

Copy link
Contributor

@lf94 lf94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just a little odd behavior in the case of chamfer being shrunk but not a blocker.

Copy link
Collaborator

@franknoirot franknoirot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I'm losing steam part way through, everything is looking good but I ran into a question. Is it expected to not be covering the case where a chamfer is separately defined, not as a pipe operation from an extrude call? I can't sketch on the chamfer with the following code, for example:

const sketch001 = startSketchOn('XZ')
  |> startProfileAt([-169.52, 219.21], %)
  |> angledLine([0, 369.25], %, $rectangleSegmentA001)
  |> angledLine([
       segAng(rectangleSegmentA001) - 90,
       390.68
     ], %, $rectangleSegmentB001)
  |> angledLine([
       segAng(rectangleSegmentA001),
       -segLen(rectangleSegmentA001)
     ], %, $rectangleSegmentC001)
  |> lineTo([profileStartX(%), profileStartY(%)], %)
  |> close(%)
const extrude001 = extrude(200, sketch001)
const chamfer001 = chamfer({
       length: 100,
       tags: [
         getPreviousAdjacentEdge(rectangleSegmentA001)
       ]
     }, extrude001)

e2e/playwright/cmdBarFixture.ts Outdated Show resolved Hide resolved
{ steps: 5 }
)

await scene.moveCameraTo(cameraPos, cameraTarget)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[C] this is awesome

e2e/playwright/point-click.spec.ts Outdated Show resolved Hide resolved
e2e/playwright/point-click.spec.ts Outdated Show resolved Hide resolved
e2e/playwright/testing-selections.spec.ts Outdated Show resolved Hide resolved
Comment on lines +131 to +133
await rectangle2ndMove({
pixelDiff: 50,
})
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I integrated an option pixelDiff into the move and click helpers, i.e do the click and wait until there's a pixel diff.

@Irev-Dev
Copy link
Collaborator Author

Made the chamfer work when it's not in a pipeExpression, and added a unit and e2e test for that case. Thanks @franknoirot

@Irev-Dev
Copy link
Collaborator Author

https://github.com/KittyCAD/modeling-app/actions/runs/11046307526/job/30690674459?pr=3918 failed, but I'm certain this is related to the export changes we've been seeing of late.

@Irev-Dev Irev-Dev merged commit 579151a into main Sep 26, 2024
28 of 30 checks passed
@Irev-Dev Irev-Dev deleted the kurt-sketch-on-chamfer branch September 26, 2024 08:25
@nadr0 nadr0 mentioned this pull request Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants