Clear Filters
Clear Filters

Delaunay problem of a concave object

3 views (last 30 days)
Yose Wandy
Yose Wandy on 21 Apr 2016
Answered: LIN Hongbin on 31 May 2016
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

Answers (2)

KSSV
KSSV on 21 Apr 2016
I suggest you to use the code MESH2D provided in the given link.
  1 Comment
Yose Wandy
Yose Wandy on 21 Apr 2016
I can't.. The requirement is to Code our own simple generator. :(

Sign in to comment.


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

Categories

Find more on Delaunay Triangulation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!