[vtkusers] Issue; Number of Regions are equal to the number of Polys
David E DeMarle
dave.demarle at kitware.com
Tue Jan 3 10:30:37 EST 2017
Apply vtkCleanPolyData first. The triangles in that data have points that
are coincindent, but none are actually shared across neighboring edges.
Clean will merge the coicident points for you.
David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909
On Tue, Jan 3, 2017 at 10:22 AM, Mohammadreza Babaee <mrezababaee at gmail.com>
wrote:
> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170103/9c9c59d6/attachment.html>
More information about the vtkusers
mailing list