First, I have one question : did you insert the interior constraints
before running the mesher (I mean the refinement step), or after?
Can you please send some code and data to help me reproduce the issue?
The use case you mention has been tested already, so I would need your data.
Le 23/02/2018 à 00:25, Chris Marsh a écrit :
> I've been successfully meshing a 2D domain with the CDT as per
> https://doc.cgal.org/latest/Mesh_2/index.html >
> I've been using an outer domain constraint, and have now started to
> add interior constraints (lines that represent rivers that should be
> not crossed by triangles).
> This works as expected.
> However, when I enable lloyd optimization I have the following error:
> Running 1 Lloyd iterations...
> CGAL error: assertion violation!
> Expression : do_intersect(line,
> File : /usr/local/include/CGAL/Constrained_voronoi_diagram_2.h
> Line : 392
> Refer to the bug-reporting instructions at
> http://www.cgal.org/bug_report.html > libc++abi.dylib: terminating with uncaught exception of type
> CGAL::Assertion_exception: CGAL ERROR: assertion violation!
> Expr: do_intersect(line, m_cdt.segment(face->blinding_constraint()))
> File: /usr/local/include/CGAL/Constrained_voronoi_diagram_2.h
> Line: 392
> When I use the same domain *without* the interior constraints, the
> lloyd optimization works as expected.
> I've been unable to figure out what is going wrong based on this error
> message and would appreciate any insight
Ok this is odd. I made some changes this morning (nothing related to my
constraint code) and recompiled, problem is gone. I can run the domain with
lloyd optimization without issue. However, the resulting "optimized" mesh is
of poor quality. Many small, thin (non-Delauany) triangles are present along
the constraint (circled in red). I've attached an image to show what I mean
where I ran max of 100 lloyd iterations. Is this expected behaviour? All the
other meshes I run lloyd iterations on produce high quality meshes.
I see the bad triangles, but I don't understand where the constraints
are, on your figure. Can you please highlight them?
Le 24/02/2018 à 01:00, chrism a écrit :
> Ok this is odd. I made some changes this morning (nothing related to my
> constraint code) and recompiled, problem is gone. I can run the domain with
> lloyd optimization without issue. However, the resulting "optimized" mesh is
> of poor quality. Many small, thin (non-Delauany) triangles are present along
> the constraint (circled in red). I've attached an image to show what I mean
> where I ran max of 100 lloyd iterations. Is this expected behaviour? All the
> other meshes I run lloyd iterations on produce high quality meshes.
> Sent from: http://cgal-discuss.949826.n4.nabble.com/ >
As I cannot attach a large image, it may be difficult to see exactly? If so,
I have paraview compatible VTU files as well as the triangulation and
constraint in ESRI shape files (shp) to load into a GIS, such as qGIS.
The triangles that are called "blind" (meaning that their
circumcenter is on the other side of a constrained edge) can
hardly have a good shape without refining the associated
See for example Figure 5, where such triangles are colored.
If you want better shaped triangles close to constrained edges,
they should be refined using the Delaunay_mesh_size_criteria_2
Also note that the Lloyd smoothing algorithm is enriched with a
sizing field that locally preserves the mesh density through
iterations. So, the vertices that are close to constraints should
remain close to constraints. It avoids creating needle-shaped
triangles next to constraints.