1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| th = linspace(0,2*pi,30);
th(end) = [];
% Contour interne
r = 1;
x = r*cos(th);
y = r*sin(th);
% Contour externe
R = 1.3;
X = R*cos(th);
Y = R*sin(th);
% Triangulation sur le domaine complet
tri = delaunay([x(:);X(:)],[y(:);Y(:)]);
% Suppression des éléments qui ne possèdent que des noeuds du contour interne
num = 1:numel(x);
idx = ~all(ismember(tri,num),2);
% Visualisation
figure
subplot(2,2,[1 2])
plot(x,y,'r-',X,Y,'b-');
axis equal tight
subplot(2,2,3)
triplot(tri,[x(:);X(:)],[y(:);Y(:)])
axis equal tight
subplot(2,2,4)
triplot(tri(idx,:),[x(:);X(:)],[y(:);Y(:)])
axis equal tight |
Partager