Hello, I am trying to extract boundary cells of a polydata. I&#39;ve used <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/BoundaryEdges">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Meshes/BoundaryEdges</a> to extract boundary edges.<div>

<br></div><div>Then I looked to this example : <a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Tcl/capSphere.tcl?root=VTK&amp;content-type=text/plain">http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Tcl/capSphere.tcl?root=VTK&amp;content-type=text/plain</a></div>

<div>to extract the cells.</div><div><br></div><div>But when I print the result polydata data , gives me an error.</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkFeatureEdges&gt; boundaryEdges = vtkSmartPointer&lt;vtkFeatureEdges&gt;::New();<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges-&gt;SetInput(myPolyData);<br>

<span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges-&gt;BoundaryEdgesOn();<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges-&gt;FeatureEdgesOff();<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges-&gt;ManifoldEdgesOff();<br>

<span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges-&gt;NonManifoldEdgesOff();<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryEdges-&gt;Update();<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

 </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkCleanPolyData&gt; boundaryClean = vtkSmartPointer&lt;vtkCleanPolyData&gt;::New();<br>

<span class="Apple-tab-span" style="white-space:pre">        </span>boundaryClean-&gt;SetInput(boundaryEdges-&gt;GetOutput());<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkStripper&gt; boundaryStrips = vtkSmartPointer&lt;vtkStripper&gt;::New();<br>

<span class="Apple-tab-span" style="white-space:pre">        </span>boundaryStrips-&gt;SetInput(boundaryClean-&gt;GetOutput());<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryStrips-&gt;Update();<br></blockquote>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkPolyData&gt; boundaryPoly = vtkSmartPointer&lt;vtkPolyData&gt;::New();<br><span class="Apple-tab-span" style="white-space:pre">        </span>boundaryPoly-&gt;SetPoints((boundaryStrips-&gt;GetOutput())-&gt;GetPoints());<br>

<span class="Apple-tab-span" style="white-space:pre">        </span>boundaryPoly-&gt;SetPolys((boundaryStrips-&gt;GetOutput())-&gt;GetLines());<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

 </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkTriangleFilter&gt; boundaryTriangles = vtkSmartPointer&lt;vtkTriangleFilter&gt;::New();<br>

<span class="Apple-tab-span" style="white-space:pre">        </span>boundaryTriangles-&gt;SetInput(boundaryPoly);<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

 </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="Apple-tab-span" style="white-space:pre">        </span>vtkSmartPointer&lt;vtkPolyData&gt; boundaryTrianglesPD = boundaryTriangles-&gt;GetOutput();</blockquote>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<span class="Apple-tab-span" style="white-space:pre">        </span>std::cout &lt;&lt; &quot;cell &quot; &lt;&lt; boundaryTrianglesPD-&gt;GetNumberOfCells() &lt;&lt; std::endl;                           <font color="#ff0000">// gives me 0</font><br>

<span class="Apple-tab-span" style="white-space:pre">        </span>std::cout &lt;&lt; &quot;lines &quot; &lt;&lt; boundaryTrianglesPD-&gt;GetLines()-&gt;GetNumberOfCells() &lt;&lt; std::endl;        <font color="#ff0000">//gives me 0</font><br>

<span class="Apple-tab-span" style="white-space:pre">        </span>std::cout &lt;&lt; &quot;points &quot; &lt;&lt; boundaryTrianglesPD-&gt;GetPoints()-&gt;GetNumberOfPoints() &lt;&lt; std::endl;  <font color="#ff0000">// crash here </font></blockquote>

<div><br></div><div>Can someone help me?</div><div><br></div><div>Thank you! </div><div><br></div>-- <br>--------<br>Gonzalo Amadio<br><br>
</div>