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 specific plane. However, it seems vtkCutter doesn't return any cell that 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 expecting it will contain also (-1,0,0) since it's in the same plane (x-y plane). Am I missing something??<br>
<br>Thanks for your help!<br><br>