<< dt2_get_connectivity cglab dt2_remove_points >>

cglab >> cglab > dt2_insert_points

dt2_insert_points

Insert new points in dt2.

Calling Sequence

dt2_insert_points(ptr,new_x,new_y);

Parameters

new_x,new_y
: are vectors of new points coordinates.
ptr
: is a pointer representing dt2.

Description

Given a pointer ptr of dt2, dt2_insert_points(ptr,new_x,new_y) inserts a new points in dt2.

Examples

x = rand(1,10);
y = rand(1,10);
[tri1,ptr] = delaunay_2(x,y);

[nbtri,nb] = size(tri1);
tri = [tri1 tri1(:,1)];
clf();
for k = 1:nbtri
plot2d(x(tri(k,:)),y(tri(k,:)),style = 2);
end   
new_x = rand(1,10);
new_y = rand(1,10);  
dt2_insert_points(ptr,new_x,new_y);
new_tri = dt2_get_connectivity(ptr);

[nbtri,nb] = size(new_tri);
tri = [new_tri new_tri(:,1)];
clf();
X=[x new_x];
Y=[y new_y];
for k = 1:nbtri
plot2d(X(tri(k,:)),Y(tri(k,:)),style = 2);
end 
dt2_delete(ptr,"ptr");

See Also

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

Authors


Report an issue
<< dt2_get_connectivity cglab dt2_remove_points >>