フィルターのクリア

Delaunay problem of a concave object

3 ビュー (過去 30 日間)
Yose Wandy
Yose Wandy 2016 年 4 月 21 日
回答済み: LIN Hongbin 2016 年 5 月 31 日
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.
  1 件のコメント
Yose Wandy
Yose Wandy 2016 年 4 月 21 日
I can't.. The requirement is to Code our own simple generator. :(

サインインしてコメントする。


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

カテゴリ

Help Center および File ExchangeDelaunay Triangulation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by