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

Simple line and arrows #217

Closed
ga72kud opened this issue Jun 17, 2022 · 2 comments
Closed

Simple line and arrows #217

ga72kud opened this issue Jun 17, 2022 · 2 comments

Comments

@ga72kud
Copy link

ga72kud commented Jun 17, 2022

Hi, thank you for the excellent package. Is there a simple and fast solution for visualizing a line and arrows (should I use polygon of geometry basics?)? I want to visualize a point cloud and compute the nearest neighbor graph.
3dimensional Line, in the documentation, is a 2dim line mentioned

@ga72kud
Copy link
Author

ga72kud commented Jun 17, 2022

Seems like to have use shaft = Cylinder(zero(Point{3, Float64}), Point(0.0, 0.0, 10.0), 0.1)
setobject!(vis, shaft)

@ga72kud ga72kud closed this as completed Jun 17, 2022
@ferrolho
Copy link
Collaborator

Hi @ga72kud,

For simple line segments, you can use something like this:

function show_path(vis::Visualizer, points::Matrix{Float64})
    points = collect(eachcol(points))
    material = LineBasicMaterial(color=colorant"yellow", linewidth=2.0)
    setobject!(vis["path"], Object(PointCloud(points), material, "Line"))
    nothing
end

For arrows, see this JuliaRobotics/RigidBodyDynamics.jl#589 (comment).

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