<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">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 class="khtml-block-placeholder"></DIV><DIV>The following is some pseudo code but represents what should be done.</DIV><DIV><BR class="khtml-block-placeholder"></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 class="khtml-block-placeholder"></DIV><DIV>writer-&gt;Delete()</DIV><DIV>filter-&gt;Delete()</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Hope that helps.<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 6:42 AM, Samuel Marcos wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">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><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; ">This is the private VTK discussion list.<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">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></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Follow this link to subscribe/unsubscribe:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>