<< mesh2_get_coord cglab mesh2_set_seeds >>

cglab >> cglab > mesh2_refine

mesh2_refine

Refine mesh2.

Calling Sequence

mesh2_refine(ptr,shape_criteria,size_criteria)

Parameters

shape_criteria , size_criteria
: The shape criterion on triangles is a lower bound on the ratio between the circumradius and the shortest edge length. The size criterion can be any criterion that tends to prefer small triangles. For example, the size criterion can be an upper bound on the length of longest edge of triangles, or an upper bound on the radius of the circumcircle.
ptr
: is a pointer representing mesh2.

Description

Given a pointer ptr of mesh2, mesh2_refine(ptr,shape_criteria,size_criteria) allows to refine the mesh of a domain.

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,ptr]= mesh_2(C);
mesh2_set_seeds(ptr,3.5,2.5);

mesh2_refine(ptr,0.1,0.5);

tri = mesh2_get_connectivity(ptr);
coord = mesh2_get_coord(ptr);
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
mesh2_delete(ptr,"ptr");

See Also

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

Authors


Report an issue
<< mesh2_get_coord cglab mesh2_set_seeds >>