<< mesh2_set_seeds CG-lab surface_mesher >>

CG-lab >> CG-lab > mesh_2

mesh_2

Delaunay Mesher

Calling Sequence

[coord,tri [,ptr] ]=mesh_2(C)

Parameters

coord
: is (nbvertices,2) array defininig (x,y) coordinates of vertices of the obtained mesh. where nbvertices is number of vertices of the mesh.
tri
: is (nbtriangles,3) array, Each row of tri defines one triangle and contains indices into (x,y). nbtriangles is number of triangles of mesh.
ptr
: is pointer representing Delaunay mesher. ptr contains the data structure of the mesh, and all operations about the mesh passes throw this pointer.
C
: is (nbsegments,4) array, Each row of C defines one segment by its two endpoints. All segments defines a domain to be meshed.

Description

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).

Examples

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]= 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

See Also

For more details see CGAL Manual.

This function uses the Mesh_2 package of CGAL, which is under QPL license. See License Terms

Authors

<< mesh2_set_seeds CG-lab surface_mesher >>