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->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"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></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 <<a href="mailto:dan.asimov@gmail.com">dan.asimov@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I'm new to vtk. So, forgive me for my simple question!<br>
><br>
> I'm trying to use vtkCutter on a vtkPolydata to get all the points inside a<br>
> specific plane. However, it seems vtkCutter doesn't return any cell that<br>
> lies completely inside the cutting plane!<br>
><br>
> Here is a very simple example in C++:<br>
><br>
> //Adding some points (3 of them in the x-y plane)<br>
> vtkPoints *pPoints = vtkPoints::New();<br>
> pPoints->InsertNextPoint(1,0,-0.5);<br>
> pPoints->InsertNextPoint(0,1,0);<br>
> pPoints->InsertNextPoint(-1,0,0);<br>
> pPoints->InsertNextPoint(0,-1,0);<br>
><br>
> vtkPolyData *pPolydata = vtkPolyData::New();<br>
> pPolydata->SetPoints(pPoints);<br>
><br>
> vtkPolygon *pPolygon = vtkPolygon::New();<br>
> pPolygon->GetPointIds()->SetNumberOfIds(4);<br>
> for (int i=0;i<4;i++)<br>
> {<br>
> pPolygon->GetPointIds()->SetId(i,i);<br>
> }<br>
> pPolydata->Allocate(1,1);<br>
> pPolydata->InsertNextCell(pPolygon->GetCellType(),pPolygon->GetPointIds());<br>
><br>
> // The cutting plane is the x-y plane<br>
> vtkPlane *pPlane = vtkPlane::New();<br>
> pPlane->SetOrigin(0,0,0);<br>
> pPlane->SetNormal(0,0,1);<br>
><br>
> // Cut<br>
> vtkCutter *pCutter = vtkCutter::New();<br>
> pCutter->SetCutFunction(pPlane);<br>
> pCutter->SetInput(pPolydata);<br>
> pCutter->Update();<br>
> vtkPolyData *pCutterOutput = pCutter->GetOutput();<br>
><br>
> vtkPoints *Pts = pCutterOutput->GetPoints();<br>
> int nPts = Pts->GetNumberOfPoints();<br>
><br>
> now, the pCutterOutput contains only two points (0,1,0) & (0,-1,0). I was<br>
> expecting it will contain also (-1,0,0) since it's in the same plane (x-y<br>
> plane). Am I missing something??<br>
><br>
> Thanks for your help!<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br>