I am trying to extract cells from a rectilinear grid (using vtkExtractGeometry) I want to extract a volume defined by Delaunay3D. I Have been trying to use vtkDataSetSurfaceFilter to define the outer edge of the volume, which works fine. Can I use this surface as an implicit function so that everything inside the surface is returned by ExtractGeometry? The code below compiles but returns the error "vtkImplicitDataSet (hex): Can't evaluate dataset!" This approach works fine with other implicit functions, sphere etc. so I am pretty sure my problem lies in my misuse of implicit dataset. Any help is greatly appreciated. A different approach is fine as well.
<br><br>Thanks.<br><br>-Trevor<br><br> // Declarations<br> vtkPolyData *poly = vtkPolyData::New();<br> vtkPoints *topoPnts = vtkPoints::New();<br> vtkDelaunay3D *delny = vtkDelaunay3D::New();
<br> vtkImplicitDataSet *implData = vtkImplicitDataSet::New();<br> vtkExtractGeometry *extract = vtkExtractGeometry::New(); <br> vtkRectilinearGrid *rgrid = vtkRectilinearGrid::New();
<br> vtkDataSetSurfaceFilter *surface = vtkDataSetSurfaceFilter::New(); <br><br> /*<br> * Build Grid, open file containing x,y,z coordinates for topoPnts<br> */<br> <br> // Triangulate topographic surface using Delaunay3D
<br> poly->SetPoints(topoPnts);<br> delny->SetInput(poly);<br> surface->SetInputConnection(delny->GetOutputPort());<br> implData->SetDataSet(surface->GetOutput()); <br> extract->SetInput(rgrid);
<br>
extract->SetExtractInside(true); <br> extract->SetImplicitFunction(implData);<br><br> /*<br> * Process, render, etc.<br> */<br><br><br><br>