[vtkusers] vtkGeometryFilter does not extract boundary faces

Teresa Azevedo dce06003 at fe.up.pt
Thu Oct 22 12:48:33 EDT 2009


Hello everybody.

I have a unstructured grid composed by voxels to visualize a 3D model  
of a hand built by using an octree structure (voxels' size are bigger  
inside the hand and go smaller has they get closer to the surface).
I would like to extract the exact (without interpolation) voxel boundary.
Searching the VTK list, I found vtkGeometryFilter, which states that  
"All 2D faces that are used by only one 3D cell (i.e., boundary faces)  
are extracted".
Unfortunately, it just triangulates ALL the voxels' faces!!!

Here is part of my code:

vtkGeometryFilter* geomFilter = vtkGeometryFilter::New();
geomFilter->SetInput(octreeUnsGrid); //vtkUnstructuredGrid*
geomFilter->MergingOn();

vtkTriangleFilter *triangles = vtkTriangleFilter::New();
triangles->SetInput(geomFilter->GetOutput());

vtkSTLWriter *stl = vtkSTLWriter::New();
stl->SetInputConnection(triangles->GetOutputPort());
stl->SetFileName("triangles3.stl");
stl->Write();


Can somebody please help me?

Thank you very much,
Teresa Azevedo





More information about the vtkusers mailing list