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

Support for visualizing 1-dimensional line elements? #104

Open
ntm529 opened this issue May 9, 2022 · 1 comment
Open

Support for visualizing 1-dimensional line elements? #104

ntm529 opened this issue May 9, 2022 · 1 comment

Comments

@ntm529
Copy link

ntm529 commented May 9, 2022

Is there support within this package for one-dimensional line elements? I am visualizing 1-dimensional line elements within 3D in Paraview, and can't seem to find support for visualizing line elements within the package.

@jipolanco
Copy link
Member

Sorry, somehow I missed this issue when it first appeared. If I understand correctly, yes, it is possible to visualise 1-dimensional lines in 3D space. This is done using unstructured (or polydata) grids, see in particular the docs here.

Here is one full example adapted from the docs:

using WriteVTK

points = rand(3, 100)
lines = [MeshCell(PolyData.Lines(), i:(i + 5)) for i in 1:10:90]  # lines connecting 6 points each

vtk_grid("lines", points, lines) do vtk
    vtk["line_id"] = 1:length(lines)
end

In Paraview:

lines

Let me know if this solves the issue.

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