[vtkusers] extract cylindrical part of a grid

Steffen Oeltze Steffen.Oeltze at Student.Uni-Magdeburg.DE
Fri May 30 11:09:10 EDT 2003


Dear VTK-users, 

I try to extract a cylindrical region from a vtkRectilinear Grid (I'm only 
interested in knowing the cell midpoints which are inside the cylinder) using 
the vtkExtractGeometry and vtkCylinder classes. However, the output of 
vtkExtractGeometry is always empty. Below I have attached my source code. I 
would really appreciate if anybody could have a look at it. 
------------------------------------------------------------------------ 
vtkRectilinearGrid *grid = vtkRectilinearGrid::New(); 
...specifying the coordinates of the grid but no scalar values yet... 

// the implicit cylindrical function 
vtkCylinder *cyl = vtkCylinder::New(); 
   cyl->SetCenter(mid_point[0],mid_point[1],mid_point[2]); 
   cyl->SetRadius(3.0f); 

vtkExtractGeometry *clipped = vtkExtractGeometry::New(); 
   clipped->SetInput(grid); 
   clipped->SetImplicitFunction(cyl); 
   clipped->ExtractInsideOn(); 
   clipped->ExtractBoundaryCellsOn();   
   clipped->GetOutput()->Print(cout); //output is empty 




More information about the vtkusers mailing list