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
댓글 수: 0
답변 (2개)
LIN Hongbin
2016년 5월 31일
Hello,Yose. Have you solved the problem of meshing the 3d concave model?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Delaunay Triangulation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!