Reputation: 83254
In my meshing application I will have to specify fix points within a domain. The idea is that, the fix points must also be the element points after the domain is being meshed.
Furthermore, the elements around the fix points should be more dense. The general concept is that for the fix points, there should exist a radius r
around those points, such that the mesh size inside r
is of different sizes than outside of the r
. The mesh sizes inside and outside of the r
should be specifiable.
Are these two things doable in CGAL 2D Mesh algorithm?
Upvotes: 1
Views: 137
Reputation: 6274
Using your wording, all the input point of the initial constrained Delaunay triangulation will be fix points, because the 2D mesh generator only insert new points in the triangulation: it never removes any point.
As for the density, you can copy, paste, and modify a criteria class, such as CGAL::Delaunay_mesh_size_criteria_2<CDT>
so that the local size upper bound is smaller around the fix points.
Now, the difficulty is how to implement that new size policy. Your criteria class could store a const reference to another Delaunay_triangulation_2
, that contains only the fixed points you want. Then, for each triangle query, you can call nearest_vertex
and then actually check if the distance between the query point is smaller that the radius bound of your circles. For a triangle, you can either verify that for only its barycenter, or for all three points of the triangle. Then, according to the result of that/those query(s), you can modify the size bound, in the code of your copy of CGAL::Delaunay_mesh_size_criteria_2<CDT>
.
Upvotes: 1
Reputation: 6253
Yes, no points will be removed from the triangulation by the mesher. Note however that if you insert points too close to a constraint this will induce a refinement of the constraint while it is not Gabriel.
Upvotes: 1