I am trying to triangulate a specified region along a 2d plane. The region i wish to tringualte is specified by x and y cooridantes and the lines joining each of these points. However when I use delaunyTriangulation it triangulates the entire region, including the parts I wish to leave out. I have inserted an image below.
Is there anyway to specify the boundary or region of which I would like to triangulate or remove the large unwated trinagles from the triangulation?
Thanks
untitled.jpg

댓글 수: 3

darova
darova 2019년 6월 7일
If you have boundaries of your region use inpolygon() to indicate points inside and then triangulation
Robin Pillar
Robin Pillar 2019년 6월 7일
I already have the points which I have included an image below. What I want is to triangulate the narrow region between the points but not outside as keeps happening
untitled.jpg
darova
darova 2019년 6월 7일
Can you please attach this data?

댓글을 달려면 로그인하십시오.

 채택된 답변

KSSV
KSSV 2019년 6월 7일

1 개 추천

Read about delaunayTriangulation , you can provide edge constraints. On providing these constraints; you can avoid such triangles.
DT = delaunayTriangulation(x,y,C)

댓글 수: 7

Robin Pillar
Robin Pillar 2019년 6월 7일
I've tried this and used the edges which are the outline of the shape I've shown above as the constraints and I still get it triangulating the area outside the narrow region I want
KSSV
KSSV 2019년 6월 7일
Attach your data....I can work on it on Monday only...weekend :)
Robin Pillar
Robin Pillar 2019년 6월 10일
Data attached
YOu have other option: explore alphashape
data = importdata('data.txt') ;
x = data(:,1) ; y = data(:,2) ;
% dt = delaunayTriangulation(x,y) ;
shp = alphaShape(x,y) ;
shp.Alpha = 0.04 ;
plot(shp)
YOu can play around with value of shp.Alpha. Meanwhile I will try delaunay on the data and let you know. Actually the points (x,y) are not in order, we need to arrange them in order to provide constraints.
untitled.bmp
I have arranged the points Point.txt in an order and run delaunayTriangulation. I am attaching the data and code here.
data = importdata('data.txt') ;
x = data(:,1) ; y = data(:,2) ;
p = (1:length(x))' ;
C = [p(1:end-1) p(2:end)] ;
dt = delaunayTriangulation(x,y,C) ;
figure
triplot(dt)
xnew = dt.Points(:,1) ; ynew = dt.Points(:,2) ;
isInside = isInterior(dt) ; % Find triangles inside the constrained edges
tri = dt(isInside, :); % Get end point indices of the inner triangles
figure
triplot(tri,xnew,ynew);
untitled.bmp
darova
darova 2019년 6월 11일
KSSV, how did you order those points? (Manually?)
KSSV
KSSV 2019년 6월 11일
I used another software which my colleague uses...:)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Delaunay Triangulation에 대해 자세히 알아보기

질문:

2019년 6월 7일

댓글:

2019년 6월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by