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

Nadro/adhoc/enter sketch mode bug fix #4529

Merged
merged 5 commits into from
Nov 22, 2024
Merged

Conversation

nadr0
Copy link
Collaborator

@nadr0 nadr0 commented Nov 20, 2024

closes #4524

Bug

2024-11-20.14-41-43.mp4

When you click in a specific timing window you can brick the ray casting into the threejs scene.
Josh reported this bug.

Root cause

The three.js intersection plane and draft point groups were not being properly created. This means that the raycasting code on the plane to pick the points would return an empty array and say nothing was intersected.

Issues

  • createIntersectionPlane is being added and removed in several locations when it does not need to be
  • draftPointGroups were being appended to over time and not properly removed
  • We entered the Line tool twice when going into the mode due to a proxy state

Fixes

  • I only create the intersection plane once within the constructor because it can live for the entire application runtime. State does not need to be managed for this three.js scene child
  • draftPointGroups are tracked within the class to be added to an array then cleared when _teardownsketch is called. They should not be infinitely appended to the array
  • Line tool is only ever entered once when entering sketch mode.

Future issues

I can still recreate the issue but what is happening is the system appears to buffer a bunch of clicks then render them all at once then goes back to normal.

I can attempt to fix this in another PR because they are two separate issues. The original bug prevented you from clicking points. This new bug is a delay in the rendering of the mouse clicks.

Copy link

qa-wolf bot commented Nov 20, 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 Nov 20, 2024

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

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Nov 22, 2024 3:50pm

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 only two minor questions

src/machines/modelingMachine.ts Show resolved Hide resolved
src/clientSideScene/sceneEntities.ts Show resolved Hide resolved
@lf94 lf94 enabled auto-merge (squash) November 22, 2024 15:53
@lf94 lf94 merged commit 2529066 into main Nov 22, 2024
27 checks passed
@lf94 lf94 deleted the nadro/adhoc/enter-sketch-mode-bug-fix branch November 22, 2024 16:05
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.

Can't Sketch Lines
2 participants