cgal_mesh_2 - Delaunay Mesher
A mesh is a partition of a given region into simplices whose shapes and sizes satisfy several criteria. The domain is the region that the user wants to mesh. It has to be a bounded region of the plane. The domain is defined by a planar straight line graph, PSLG for short, which is a set of segments such that two segments in the set are either disjoint or share an endpoint. The segments of the PSLG are constraints that will be represented by a union of edges in the mesh. The segments of the PSLG are either segments of the boundary or internals constraints. The segments of the PSLG have to cover the boundary of the domain. The PSLG divides the plane into several connected components. By default, the domain is the union of the bounded connected components. The user can override this default by providing a set of seed points. Seed points mark components not to be meshed (holes).
C=[1 1 5 1; 5 1 7 3; 7 3 4 4; 4 4 3 6; 3 6 1 5; 1 5 1 1;... 5 2 5 3; 5 3 3 4; 3 4 2 2; 2 2 5 2]; [coord,tri]= cgal_mesh_2(C); clf(); [nbtri,nb] = size(tri); tri = [tri tri(:,1)]; x=coord(:,1)'; y=coord(:,2)'; for k = 1:nbtri plot2d(x(tri(k,:)),y(tri(k,:)),style = 2); end
cgal_mesh2_refine , cgal_mesh2_set_seeds , cgal_mesh2_get_connectivity , cgal_mesh2_get_coord , cgal_mesh2_delete ,
For more details see CGAL Manual.
This function uses the Mesh_2 package of CGAL, which is under QPL license. See License Terms