[vtkusers] vtkDelauany2D triangulation--But where are the triangles????
Dhaniram Kshirsagar
kdhani99 at gmail.com
Fri Nov 4 03:09:57 EST 2005
Hi,
I searched the entire mail archive for answer to my problem, but found only
problems no solutions to them.
My problem is, I have input points in the form of x, y and z (large
numbers(double type)) and i want the output as the set of triangles, however
i am getting only the
vertics.
Here is the code snippet that i am using to get the output as set of
triangles.
vtkDelaunay2D* pDelny = vtkDelaunay2D::New( );
vtkPolyData* pPointSet = vtkPolyData::New( );
vtkPoints* pPoints = vtkPoints::New( );
//collects the points i.e. x , y, and z
GetPoints( pPoints );
pPointSet->SetPoints( pPoints );
//now generate the vtk file
vtkPolyDataWriter* writer = vtkPolyDataWriter::New();
writer->SetFileName( "c:\\earth.vtk");
writer->SetInput( pPointSet );
writer->Write(); //throws an exception
writer->Update();
* /***the generated vtk file contains the only one fixed value***/
///However i am not usig this file
*
pDelny->SetTolerance( 0.001 );
//pDelny->SetBoundingTriangulation(1);
pDelny->SetAlpha( 1 );
//pDelny->BoundingTriangulationOff();
//pDelny->SetOffset( 1000 );
pDelny->SetInput(pPointSet);
pDelny->SetSource( pPointSet );
pDelny->Update();
vtkPolyData* pVtkData = pDelny->GetOutput( );
int nsize = pVtkData->GetNumberOfCells(); //returned the same number as the
number of points
vtkCellArray* cellPol = pVtkData->GetPolys(); //zero returned
int numpol = cellPol->GetNumberOfCells();
vtkCellArray* cellVert = pVtkData->GetVerts();
int numver = cellVert->GetNumberOfCells(); //returned the same number as the
number of points
nCells = pVtkData->GetNumberOfPolys();
nCnt3 = pVtkData->GetNumberOfVerts(); //returned the same number as the
number of points
But where are the triangles????
Now through pDelny->GetOutput I am expecting set of triangles in vtkPolyData
object.
Am I right?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051104/5b89843a/attachment.htm>
More information about the vtkusers
mailing list