[vtkusers] re: Implicit Dataset and vtkDataSetSurfaceFilter

Trevor Irons trevorirons at gmail.com
Sun Oct 14 18:18:57 EDT 2007


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.

Thanks.

-Trevor

    // Declarations
    vtkPolyData                         *poly = vtkPolyData::New();
    vtkPoints                       *topoPnts = vtkPoints::New();
    vtkDelaunay3D                   *delny = vtkDelaunay3D::New();
    vtkImplicitDataSet          *implData = vtkImplicitDataSet::New();
    vtkExtractGeometry           *extract = vtkExtractGeometry::New();
    vtkRectilinearGrid                 *rgrid = vtkRectilinearGrid::New();
    vtkDataSetSurfaceFilter    *surface = vtkDataSetSurfaceFilter::New();

   /*
    * Build Grid, open file containing x,y,z coordinates for topoPnts
    */

    // Triangulate topographic surface using Delaunay3D
    poly->SetPoints(topoPnts);
    delny->SetInput(poly);
    surface->SetInputConnection(delny->GetOutputPort());
    implData->SetDataSet(surface->GetOutput());
    extract->SetInput(rgrid);
    extract->SetExtractInside(true);
    extract->SetImplicitFunction(implData);

   /*
    * Process, render, etc.
    */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071014/9735fd08/attachment.htm>


More information about the vtkusers mailing list