<div dir="ltr">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.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div>
<br><div class="gmail_quote">On Tue, Jan 3, 2017 at 10:22 AM, Mohammadreza Babaee <span dir="ltr"><<a href="mailto:mrezababaee@gmail.com" target="_blank">mrezababaee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">Hi <br><br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">I have a vtp file that contains a polydata. I want to extract its connected component. However, when I use<i> vtkPolyDataConnectivityFilter</i><b>, </b>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.<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">I use<code><span class="m_5749514421171276759gmail-str"> SetExtractionModeToAllRegions to read the number of regions.</span></code><br>I have attached the file. Can you please help me to understand what the problem is<code><span class="m_5749514421171276759gmail-str"><br></span></code></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)"><code><span class="m_5749514421171276759gmail-str"><br>So here is my code<br><br>vtkSmartPointer<<wbr>vtkPolyDataConnectivityFilter> connectivityFilter = vtkSmartPointer<<wbr>vtkPolyDataConnectivityFilter><wbr>::New();<br>    connectivityFilter-><wbr>SetInputData(poly_in);<br>    connectivityFilter-><wbr>ScalarConnectivityOn();<br><br>    connectivityFilter-><wbr>SetExtractionModeToAllRegions(<wbr>);<br><br>    connectivityFilter->Update();<br>    int nbregions = connectivityFilter-><wbr>GetNumberOfExtractedRegions();<br><br>    cout << "Number of Extracted Regions are=" << nbregions << endl;<br></span></code></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)"></div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(7,55,99)">Thanks<b><br></b></div></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>