[vtkusers] problem using vtkGeometryFilter

nikhil butala nvbutala at yahoo.com
Thu Aug 26 16:00:34 EDT 2004


With reference to the messages below:
 
I tried using the vtkGeometryFilter to extract just the outer surface of an unstructured grid. But this doesn't seem to be working. Can anyone tell me what needs to be changed in the code below?
 
 
vtkDataSetReader *reader1 = vtkDataSetReader::New();
   reader1->SetFileName ("C:/..../trial.vtk");
   reader1->Update();
 
vtkConnectivityFilter *connect = vtkConnectivityFilter::New();
 connect->SetInput(reader1->GetOutput() );
 connect->SetExtractionModeToAllRegions();
 
vtkExtractUnstructuredGrid *extractGrid = vtkExtractUnstructuredGrid::New();
  extractGrid->SetInput(connect->GetOutput());
 
vtkGeometryFilter *gFilter = vtkGeometryFilter::New();
  gFilter->SetInput(extractGrid->GetOutput());
  
vtkPolyDataMapper *visMapper = vtkPolyDataMapper::New();
   visMapper->SetInput(gFilter->GetOutput() );
   visMapper->ScalarVisibilityOff();
 
vtkActor *actor = vtkActor::New();
actor->GetProperty()->SetColor(0,0.8,0);
 actor->GetProperty()->SetAmbient(0.8 );
 actor->GetProperty()->SetRepresentationToWireframe();
 actor->SetMapper( visMapper );
  
Thanks,
Matt and Nikhil
 
 
 
Hi Matt,
  I have used vtkGeometryFilter on an unstructured grid, this just extracts
the outer surface... not quite the same as only the visible parts but could
be useful, or a good start on what you want?
Dave P

vtkusers-bounces at vtk.org wrote on 18/08/2004 08:17:15:

> I am using a vtkPolyDataSetReader to read unstructured
> grid information. Then a vtkPolyDataSetMapper to
> create an actor to display a mesh of an object. I am
> looking for a way to display only the parts of the
> mesh that would be actually visable ( just the front
> face of the object). I have looked through the docs
> and searched the archive, but I was unable to find
> anything.
>
> If anyone knows of a method to accomplish this I would
> appreciate the help.
>
> -Matt



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040826/495cbac8/attachment.htm>


More information about the vtkusers mailing list