[vtkusers] Merge triangles and quads from vtkBandedPolydataContourFilter

Tim Gollnik Tim.Gollnik at t-online.de
Sat Oct 13 04:31:23 EDT 2007


Hello!

I need your help. I've constructed a vtkPolyData consisting of many triangles. 
They're all lying in a plane. (In fact i construct them from a regular grid 
within my application).  After passing the data through the 
vtkBandedPolydataContourFilter i get all these triangles again, and, of 
course, some of them are split up into triangles and quads. Fine. It looks 
very good! Each cell has its scalar attribute, as expected. There are large 
regions filled with triangles and quads with the same attribute. As expected, 
too.

Now my question: is it possible to merge all polygons with matching scalar 
attribute? I export these beautiful contour pictures via vtkGL2PSExporter. 
And now I want to reduce the file size of the resulting ps file. I tried 
vtkQuadricDecimation, but i'm not sure if this is the right filter or how i 
have to adjust all the switches (it's octave syntax, it should be quite 
similar to python):


  triangel = vtkTriangleFilter();
  triangel.SetInput(contours.GetOutput());

  dezimierer = vtkQuadricDecimation();
  dezimierer.SetInput(triangel.GetOutput());
  dezimierer.SetTargetReduction(0.9);

  % switches ?

  contMapper = vtkPolyDataMapper();
  contMapper.SetInput(dezimierer.GetOutput())

Or is there any other way to eliminate all the unneeded vertices and edges 
within each 'band'? Something which merges neighboring polygons to bigger 
ones, maybe finally getting only the outline of each colored band.

Thank you very much, you would cure my headache after these short 
nights..  ;-)

Tim

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071013/47872a8e/attachment.pgp>


More information about the vtkusers mailing list