<div>Hi Sylvain,</div>
<div>&nbsp;</div>
<div>After setting the vtkcellarray(for polys) in vtkpolydata (which is input to the delaunay2d), Now I am able to get the triangles.</div>
<div>&nbsp;</div>
<div>Thankx<br><br>&nbsp;</div>
<div><span class="gmail_quote">2005/11/4, Sylvain Jaume &lt;<a href="mailto:sylvain.jaume@kitware.com">sylvain.jaume@kitware.com</a>&gt;:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Dhaniram Kshirsagar,<br><br>You don't need to use delaunay-&gt;SetSource().<br>Use it only if you want constrained Delaunay.
<br><br>Cheers,<br>Sylvain<br><br>Dhaniram Kshirsagar wrote:<br><br>&gt; Hi,<br>&gt;<br>&gt; I searched the entire mail archive for answer to my problem, but found<br>&gt; only problems no solutions to them.<br>&gt;<br>&gt; My problem is, I have input points in the form of x, y and z (large
<br>&gt; numbers(double type)) and i want the output as the set of triangles,<br>&gt; however i am getting only the<br>&gt; vertics.<br>&gt;<br>&gt; Here is the code snippet that i am using to get the output as set of<br>
&gt; triangles.<br>&gt;<br>&gt; vtkDelaunay2D* pDelny = vtkDelaunay2D::New( );<br>&gt; vtkPolyData* pPointSet = vtkPolyData::New( );<br>&gt; vtkPoints* pPoints = vtkPoints::New( );<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //collects the points 
i.e. x , y, and z<br>&gt; GetPoints( pPoints );<br>&gt;<br>&gt; pPointSet-&gt;SetPoints( pPoints );<br>&gt;<br>&gt; //now generate the vtk file<br>&gt; vtkPolyDataWriter* writer = vtkPolyDataWriter::New();<br>&gt; writer-&gt;SetFileName( &quot;c:\\earth.vtk&quot;);
<br>&gt; writer-&gt;SetInput( pPointSet );<br>&gt; writer-&gt;Write(); //throws an exception<br>&gt; writer-&gt;Update();<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;/***the generated vtk file contains the only one fixed<br>&gt; value***/<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ///However i am not usig this file<br>&gt; *<br>&gt; pDelny-&gt;SetTolerance( 0.001 );<br>&gt; //pDelny-&gt;SetBoundingTriangulation(1);<br>&gt; pDelny-&gt;SetAlpha( 1 );<br>&gt; //pDelny-&gt;BoundingTriangulationOff();
<br>&gt; //pDelny-&gt;SetOffset( 1000 );<br>&gt;<br>&gt; pDelny-&gt;SetInput(pPointSet);<br>&gt; pDelny-&gt;SetSource( pPointSet );<br>&gt; pDelny-&gt;Update();<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;vtkPolyData* pVtkData = pDelny-&gt;GetOutput( );
<br>&gt;&nbsp;&nbsp;int nsize = pVtkData-&gt;GetNumberOfCells(); //returned the same number<br>&gt; as the number of points<br>&gt;&nbsp;&nbsp;vtkCellArray* cellPol = pVtkData-&gt;GetPolys(); //zero returned<br>&gt;&nbsp;&nbsp;int numpol = cellPol-&gt;GetNumberOfCells();
<br>&gt;&nbsp;&nbsp;vtkCellArray* cellVert = pVtkData-&gt;GetVerts();<br>&gt;&nbsp;&nbsp;int numver = cellVert-&gt;GetNumberOfCells(); //returned the same number<br>&gt; as the number of points<br>&gt;<br>&gt;&nbsp;&nbsp;nCells = pVtkData-&gt;GetNumberOfPolys();
<br>&gt;&nbsp;&nbsp;nCnt3 = pVtkData-&gt;GetNumberOfVerts(); //returned the same number as<br>&gt; the number of points<br>&gt;<br>&gt; But where are the triangles????<br>&gt;<br>&gt; Now through pDelny-&gt;GetOutput I am expecting set of triangles in
<br>&gt; vtkPolyData object.<br>&gt; Am I right?<br>&gt;<br>&gt; Thanks<br>&gt;<br>&gt;------------------------------------------------------------------------<br>&gt;<br>&gt;_______________________________________________
<br>&gt;This is the private VTK discussion list.<br>&gt;Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>&gt;Follow this link to subscribe/unsubscribe:
<br>&gt;<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>&gt;<br>&gt;<br></blockquote></div><br>