<div dir="ltr"><br>vtkFeatureEdges sounds better to&nbsp; extract the boundary of a 2D mesh than vtkUnstructuredGridGeometryFilter or vtkGeometryFilter that works explicitly for 3D meshes. What Charles could do to prove closeness is to extract all 1D edges that are used by only one surface(2D) cell (i.e., boundary edges). If that set is empty, then the 2D mesh is close.<br>
<br>Regarding the formula T=2V-4 proposed by Michael, it can not prove the closeness, because it&#39;s only a necessary condition but not&nbsp; a suffisant one (if the formula is false, then the surface is not close; if it&#39;s true, we cannot conclude). It comes from the Euler-Poincaré statement T-E+V=2 for a topologicaly close surface tessalation, and from 3T=2E in case cells are all triangle. <br>
<br>Marie-Gabrielle<br><br>&gt; Date: Fri, 3 Oct 2008 16:04:31 -0300<br>&gt; From: pam &lt;<a href="mailto:papereyra@gmail.com">papereyra@gmail.com</a>&gt;<br>&gt; Subject: Re: [vtkusers] Proving a surface mesh of closeness<br>
&gt; To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>&gt; Message-ID:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<a href="mailto:2bcd18a00810031204g77101056w9d46bf649c21baec@mail.gmail.com">2bcd18a00810031204g77101056w9d46bf649c21baec@mail.gmail.com</a>&gt;<br>
&gt; Content-Type: text/plain; charset=UTF-8<br>&gt;<br>&gt; Hi, I &#39;m Pamela and I was trying to get the boundary cells, i found a<br>&gt; solution to my problem that maybe could help you.<br>&gt;<br>&gt; I finally used vtkUnstructuredGridGeometryFilter because<br>
&gt; vtkFeaturedFilter only works with structured data like vtkPolyData.<br>&gt; Here is the code and how to go through the cells.<br>&gt;<br>&gt; vtkUnstructuredGridGeometryFilter*<br>&gt; filter=vtkUnstructuredGridGeometryFilter::New();<br>
&gt;&nbsp;&nbsp; filter-&gt;SetInputConnection(delny-&gt;GetOutputPort());<br>&gt;&nbsp;&nbsp; filter-&gt;Update();<br>&gt;&nbsp; cout&lt;&lt;&quot;filtro&quot;&lt;&lt;endl;<br>&gt;&nbsp;&nbsp; nroceldas=filter-&gt;GetOutput()-&gt;GetNumberOfCells();<br>&gt;&nbsp; for(t=0;t&lt;nroceldas;t++)<br>
&gt;&nbsp; {&nbsp;&nbsp; celda=filter-&gt;GetOutput()-&gt;GetCell(t);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; list=celda-&gt;GetPointIds();<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; points=celda-&gt;GetPoints();<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ids=list-&gt;GetNumberOfIds();<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;&quot;celda &quot;&lt;&lt;t&lt;&lt;endl;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;&quot;numero de faces &quot;&lt;&lt;celda-&gt;GetNumberOfFaces()&lt;&lt;endl;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;&quot;numero de edges &quot;&lt;&lt;celda-&gt;GetNumberOfEdges()&lt;&lt;endl;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(k=0;k&lt;ids;k++)<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; points-&gt;GetPoint(k,punto);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int verticeid= delny-&gt;GetOurput()-&gt;FindPoint(punto); //I do this<br>&gt; because this filter change the original id<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt;&quot;vertice id numero &quot; &lt;&lt; verticeid &lt;&lt;endl ;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout&lt;&lt;&quot; x &quot;&lt;&lt;punto[0]&lt;&lt;&quot; y &quot;&lt;&lt;punto[1]&lt;&lt;&quot; z &quot;&lt;&lt;punto[2]&lt;&lt;endl;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;&nbsp;&nbsp; }<br>&gt;<br>&gt;<br>&gt; Hope it helps!<br>&gt;<br>&gt; Pamela<br>&gt;<br>&gt; 2008/10/3 Michael Jackson &lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt;:<br>
&gt; &gt; T=2V-4<br>&gt; &gt;<br>&gt; &gt; Where T is the number of triagles and V is the number of vertices. Something<br>&gt; &gt; about Euler&#39;s Polyhedra equation...<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Mike<br>&gt; &gt;<br>
&gt; &gt; On Oct 3, 2008, at 1:14 PM, Marie-Gabrielle Vallet wrote:<br>&gt; &gt;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; I think there is a easier way of checking the surface closeness. I mean<br>&gt; &gt;&gt; using vtk facilities, instead of writing a (yet another) new algorithm.<br>
&gt; &gt;&gt;<br>&gt; &gt;&gt; VTK library has algorithms to extract a mesh boundary, i.e. the set of<br>&gt; &gt;&gt; faces (in 3D) or edges (in 2D) that are not shared by two cells. See<br>&gt; &gt;&gt; vtkFeatureEdges. The mesh is close if and only if this set is empty. If it<br>
&gt; &gt;&gt; not, you can visualize the holes that must still be closed.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Pamela is trying to do the same thing today. Have a look at the thread<br>&gt; &gt;&gt; &quot;get boundary triangles from a mesh&quot; on this mailing list.<br>
&gt; &gt;&gt;<br>&gt; &gt;&gt; By the way, Charles, are you sure you are not re-inventing the wheel ?<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Marie-Gabrielle<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&nbsp; Date: Fri, 3 Oct 2008 08:17:31 +0200<br>
&gt; &gt;&gt; &gt;&nbsp; From: Dominik Szczerba &lt;<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>&gt;<br>&gt; &gt;&gt; &gt;&nbsp; Subject: Re: [vtkusers] Proving a surface mesh of closeness<br>&gt; &gt;&gt; &gt;&nbsp; To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
&gt; &gt;&gt; &gt;&nbsp; Message-ID: &lt;<a href="mailto:200810030817.31796.dominik@itis.ethz.ch">200810030817.31796.dominik@itis.ethz.ch</a>&gt;<br>&gt; &gt;&gt; &gt;&nbsp; Content-Type: text/plain;&nbsp; charset=&quot;utf-8&quot;<br>&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt;&nbsp; If it is manifold then pick the 1st element and make sure each one it<br>&gt; &gt;&gt; &gt; has the<br>&gt; &gt;&gt; &gt;&nbsp; proper number of neighbors (for triangles: 3). Mark the element as<br>&gt; &gt;&gt; &gt; &#39;visited&#39;<br>
&gt; &gt;&gt; &gt;&nbsp; and visit all his neighbors, repeating the procedure. At the end, if<br>&gt; &gt;&gt; &gt; number<br>&gt; &gt;&gt; &gt;&nbsp; of visited elements equals to number of elements in the mesh and all<br>&gt; &gt;&gt; &gt; have<br>
&gt; &gt;&gt; &gt;&nbsp; their expected neighbors the mesh is closed.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp; DS<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp; On Friday 03 October 2008 02:48:59 am Charles Monty Burns wrote:<br>
&gt; &gt;&gt; &gt;&nbsp; &gt; Hello,<br>&gt; &gt;&gt; &gt;&nbsp; &gt;<br>&gt; &gt;&gt; &gt;&nbsp; &gt; I repaired a surface mesh and want to prove whether the mesh is<br>&gt; &gt;&gt; &gt; totally<br>&gt; &gt;&gt; &gt;&nbsp; &gt; closed or not. Save is save ...<br>
&gt; &gt;&gt; &gt;&nbsp; &gt;<br>&gt; &gt;&gt; &gt;&nbsp; &gt; How can I do this?<br>&gt; &gt;&gt; &gt;&nbsp; &gt;<br>&gt; &gt;&gt; &gt;&nbsp; &gt; Greetings<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&nbsp; --<br>
&gt; &gt;&gt; &gt;&nbsp; Dominik Szczerba, Ph.D.<br>&gt; &gt;&gt; &gt;&nbsp; Computational Physics Group<br>&gt; &gt;&gt; &gt;&nbsp; Foundation for Research on Information Technologies in Society<br>&gt; &gt;&gt; &gt;&nbsp; <a href="http://www.itis.ethz.ch">http://www.itis.ethz.ch</a><br>
</div>