[vtkusers] vtkCutter with vtkStructuredGrid result 0 points

Tina Dong ttdong at stanford.edu
Mon Nov 20 13:40:19 EST 2006


Hi,

I'm relatively new to vtk, and I'm trying to cut an structured grid  
with vtkCutter to get a plane. With the following code, I get 0  
points in the planeCut output. Any idea what I'm doing wrong?

Thanks,
Tina


vtkStructuredGrid *sgrid = vtkStructuredGrid::New();
vtkIntArray *vectors = vtkIntArray::New();
vectors->SetNumberOfComponents(3);
points->Allocate(64*64);

// inserting points and tuples

vtkPlane *plane = vtkPlane::New();
plane->SetOrigin(sgrid->GetCenter());
plane->SetNormal(1,0,0);
cout << "sgrid number " << sgrid->GetNumberOfPoints() << endl;

vtkCutter  *planeCut = vtkCutter::New();
planeCut->SetInput(sgrid);
planeCut->SetCutFunction(plane);
planeCut->Update();

cout << "number" << planeCut->GetOutput()->GetNumberOfPoints() << endl;




More information about the vtkusers mailing list