<br><br>
<div class="gmail_quote">On Thu, Feb 4, 2010 at 11:46 AM, Eddy Cappeau <span dir="ltr">&lt;<a href="mailto:ecappeau@phenix-systems.com">ecappeau@phenix-systems.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi,<br><br>I&#39;m new to VTK and I&#39;v got a little problem with it.<br>I want to cut a mesh with a plane and get the polyline of the intersection.<br>
The mesh come from a stl file loaded like this :<br><br>   vtkSmartPointer&lt;vtkSTLReader&gt; reader = vtkSmartPointer&lt;vtkSTLReader&gt;::New();<br>   reader-&gt;SetFileName(&quot;myfile.stl&quot;);<br><br>   vtkSmartPointer&lt;vtkPolyDataMapper&gt; stlMapper = vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>
   stlMapper-&gt;SetInputConnection(reader-&gt;GetOutputPort());<br><br>I create a cutter like this :<br><br>   vtkCutter * sliceCutter = vtkCutter::New();<br>   sliceCutter-&gt;SetInput( reader-&gt;GetOutput() );<br>   vtkPlane *slicePlane = vtkPlane::New();<br>
   slicePlane-&gt;SetOrigin(0.0,0.0,7.0);<br>   slicePlane-&gt;SetNormal(0.0,0.0,1.0);<br><br>   sliceCutter-&gt;SetCutFunction( slicePlane );<br><br>I&#39;v created a mapper and an actor for the mesh and the section, and i can visualize them both.<br>
<br>So I try to retrieve the points like this :<br><br>   vtkPolyData * testdata = sliceCutter-&gt;GetOutput();<br>   vtkPoints * points = sliceCutter-&gt;GetOutput()-&gt;GetPoints();<br>   int n = points-&gt;GetNumberOfPoints();<br>
<br>But the vtkPoints is always NULL and  I don&#39;t understand why.<br>How can I get those points ?<br><br>thanks.<br>_____</blockquote>
<div> </div>
<div>Sounds like you need to call Update on the cutter</div>
<div>sliceCutter-&gt;Update();</div>
<div> </div>
<div>Let me know if that works.</div>
<div><br clear="all">Thanks,<br><br>David</div></div>