KittyCAD / modeling-app

The KittyCAD modeling app.
https://kittycad.io/modeling-app/download
MIT License
411 stars 35 forks source link

Multiple Bugs: (Zoom and Drag Problems) #3232

Open jgomez720 opened 3 months ago

jgomez720 commented 3 months ago

Description

There are several bugs that I encountered in this one video. I cannot tell if they are engine or front end issues, so forgive me for assigning all of you. @jessfraz and I were discussing zoom problems and this was my attempt to recreate them. These things are disorienting.

0:11 - Background model flipped 90 degrees when dragging. 0:20 - "Flash of nothing" before zooming back to the model outside of sketch mode. (sometimes this will also zoom super far into the model before zooming back out) 0:28 - Model Flips 90 degrees when dragging again.

Version

v0.24.6

Recording

https://github.com/user-attachments/assets/3e1f68b7-2938-4f83-86d6-ff3fa3472ccd

KCL

const sketch001 = startSketchOn('-YZ') |> startProfileAt([-0.4, 17.25], %) |> line([18.77, -14.07], %, $seg01) |> line([-14.82, -16.08], %) |> line([-11.05, 14.53], %) |> lineTo([profileStartX(%), profileStartY(%)], %, $seg02) |> close(%) const extrude001 = extrude(5, sketch001) const sketch002 = startSketchOn(extrude001, seg02) |> startProfileAt([0.93, 5.33], %) |> line([2.67, -6.6], %) |> line([-2.5, -5.52], %) |> line([-1.21, 4.12], %) |> lineTo([profileStartX(%), profileStartY(%)], %) |> close(%)

mlfarrell commented 3 months ago

will check out engine side of this later today

mlfarrell commented 3 months ago

looks like a bad attempted interpolation about the pole (camera-up singularity problem). confirming that real quick

mlfarrell commented 3 months ago

turns out no bad interpolation is happening, granted I see how it can be jarring a bit. uploading video explanation to slack (since this is a public repo)

https://kittycadworkspace.slack.com/archives/C04KFV6NKL0/p1722638146678039?thread_ts=1722638096.977399&cid=C04KFV6NKL0

lf94 commented 1 month ago

I'm unable to reproduce today. @franknoirot could you try as well? As well as https://github.com/KittyCAD/modeling-app/issues/3125 ? @nadr0 wouldn't hurt if you gave it a quick try too.

I believe our introduction of https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture has fixed some jank input issues.

franknoirot commented 1 month ago

I agree @lf94 I can't reproduce. One last thing I'd like to try later is triggering an engine disconnection as I enter sketch mode; the disappearance and reappearance of the 3D scene between 0:10–0:11 makes me think that this is what occurred. When that reset happened, I believe the 90º camera rotation was lost. So this seems like a behavior that will be removed by your camera restoration work underway now actually.

franknoirot commented 1 month ago

No, never mind. I still believe that what we see at 0:10 is some connection issue, but I do not believe that this is the UX that a user would have today, even without @lf94's efforts to save and restore camera state.

This demo shows attempting to reproduce that issue by intentionally triggering an engine disconnection with our window.tearDown() utility. It fails to reproduce the behavior, because we exit sketch mode at part of engine disconnection.

https://github.com/user-attachments/assets/58a7fd21-0720-4187-b03a-4470bfb77817

I wish I could say for certain the issue and the fix though.

mlfarrell commented 1 month ago

update me on mon if you still need me to look at this. I can throw it to the end of the fifo