[vtkusers] Issue; Number of Regions are equal to the number of Polys
Mohammadreza Babaee
mrezababaee at gmail.com
Tue Jan 3 10:22:00 EST 2017
Hi
I have a vtp file that contains a polydata. I want to extract its connected
component. However, when I use* vtkPolyDataConnectivityFilter**, *and read
the number of regions, it shows that the it is equal to the number of
polys. But when I visualize the file I see that there are actually 4
regions.
I use SetExtractionModeToAllRegions to read the number of regions.
I have attached the file. Can you please help me to understand what the
problem is
So here is my code
vtkSmartPointer<vtkPolyDataConnectivityFilter> connectivityFilter =
vtkSmartPointer<vtkPolyDataConnectivityFilter>::New();
connectivityFilter->SetInputData(poly_in);
connectivityFilter->ScalarConnectivityOn();
connectivityFilter->SetExtractionModeToAllRegions();
connectivityFilter->Update();
int nbregions = connectivityFilter->GetNumberOfExtractedRegions();
cout << "Number of Extracted Regions are=" << nbregions << endl;
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170103/652859de/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FinalModel.vtp
Type: application/octet-stream
Size: 608924 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170103/652859de/attachment-0001.obj>
More information about the vtkusers
mailing list