[vtkusers] vtkConnectivityFilter issue ...

Andre Phillion andre.phillion at epfl.ch
Tue Apr 8 06:08:35 EDT 2008


Hi Everyone,

 

I am using vtkConnectivityFilter on a mesh of tetrahedral elements:

 

vtkXMLUnstructuredGridReader *reader = vtkXMLUnstructuredGridReader::New();

vtkConnectivityFilter *filter = vtkConnectivityFilter::New();

 

reader->SetFileName("/home/andre/Modeling/vtk/conn_input.vtu");

filter->SetInputConnection(reader->GetOutputPort());

filter->ScalarConnectivityOn();

filter->SetScalarRange(0.98,1.0);

filter->Update();

 

int nregions = filter->GetNumberOfExtractedRegions();

std::cout<<"NREGIONS: "<<nregions<<std::endl;

 

What I want to do is to create a new .vtu file containing only those
elements within the ScalarRange.

However, the value of NREGIONS is always ‘1’ even when I provide an input
with all the scalars set to 0.

 

Does anyone have any ideas? Thanks

 

André

 

Dr. André Phillion

Laboratoire de Simulation des Matériaux
Ecole Polytechnique Fédérale de Lausanne

MXG-318, Station 12, CH-1015, Switzerland 

Tel / Fax: +41(21)693 3942 / 5890

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080408/5a7480aa/attachment.htm>


More information about the vtkusers mailing list