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

Plotting curves #170

Open
evcastelani opened this issue Jul 12, 2020 · 1 comment
Open

Plotting curves #170

evcastelani opened this issue Jul 12, 2020 · 1 comment
Labels
question Further information is requested

Comments

@evcastelani
Copy link

First of all, MeshCat.jl is awesome! Great job! Second, if possible, I would like some tip to build a curve in R^3. For example, considering the equation (x-1)^2+(y-1)^2+z^2-4+5x-3y-z-2 x=0 (I know, it is the intersection of a sphere with a plan) or any other implicit curve, how can I plot this curve?

@ferrolho ferrolho added the question Further information is requested label May 22, 2023
@ferrolho
Copy link
Collaborator

I am not sure how to go about converting an implicit curve (like the one you wrote) into a set of points that you can then use for rendering the curve in MeshCat.

But here's an example of how to render an explicit function, e.g., f(x) = x^2:

using Colors
using MeshCat

vis = Visualizer()
open(vis)

f(x) = x^2

points = [[x, 0, f(x)] for x = -1:0.1:1]

pointcloud = PointCloud(points)
material = LineBasicMaterial(color=colorant"yellow", linewidth=2)
setobject!(vis["line"], Object(pointcloud, material, "Line"))

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants