[vtkusers] Question about unstructured grids

Martin Genet martin.genet at polytechnique.edu
Mon Feb 1 05:22:15 EST 2016


Hi Eric,

Paraview only displays cells, not points.

There are at least two solutions:
  - When you write the ugrid file, you can add vertices, which are cells 
containing a single point, using something like:
> cell = vtk.vtkVertex()
> cell_array = vtk.vtkCellArray()
> for k_point in xrange(ugrid.GetPoints().GetNumberOfPoints()):
>     cell.GetPointIds().SetId(0, k_point)
>     cell_array.InsertNextCell(cell)
> ugrid.SetCells(vtk.VTK_VERTEX, cell_array)
> for k_array in xrange(ugrid.GetPointData().GetNumberOfArrays()):
> ugrid.GetCellData().AddArray(ugrid.GetPointData().GetArray(k_array))
- Otherwise, if you have only points in your ugrid, you can glyph them 
in paraview, using for instance a sphere with fixed small diameter.

Martin

On 01/02/2016 05:07, Eric Robertson wrote:
> Hi all,
>
> I have a raw data set of X,Y,Z coordinates as well as a set of scalars 
> (lets call them A, B, C) which are stored at the aforementioned 
> coordinates. I use vtkUnstructuredGrid to create the domain, but when 
> I go to open the .vtu file in Paraview I see that there aren't any 
> cells to visualize.
>
> My question is- how do I go about providing 'cells' which use these 
> points as cell-centers?
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160201/53fae4ac/attachment.html>


More information about the vtkusers mailing list