Scilab Function
Last update : November 2005

cgal_cdt2_insert_points - Insert new points in cdt2.

Calling Sequence

cgal_cdt2_insert_points(ptr,new_x,new_y);

Parameters

Description

Given a pointer ptr of cdt2, cgal_cdt2_insert_points(ptr,new_x,new_y) inserts a new points in cdt2.

Examples



x = rand(1,10)*5;
y = rand(1,10)*4;
new_x = rand(1,4)*6;
new_y = rand(1,4)*3;

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_constraind_delaunay_2(x,y,C);
cgal_cdt2_insert_points(ptr,new_x,new_y);
coord = cgal_cdt2_get_coord(ptr);
tri = cgal_cdt2_get_connectivity(ptr);
clf();
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");

 
  

See Also

cgal_cdt2_insert_constraints ,   cgal_cdt2_get_coord ,   cgal_cdt2_remove_constraints ,   cgal_cdt2_remove_points ,   cgal_cdt2_get_connectivity ,   cgal_cdt2_delete ,  

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

Authors

Naceur MESKINI.