[vtkusers] Delaunay surface triangulation in 3D

Doug Hackworth doug.hackworth at vanderbilt.edu
Fri Oct 17 17:10:13 EDT 2008


> Just run GeometryFilter without "SomeOtherMethod". I thing the default
> behaviour is wnat you want.

Hmmm.  Well, it's not working for me that way, but perhaps I'm missing 
something.  Here's my code, from the 3D Delaunay operation on down:

// Do surface triangulation
vtkDelaunay3D* delny = vtkDelaunay3D::New();
delny->SetInput(pPolyData);
delny->SetTolerance(0.001);
delny->Update();

// Store Delaunay output as PolyData
vtkUnstructuredGrid* usg = vtkUnstructuredGrid::New();
usg = delny->GetOutput();
vtkPolyData* pd = vtkPolyData::New();
pd->SetPoints(usg->GetPoints());
pd->SetPolys(usg->GetCells());

// Get surface triangles with geometry filter
vtkGeometryFilter* geom = vtkGeometryFilter::New();
geom->SetInput(pd);
geom->Update();

// Write the surface triangles to file as PolyData
vtkPolyDataWriter* pWriter = vtkPolyDataWriter::New();
pWriter->SetFileName(szOutfile.c_str());
pWriter->SetInput(geom->GetOutput());
pWriter->Write();

...The PolyData file that comes out this end still has all the 
tetrahedrons intact (and nothing else).  Perhaps there's a mistake here 
that I'm just not seeing...?

Thanks,
Doug





More information about the vtkusers mailing list