Fonction Scilab
Last update : Juin 2004

cgal_constrained_delaunay_2 - Constrained Delaunay triangulation

### Calling Sequence

[tri [,ptr] ] = cgal_constrained_delaunay_2(x,y,C)

### Parameters

• x , y : are vectors of points coordinates.
• C : is (nbconstraints,4) array, Each row of C defines one constrained edge by its two endpoints.
• tri : is (nbtriangle,3) matrix, Each row of tri defines one triangle and contains indices into (x,y).
• ptr : is a pointer representing constrained Delaunay triangulation, cdt2. The associated functions that using "ptr" are: - cgal_cdt2_get_coord

### Description

A constrained Delaunay triangulation is a triangulation with constrained edges which tries to be as much Delaunay as possible. Constrained edges are not necessarily Delaunay edges, therefore a constrained Delaunay triangulation is not a Delaunay triangulation. A constrained Delaunay is a triangulation whose faces do not necessarily fulfill the empty circle property but fulfill a weaker property called the constrained empty circle. To state this property, it is convenient to think of constrained edges as blocking the view. Then, a triangulation is constrained Delaunay if the circumscribing circle of any of its triangular faces includes in its interior no vertex that is visible from the interior of the triangle.

### Examples

```
x = [5 1 6];
y = [2 6 6];
C=[8.    2.     7.    4.;6.    4.5    4.    5.;3.    6.     3.    7.;3.    4.     2.    3.;9.    4.     8.    7.];
[tri,ptr] = cgal_constrained_delaunay_2(x,y,C);
clf();
coord = cgal_cdt2_get_coord(ptr);
X=coord(:,1)';
Y=coord(:,2)';
[nbtri,nb] = size(tri);
tri = [tri tri(:,1)];
for k = 1:nbtri
plot2d(X(tri(k,:)),Y(tri(k,:)),style = 2);
end
[nbconstraints,nb] = size(C);
for i = 1:nbconstraints
plot2d([C(i,1) C(i,3)]',[C(i,2) C(i,4)]',style = 3);
plot2d([C(i,1) C(i,3)]',[C(i,2) C(i,4)]',style = -5);
end
cgal_cdt2_delete(ptr,"ptr");

```