JuliaVTK / WriteVTK.jl

Julia package for writing VTK XML files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for visualizing 1-dimensional line elements?

ntm529 opened this issue · comments

commented

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.

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.