Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Infinite loop in PMP::corefine_and_compute_union since 4.14.2

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Infinite loop in PMP::corefine_and_compute_union since 4.14.2


Chronological Thread 
  • From: Giles Puckett <>
  • To:
  • Subject: Re: [cgal-discuss] Infinite loop in PMP::corefine_and_compute_union since 4.14.2
  • Date: Fri, 7 Feb 2020 16:51:50 +1000
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:HOVYdRAqSa3YvLUZ4mynUyQJP3N1i/DPJgcQr6AfoPdwSPT+osbcNUDSrc9gkEXOFd2Cra4d16yL7+u5ATRIoc7Y9ixbK9oUD15NoP5VtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blItdaz6FYHIksu4yf259YHNbAVUnjq9Zq55IAmroQnLucQanIRvJrwxxxbGrXdEZvhayX91Ll6Xgxrw+9288ZF+/yleof4t69JMXaDndKkkULJUCygrPXoo78PxrxnDSgWP5noYUmoIlxdDHhbI4hLnUJrvqyX2ruVy1jWUMs3wVrA0RC+t77x3Rx/yiScILCA2/WfKgcFtlq1boRahpxtiw47IZYyeKfRzcr/Bcd4cWGFMWNtaWS5cDYOmd4YBEvQPPehYoYf+qVUBoxSxCguwC+3g0TJImnz70Lcm3+g9HwzL3gotFM8OvnTOq9X1Mb8fX+G0zKnM0zrDdO5d1y3g6IfUcRAuv+2MXa5tesfWxkkvFgfFgUuLqYz9JD6V1+UNs26F4Op8T+6vjXAoqx1rrje128chk4/EjZ8bxFDD8CV22oc1JdugRU50YN6kDJtQtzyBOIdsXswiRGRotSAnwbMFoZ62ZDYGxIgpyhLFa/GKd5KE7g/5WOqMPTt1hWppdK+hixu960Ss1+LxW82u3FpXoSdJjsPAum0D2hHS7MWMV+Fz8V272TmV0gDe8uFELl4wlarcM5Mhw6I/loIKvUTEBS/5g1z6jK6MdkUj/Oip6/3rYrL7pp+ANoJ4kB/xM6symsOhG+Q4NBIBX2yB9eS91b3j+1P2QKlQgv0wjKbZrIrWKt4GpqKhAg9V1Jgs6wqnAju4zNgVk2MLIVJBdR6dkoTlIUzCLOz5APunhlSjijZrx/TIPr37BZXNK2DOkLjgfbZ59UFc0xIzwMte55JVDLEOPu7zVlX3tNPGEh81KRa7w/v/BNVnyoweQX6PArOeMK7KrVCI6fggI+2VaIAIuTb9MOQq5+P1jX8iglIdZqmo3Z4PaH+iBPhmIkOZYWDtgtgbC2sKsBA+H6TWjwiJXjdXInqzRKkh/SoTCYS8DI6FSJr+rqaG2XKUH5lbfSh+F1uPHGv0P9GLWvMBczq6I85nnyBCU7W9DYY8g0L9/DTmwqZqe7KHshYTsojugYAstr/j0Coq/DkxNPyzlmSETmV6hGQNHmNk3aF5rFA7zFqfl6Fl0aUBSI5joshRWwJ/Dqbyiux3D9euAFDAdc/MT02sB9S8BjcgC9Us34FIblZhFs+khxSF3iusDqNTkbGXQpUpoPqFgyrBYv1lwnOD75EPykE8S5ITZ2yngKNjsQ7eG8jAjhfBmg==

Hi,

Thanks for the suggestion. Can you post a fragment of such an OFF file so I can see what it looks like?

It will be hard to change the kernel in the original program, because there are a few steps between the mesh and the OFF file writing. But I should be able to dig through the exact_points property map per vertex and get out the exact coordinates.

What format are the coordinate values in the Exact_predicates_exact_constructions_kernel ? (I confess I'm not very good with C++ especially with all the heavy template usage)

G.

On 6/02/2020 6:20 pm, Sebastien Loriot (GeometryFactory) wrote:
If the error occurs after several operations, for debugging purpose you can use CGAL::Simple_cartesian<CGAL::Gmpq> as kernel and I think when
writing to OFF you will write the exact rational representation.
Then I think I should be able to load them and reproduce the error.

Note that it will be much slower.

Best,

Sebastien.

PS: don't post output meshes as an attachment to the mailing list as
the file will be large (use gist.github.com or whatever online storage service).


On 2/5/20 10:33 AM, Giles Puckett wrote:
Both meshes return true to does_bound_a_volume and false to does_self_intersect. They do not throw an exception for self-intersections. I can send the OFF files if you like, although they don't produce the error they show the shape of the meshes..

G.

On 5/02/2020 6:23 pm, Sebastien Loriot (GeometryFactory) wrote:
Does one of you mesh has a boundary?

The list of PRs that could have introduced a regression is here:
https://github.com/CGAL/cgal/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+label%3AMerged_in_4.12.2++label%3APkg%3A%3APMP+

I don't see anything suspicious. Is it deterministic?

Best,

Sebastien.



On 2/4/20 11:59 PM, Giles Puckett wrote:
Bonjour,

I have a CAD program that uses PMP to merge meshes. I moved from 4.12 to 5.0 in order to use the default visitor to keep attributes on faces through surface mesh unions. However, some previously working meshes now fail with an infinite loop. The problem also appears on 4.14.2.

The infinite loop is in Corefinement::remove_unused_polylines at face_graph_utils.h, line 1634: (in 5.0)

for(vertex_descriptor v: vertices_kept)
   {
     halfedge_descriptor h = halfedge(v, tm), start=GT::null_halfedge();

     do{
       while ( !is_border(h, tm) || is_border(opposite(h, tm), tm) ) // This while loop never exits
         h = opposite(next(h, tm), tm);
       halfedge_descriptor in = h;
       if (start==GT::null_halfedge())
         start=in;
       else
         if (start==in)
           break;
       while ( is_border(h, tm) )
         h = opposite(next(h, tm), tm);
       set_next(in, opposite(h, tm), tm);
     }
     while(true);//this loop handles non-manifold vertices
   }

One mesh is a simple convex shape, the other is the result of a previous union. All unions are done with exact predicates and constructions in the standard way for consecutive bool ops. Testing for self-intersections before and during the union reveals nothing.

Sadly, I cannot reproduce it in a simple test example program (when writing the meshes to OFF file, precision is lost, and I get self-intersections or an assertion about collinear points). I suspect there may be zero-area triangles produced by the first union.

Three questions:

Have there been any changes in corefinement, PMP or surface meshes between 4.12 and 4.14.2 that might produce this, or any known regressions?
And is there any way I can write the meshes out with sufficient accuracy to submit a simple test case?
Lastly, is there any way I can get the functionality of the example program (corefinement_mesh_union_with_attributes) to work in 4.12?

Thanks for any help and for reading on this far :-)

Giles.









Archive powered by MHonArc 2.6.18.

Top of Page