<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Please Keep the discussion on list so others may learn.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>In the example code that I sent you there should be some code that shows how to create a vtkPolyData from scratch and populate it with data. If you do not do this just right you can end up with empty arrays.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>From your code below the "delaunayOutput" variable is not hooked up to anything. I am going to assume that there is some method in your code in which you populate that object with data. If this is NOT the case then you need to do that, then feed the "delaunayOutput" into the vtkPolyDataWriter object and you should get some data written to a file.</DIV><DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Bitstream Vera Sans; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-- </DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Mike Jackson   Senior Research Engineer</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Innovative Management &amp; Technology Services</DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR><DIV><DIV>On May 16, 2007, at 10:28 AM, Samuel Marcos wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Well, I actually apply the Delaunay filter to my Polydata then use a PolyDataWriter not hooked to Delaunay Output (only to see what was happening) and then make the "triangles to array extraction" stuff. In pseudocode: <BR><DIV>vtkPolyData* data;</DIV><DIV>vtkDelauneyFilter* filter = vtkDelauney::New();</DIV><DIV>filter-&gt;SetInput(data);</DIV>filter-&gt;Update(); <BR>vtkPolyData* delaunayOutput;          // I save the Output of Delaunay in a PolyData <BR><DIV>vtkPolyDataWriter* writer = vtkPolyDataWriter::New();</DIV><DIV>writer-&gt;SetInput(delaunayOutput);     //use the PolyData as input<BR></DIV><DIV>writer-&gt;SetFileName( outputFile );</DIV><DIV>writer-&gt;Update(); <BR></DIV>//....<BR>Triangle extraction from delaunayOutput PolyData part of code here which only works if I do not use the PolyDataWriter. If I use it I get an empty array from delaunayOutput...//<BR><BR>It would be nice to know what I'm missing because I'm obtaining same empty results in other filters I'm using as the threshold filter. Many thanks. <BR><DIV><SPAN class="gmail_quote">On 5/16/07, <B class="gmail_sendername">Mike Jackson</B> &lt;<A href="mailto:imikejackson@gmail.com">imikejackson@gmail.com</A>&gt; wrote:</SPAN><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <DIV style="">usually you hook up the output from a filter to the input of the next filter and it should just work. So in your case, you have an input vtkPolyData object and are feeding that into the DelauneyFilter and then want to write the results out to a file. <DIV><BR></DIV><DIV>The following is some pseudo code but represents what should be done.</DIV><DIV><BR></DIV><DIV>vtkPolyData* data;</DIV><DIV>vtkDelauneyFilter* filter = vtkDelauney::New();</DIV><DIV>filter-&gt;SetInput(data); </DIV><DIV>filter-&gt;Update(); //Forces updating of the pipeline.. Not really needed in some situations</DIV><DIV>vtkPolyDataWriter* writer = vtkPolyDataWriter::New();</DIV><DIV>writer-&gt;SetInputConnection( filter-&gt;GetOutputPort() ); </DIV><DIV>writer-&gt;SetFileName( outputFile );</DIV><DIV>writer-&gt;Update();</DIV><DIV><BR></DIV><DIV>writer-&gt;Delete()</DIV><DIV>filter-&gt;Delete()</DIV><DIV><BR></DIV><DIV>Hope that helps.<BR><DIV> <SPAN style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Bitstream Vera Sans; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"> <DIV style="margin: 0px;">-- </DIV><DIV style="margin: 0px;">Mike Jackson   Senior Research Engineer</DIV><DIV style="margin: 0px;">Innovative Management &amp; Technology Services</DIV><BR></SPAN> </DIV><BR><DIV><DIV><SPAN class="e" id="q_11294c2063aa9923_1"> <DIV>On May 16, 2007, at 6:42 AM, Samuel Marcos wrote:</DIV><BR></SPAN></DIV><BLOCKQUOTE type="cite"><DIV><SPAN class="e" id="q_11294c2063aa9923_3">Ok, I've managed it (I write down the part of code in case someone reads this post and needs it). The weird thing is that I previously tried to write the PolyData to a text file. If I use the vtkPolyDataWriter before extracting the triangles, I get an empty array as if the vtkPolyDataWriter erased the PolyData. Is that normal? I think this is a begginer question but how do I know if a filter erases or changes the input contents? I've read each filter makes a copy of the input so I thought the input would stay as it is even if passed through a filter. Am I wrong? Many thanks to all your responses, Luca, burlen and Mike (also for the code). <BR>  <BR>  int j=0;<BR>    int h;<BR>    int npts=3,*pts;<BR>    vtkCellArray* oCellArr= vtkCellArray::New();<BR>    oCellArr=oPolyDataDel-&gt;GetPolys();<BR>     for(int i=0;i&lt;oPolyDataDel-&gt;GetNumberOfPolys();i++) <BR>     {<BR>            h=oCellArr-&gt;GetNextCell(npts,pts);<BR>            <BR>            if(h==0){<BR>                break;<BR>            }<BR>            if(npts==3){<BR>            vTriangulos[j]= pts[0];<BR>            vTriangulos[j+1]= pts[1]; <BR>            vTriangulos[j+2]= pts[2];<BR>            j+=3;<BR>            }<BR><BR>     }<BR></SPAN></DIV><SPAN class="q"><DIV style="margin: 0px;">_______________________________________________</DIV><DIV style="margin: 0px;"> This is the private VTK discussion list.<SPAN> </SPAN></DIV><DIV style="margin: 0px;">Please keep messages on-topic. Check the FAQ at: <A href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://www.vtk.org/Wiki/VTK_FAQ</A></DIV><DIV style="margin: 0px;">Follow this link to subscribe/unsubscribe:</DIV><DIV style="margin: 0px;"><A href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://www.vtk.org/mailman/listinfo/vtkusers</A></DIV> </SPAN></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>