WriteVTK.jl icon indicating copy to clipboard operation
WriteVTK.jl copied to clipboard

Support for visualizing 1-dimensional line elements?

Open ntm529 opened this issue 2 years ago • 1 comments

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.

ntm529 avatar May 09 '22 21:05 ntm529

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.

jipolanco avatar May 20 '22 08:05 jipolanco