[vtkusers] How to extract poly data from an unstructured grid

Elvis Dowson elvis.dowson at mac.com
Thu Oct 9 08:43:19 EDT 2008


Hi,
         The following code fragment works:

# Create an unstructured grids containing a triangle cell.
vtkPoints trianglePoints
   trianglePoints SetNumberOfPoints 3
   trianglePoints InsertPoint 0 0 0 0
   trianglePoints InsertPoint 1 1 0 0
   trianglePoints InsertPoint 2 .5 .5 0
vtkTriangle aTriangle
   [aTriangle GetPointIds] SetId 0 0
   [aTriangle GetPointIds] SetId 1 1
   [aTriangle GetPointIds] SetId 2 2
vtkUnstructuredGrid aTriangleGrid
   aTriangleGrid Allocate 1 1
   aTriangleGrid InsertNextCell [aTriangle GetCellType] [aTriangle  
GetPointIds]
   aTriangleGrid SetPoints trianglePoints

vtkDataSetSurfaceFilter triangleCellDataSetSurfaceFilter
   triangleCellDataSetSurfaceFilter SetInput aTriangleGrid

Thanks Dominik!

Best regards,

Elvis Dowson



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081009/bca4822c/attachment.htm>


More information about the vtkusers mailing list