Insert new points in dt2.
dt2_insert_points(ptr,new_x,new_y);
Given a pointer ptr of dt2, dt2_insert_points(ptr,new_x,new_y) inserts a new points in dt2.
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"); | ![]() | ![]() |
This function uses the Triangulation_2 package of CGAL, which is under QPL license. See License Terms