[vtkusers] Application of vtkDelauanay2D problem

Sarzynski, Melanie D melanies at tamu.edu
Wed Jan 19 16:28:44 EST 2005


I am attempting to use Delauanay2D to improve the triangulation of an 
isosurface consisting of points x,y,z where z is not a function of x and y.  
The goal is to obtain a triangulation that consists of non-skewed triangles 
appropriate for an FEA application.  The basic application reads in bmp 
image files then stacks them into a 3D space and uses MarchingCubes to 
generate the isosurface.  When I render the output file, the topology of the 
surface is completely different from what it should be.  Any assistance is 
appreciated.  The relevant parts of the code are below.

--------------------------------------------------------------------
//set up contour filter
	vtkImageMarchingCubes *contours = vtkImageMarchingCubes::New();
		contours->SetInput(ismooth->GetOutput());
		contours->SetValue(0, thresh);

//convert sqaures to triangles
	vtkTriangleFilter *triangles = vtkTriangleFilter::New();
		triangles->SetInput(contours->GetOutput());
	
//Delaunay2D triangulation
	vtkDelaunay2D *del = vtkDelaunay2D::New();
		del->SetInput(triangles->GetOutput());
		del->SetTransform(transform);
		del->BoundingTriangulationOff();
		del->SetTolerance(0.001);
		del->SetAlpha(0.0);
		
//set up data writer
	vtkPolyDataWriter *writer = vtkPolyDataWriter::New();
		writer->SetFileTypeToBinary();
		writer->SetFileName(output);
		writer->SetInput(del->GetOutput());
		writer->Write();

--------------------------------------------------------------------









More information about the vtkusers mailing list