<div>Hi,<br><br>I searched the entire mail archive for answer to my problem, but found only problems no solutions to them.<br><br>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
<br>vertics.<br><br>Here is the code snippet that i am using to get the output as set of triangles.<br><br>vtkDelaunay2D* pDelny = vtkDelaunay2D::New( );<br>vtkPolyData* pPointSet = vtkPolyData::New( );<br>vtkPoints* pPoints = vtkPoints::New( );
<br><br> //collects the points i.e. x , y, and z<br>GetPoints( pPoints );<br><br>pPointSet->SetPoints( pPoints );<br><br>//now generate the vtk file<br>vtkPolyDataWriter* writer = vtkPolyDataWriter::New();
<br>writer->SetFileName( "c:\\earth.vtk");<br>writer->SetInput( pPointSet );<br>writer->Write(); //throws an exception<br>writer->Update();<br> <strong> /***the generated vtk file contains the only one fixed value***/
<br> ///However i am not usig this file<br></strong><br>pDelny->SetTolerance( 0.001 );<br>//pDelny->SetBoundingTriangulation(1);<br>pDelny->SetAlpha( 1 );<br>//pDelny->BoundingTriangulationOff();<br>
//pDelny->SetOffset( 1000 );</div>
<div><br>pDelny->SetInput(pPointSet); <br>pDelny->SetSource( pPointSet );<br>pDelny->Update();</div>
<div> </div>
<div>
<p> vtkPolyData* pVtkData = pDelny->GetOutput( );<br> int nsize = pVtkData->GetNumberOfCells(); //returned the same number as the number of points<br> vtkCellArray* cellPol = pVtkData->GetPolys(); //zero returned
<br> int numpol = cellPol->GetNumberOfCells();<br> vtkCellArray* cellVert = pVtkData->GetVerts();<br> int numver = cellVert->GetNumberOfCells(); //returned the same number as the number of points</p>
<p> nCells = pVtkData->GetNumberOfPolys();<br> nCnt3 = pVtkData->GetNumberOfVerts(); //returned the same number as the number of points</p>
<p>But where are the triangles????</p></div>
<div>Now through pDelny->GetOutput I am expecting set of triangles in vtkPolyData object.</div>
<div>Am I right? <br><br>Thanks</div>