Hi Bill,<br><br>Thanks for the reply!<br><br>I already tried this but vtkClipPolydata will return all the points on one side of the cutting plane. I need the points inside the cutting plane only.<br><br>For ex: if I move the origin of the cutting plane to <br>
<br>pPlane-&gt;SetOrigin(0,0,-0.1);<br><br>then vtkClipPolydata will return five points (the two cutting points and the three points in the x-y plane). However, vtkCutter will return only the two cutting points.<br><br>what do you think?<br>
<br>Thanks!<br><br><br><div class="gmail_quote">On Thu, Sep 16, 2010 at 2:33 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
You want vtkClipPolydata rather than vtkCutter.<br>
<div><div></div><div class="h5"><br>
On Thu, Sep 16, 2010 at 11:29 AM, Dan Asimov &lt;<a href="mailto:dan.asimov@gmail.com">dan.asimov@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m new to vtk. So, forgive me for my simple question!<br>
&gt;<br>
&gt; I&#39;m trying to use vtkCutter on a vtkPolydata to get all the points inside a<br>
&gt; specific plane. However, it seems vtkCutter doesn&#39;t return any cell that<br>
&gt; lies completely inside the cutting plane!<br>
&gt;<br>
&gt; Here is a very simple example in C++:<br>
&gt;<br>
&gt; //Adding some points (3 of them in the x-y plane)<br>
&gt; vtkPoints *pPoints = vtkPoints::New();<br>
&gt; pPoints-&gt;InsertNextPoint(1,0,-0.5);<br>
&gt; pPoints-&gt;InsertNextPoint(0,1,0);<br>
&gt; pPoints-&gt;InsertNextPoint(-1,0,0);<br>
&gt; pPoints-&gt;InsertNextPoint(0,-1,0);<br>
&gt;<br>
&gt; vtkPolyData *pPolydata = vtkPolyData::New();<br>
&gt; pPolydata-&gt;SetPoints(pPoints);<br>
&gt;<br>
&gt; vtkPolygon *pPolygon = vtkPolygon::New();<br>
&gt; pPolygon-&gt;GetPointIds()-&gt;SetNumberOfIds(4);<br>
&gt; for (int i=0;i&lt;4;i++)<br>
&gt; {<br>
&gt;     pPolygon-&gt;GetPointIds()-&gt;SetId(i,i);<br>
&gt; }<br>
&gt; pPolydata-&gt;Allocate(1,1);<br>
&gt; pPolydata-&gt;InsertNextCell(pPolygon-&gt;GetCellType(),pPolygon-&gt;GetPointIds());<br>
&gt;<br>
&gt; // The cutting plane is the x-y plane<br>
&gt; vtkPlane *pPlane = vtkPlane::New();<br>
&gt; pPlane-&gt;SetOrigin(0,0,0);<br>
&gt; pPlane-&gt;SetNormal(0,0,1);<br>
&gt;<br>
&gt; // Cut<br>
&gt; vtkCutter *pCutter = vtkCutter::New();<br>
&gt; pCutter-&gt;SetCutFunction(pPlane);<br>
&gt; pCutter-&gt;SetInput(pPolydata);<br>
&gt; pCutter-&gt;Update();<br>
&gt; vtkPolyData *pCutterOutput = pCutter-&gt;GetOutput();<br>
&gt;<br>
&gt; vtkPoints *Pts = pCutterOutput-&gt;GetPoints();<br>
&gt; int nPts = Pts-&gt;GetNumberOfPoints();<br>
&gt;<br>
&gt; now, the pCutterOutput contains only two points (0,1,0) &amp; (0,-1,0). I was<br>
&gt; expecting it will contain also (-1,0,0) since it&#39;s in the same plane (x-y<br>
&gt; plane). Am I missing something??<br>
&gt;<br>
&gt; Thanks for your help!<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br>