Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Assertion violation in refine_CGAL::Delaunay_mesh_2 using CGAL::Exact_predicates_inexact_constructions_kernel

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Assertion violation in refine_CGAL::Delaunay_mesh_2 using CGAL::Exact_predicates_inexact_constructions_kernel


Chronological Thread 
  • From: Renato Silveira <>
  • To:
  • Subject: Re: [cgal-discuss] Assertion violation in refine_CGAL::Delaunay_mesh_2 using CGAL::Exact_predicates_inexact_constructions_kernel
  • Date: Sun, 24 May 2015 19:41:36 -0300

I'm using the following kernel:

typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt KE;
typedef CGAL::Triangulation_vertex_base_2<KE> VbE;
typedef CGAL::Delaunay_mesh_face_base_2<KE> FbE;
typedef CGAL::Triangulation_data_structure_2<VbE,FbE> TDSE;
typedef CGAL::Exact_intersections_tag ItagE;
typedef CGAL::Constrained_Delaunay_triangulation_2<KE,TDSE, ItagE>      CDTE;
typedef CGAL::Constrained_triangulation_plus_2<CDTE> CDTPE;
typedef CDTPE::Point PointE;
typedef CDTPE::Constraint_id CidE;
typedef CDTPE::Vertex_handle Vertex_handleE;
typedef CDTPE::Finite_faces_iterator Finite_faces_iteratorE;
typedef CGAL::Delaunay_mesh_size_criteria_2<CDTPE> CriteriaE;
typedef CGAL::Delaunay_mesher_2<CDTPE, CriteriaE> MesherE;

The mesher needs kernel with _sqrt. The Constrained_Delaunay_Triangulation_Plus are computed very fast, but the refinement spend about 15 min and the program crashes with the message:
"GNU MP: Cannot reallocate memory (old_size=4 new_size=33554808)"

In this problem, I don't need precision either efficiency. Is there a better kernel that can compute the triangulation refinement? The constrained of the triangulation are those in the attached image of the first e-mail.



On Sat, May 23, 2015 at 3:02 PM, Renato Silveira <> wrote:
As far as I know, I can't use CGAL::refine_Delaunay_mesh_2 with EPECK. It needs _sqrt, which will consume all the memory. Am I wrong?


On Fri, May 22, 2015 at 6:33 AM, Sebastien Loriot (GeometryFactory) <> wrote:
On 05/22/2015 11:30 AM, Renato Silveira wrote:
Thank you! I will try it!
The problem with  CGAL::Exact_predicates_exact_constructions_kernel is
that the programs consumes all the memory and than crash. The problem
with points very close to each other can cause this behavior?


Note that there is no _sqrt here (which is not needed for CDT only).

Sebastien.

Thanks

On Fri, May 22, 2015 at 6:00 AM, Sebastien Loriot (GeometryFactory)
< <mailto:>> wrote:

    It might be that you have two points really close to each other
    after the self-intersection removal.

    Maybe you should first run the polyline simplification algorithm:
    http://doc.cgal.org/latest/Polyline_simplification_2/index.html#Chapter_2D_Polyline_simplification

    It would definitely help if you can share a minimal example showing
    the issue.

    For compute_subcurves, you should use
    CGAL::Exact_predicates_exact_constructions_kernel (EPECK) as Kernel.
    Note also that you can compute the self-intersection inside a CDT
    if intersection tag allows it. It will be safer to use EPECK too
    in this case.

    Sebastien.


    On 05/22/2015 09:36 AM, Renato Silveira wrote:

        Hi,

        I'm trying to refine a Deluanay triangulation using
        CGAL::refine_Delaunay_mesh_2. I'm using the kernel definitions:

        typedef CGAL::Exact_predicates_inexact_constructions_kernelK;
        typedef CGAL::Triangulation_vertex_base_2<K>Vb;
        typedef CGAL::Delaunay_mesh_face_base_2<K>Fb;
        typedef CGAL::Triangulation_data_structure_2<Vb, Fb>Tds;
        typedef CGAL::Exact_predicates_tagItag;
        typedef CGAL::Constrained_Delaunay_triangulation_2<K, Tds, Itag>CDT;
        typedef CGAL::Delaunay_mesh_size_criteria_2<CDT>Criteria;
        typedef CGAL::Delaunay_mesher_2<CDT, Criteria>Mesher;
        typedef CDT::Vertex_handleVertex_handle;
        typedef CDT::PointCDT_Point;

        Initially, my CDT constraints auto-intersects, but I eliminate
        intersections using *CGAL::compute_subcurves *(using kernel
        *CGAL::Quotient<CGAL::MP_Float>*) on the constraints before the
        triangulation, as shown in attached figure (I thought it could
        solves
        the problem).

        I got a valid CDT triangulation (as shown in the attached
        figure) but
        when I try to refine the CDT, using the method:

        *CGAL::refine_Delaunay_mesh_2(...);*

        with the criteria:

        *Criteria(0.125, 25.0f)*

        I got this assert violation:

        /*terminate called after throwing an instance of
        'CGAL::Assertion_exception' */
        /*  what():  CGAL ERROR: assertion violation! */
        /*Expr: n == zone.fh */
        /*File: /usr/local/include/CGAL/Mesh_2/Refine_edges.h */
        /*Line: 438 */


        I think constraint intersections can appear again when I convert
        points
        from kernel *CGAL::Quotient<CGAL::MP_Float>* to kernel
        *CGAL::Exact_predicates_inexact_constructions_kernel*. If I
        could run
        *CGAL::Delaunay_mesher_2* with kernel
        *CGAL::Quotient<CGAL::MP_Float>* I
        will not have any intersections (I think).

        I don't know if the problem is with my constraints or with the
        mesher.
        Any ideas what I should try?

        PS:
        - Using only the boundary as CDT constraints, everything works
        fine (as
        shown in attached figure).
        - I also tested everything with
        Exact_predicates_exact_constructions_kernel_with_sqrt kernel, with
        CGAL::Exact_intersections_tag but it takes so much time and then
        it run
        out of memory with the message: "GNU MP: Cannot allocate memory
        (size=25186388)".


        Thank you in advance

        Renato

        --
        */Renato Silveira
        /*
               Ph.D. in Computer Science
               Informatics Institute - UFRGS
               Porto Alegre - RS - Brazil
        http://www.inf.ufrgs.br/~rsilveira



    --
    You are currently subscribed to cgal-discuss.
    To unsubscribe or access the archives, go to
    https://sympa.inria.fr/sympa/info/cgal-discuss





--
*/Renato Silveira
/*
      Ph.D. in Computer Science
      Informatics Institute - UFRGS
      Porto Alegre - RS - Brazil
http://www.inf.ufrgs.br/~rsilveira


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss





--
Renato Silveira
     Ph.D. in Computer Science
     Informatics Institute - UFRGS

     Porto Alegre - RS - Brazil




--
Renato Silveira
     Ph.D. in Computer Science
     Informatics Institute - UFRGS

     Porto Alegre - RS - Brazil




Archive powered by MHonArc 2.6.18.

Top of Page