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

Ruler tools #1080

Merged
merged 26 commits into from
Feb 20, 2025
Merged

Ruler tools #1080

merged 26 commits into from
Feb 20, 2025

Conversation

kfarr
Copy link
Collaborator

@kfarr kfarr commented Feb 19, 2025

Must fix issues:

  • display the ruler value in the viewport when creating and when selected - via canvas? via three.js text?
  • redo (after undo) of measure-line segment doesn't work, not sure why
  • while in ruler mode, I cannot zoom or pan
  • ruler pointer - should be pointer finger instead
  • hide helper object from scene graph
  • proper removal of measurement css2d after removal

Other issues:

  • - the css2d labels are in front of other elements on the screen such as panels
  • metric / imperial switch

nice to have / to fix later:
(moved to #1081)

wait until people ask for it:

  • exporting an image doesn't show css2d labels
  • should this be hidden for gltf export?

@vincentfretin
Copy link
Collaborator

For label, you can use CSS2DObject/CSS2DRenderer
https://threejs.org/examples/?q=label#css2d_label

@kfarr
Copy link
Collaborator Author

kfarr commented Feb 19, 2025

@vincentfretin thanks for all the updates. The last commit that returns early on mouseup if camera has moved makes sense in theory, but in practice it seems to result in some valid clicks to the ruler not being recognized, both first or second ruler point placement clicks do not have an effect (even without apparent camera movement) approx 1/6th of the time. Perhaps cameramoved is firing too aggressively. After reverting it works OK where the user click is double counted as a ruler point placement and move event, and they can just undo the placement of the measure-line if they make one by mistake.

I wonder if there's a way to have a different type of threshold like the total distance the camera has moved at clickup, and the ruler click registers if the distance < 0.1, for example

@vincentfretin
Copy link
Collaborator

nice labels
You maybe want to remove those measure-lines entities from the glb export?

@kfarr kfarr marked this pull request as ready for review February 20, 2025 19:21
@kfarr kfarr merged commit 9155bc3 into main Feb 20, 2025
1 check passed
@kfarr kfarr deleted the ruler-tools branch February 20, 2025 19:21
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.

2 participants