Delaunay problem of a concave object

3 次查看(过去 30 天)
Hallo everybody,
I have a problem with delaunay making connections, where it isn't supposed to make. It somehow make connections on the concave part of the object. I hope that someone can help with the problem, thank you!
Best regards %% Code start
clc;
clear all; close all;
%%Für andere Geometrien mussen nur die Ränder geändert werden
%%Rand Ding
filename = 'ding2.xlsx';
PositionX = xlsread(filename,'A1:A300');
PositionY = xlsread(filename,'B1:B300');
Rand_X = PositionX;
Rand_Y = PositionY;
Punkte_Rand = [Rand_X(:),Rand_Y(:)];
figure(1),plot(Rand_X,Rand_Y,'x');
%%Ab hier soll das Generator nicht geändert werden
%%Kasten
K_X = Rand_X;
K_Y = Rand_Y;
h0=0%(t(2)-t(1))/2; %Verschiebungsweite
K_X(:,2:2:end)= K_X(:,2:2:end,1) + h0; %Jede zweite Zeile Verschieben
[P,Q]=meshgrid(K_X,K_Y);
Punkte_Rand = [K_X(:),K_Y(:)]; %neue rand Koord.
Punkte_Box = [P(:),Q(:)]; %Koord. Box
figure(2),plot(P,Q,'X'); %Darstellung von Boxen (Wie der Punkte verteilt werden)
%%Aussortierung, was innerhalb von Randlinie abspeichern
for x=1:length(Punkte_Rand)-1
for xk=1:length(Punkte_Box)-1
if Punkte_Box(xk,1) == Punkte_Rand(x,1)
if (Punkte_Box(xk,2)<=Punkte_Rand(x,2)) && (Punkte_Box(xk,2)>=Punkte_Rand((length(Punkte_Rand)+1)-x,2))
Punkte_Geo(xk,:) = Punkte_Box(xk,:);
end
end
end
end
N_Sorted_X=size(Punkte_Geo,1); % Anzahl der sortierten Knotenpunkte
figure(3), plot(Punkte_Geo(:,1),Punkte_Geo(:,2),'X'); %Darstellung abgespeicherter Punkte
Punkte_Sorted = [Punkte_Geo(:,1),Punkte_Geo(:,2)]; %abspeichern
%%Triangulieren
DT = delaunayTriangulation(Punkte_Sorted,C) %Punkte triangulieren
figure(4),triplot(DT); %Triangulierte Form darstellen

回答(2 个)

KSSV
KSSV 2016-4-21
I suggest you to use the code MESH2D provided in the given link.

LIN Hongbin
LIN Hongbin 2016-5-31
Hello,Yose. Have you solved the problem of meshing the 3d concave model?

类别

Help CenterFile Exchange 中查找有关 Delaunay Triangulation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by