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

Is it possible to draw curves? #253

Closed
davibarreira opened this issue Apr 23, 2024 · 6 comments
Closed

Is it possible to draw curves? #253

davibarreira opened this issue Apr 23, 2024 · 6 comments

Comments

@davibarreira
Copy link

In three.js, I see that it is possible to draw curves, such as Beziers and Nurbs. Moreover, one can even draw curved surfaces. I was wondering if there is a way to do this using meshcat.

@ferrolho
Copy link
Collaborator

Hi Davi, you can draw curved lines (see this comment and an example here) and contours as well (see the README example).

@davibarreira
Copy link
Author

Thanks for the answer @ferrolho . If I understood, is your solution for curved lines to divide in several line segments? I was looking for Bezier curves and the like.

@ferrolho
Copy link
Collaborator

Yes, you understood correctly — I sample a few points along the curved line I want to display, and then display it. It seems three.js supports quadratic bezier curves (see https://threejs.org/docs/#api/en/extras/curves/QuadraticBezierCurve), but I don't think this feature is exposed in MeshCat.jl. If you give it a go, please feel free to open a PR. Thanks!

@davibarreira
Copy link
Author

Thanks, I'll try to do so.

@davibarreira
Copy link
Author

@ferrolho , the implementation of curves should be done on MeshCat.jl or on the original meshcat library?

@ferrolho
Copy link
Collaborator

ferrolho commented Nov 8, 2024

I am not sure why I missed your comment... So, apologies for the really long delay in replying. Exposing something from three.js to meshcat will have to be done in the core library — https://github.com/meshcat-dev/meshcat. Then, once that is exposed, you should be able to use it from MeshCat.jl or meshcat-python.

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

No branches or pull requests

2 participants