Please help ! :) I have an ugly way to detect the segments in the concave region which is basically to see if the middle of the segment is inside my boundary but this method is prone failing with coarse resolution...
Remove edges from concave triangulation
6 ビュー (過去 30 日間)
古いコメントを表示
Hello,
Let say I have a curve that is both concave and convex on which I run a delaunayTriangulation with a constraint matrix that is the domain. How do I get rid of edges that go outside of the domain in the concave region ? It looks like the isInterior works on points and not on edges so it does not detect these edges outside the domain. I could code myself the edges location and check whether in domain, but somehow I think there is a cleaner way. Moreover, when the edges to remove are detected, is it possible to create another delaunayTriangulation without those edges ?
A quick and dirty Matlab code example to show the issue:
% circle
x=cos(theta*pi/180);
y=sin(theta*pi/180);
% create a concave region
I1=theta>270 & theta<360;
I2=theta>90 & theta<180;
xx=x(I2)+1;
yy=y(I2)-1;
x(I1)=xx(end:-1:1);
y(I1)=yy(end:-1:1);
% constraint
Constraint=[1:length(x)-1 ; 2:length(x)]';
% run triangulation
DT=delaunayTriangulation(x',y',Constraint);
% plot
triplot(DT)
% isInterior only gives 1 as all points belong to the domain...
find(isInterior(DT)==0)
ans =
Empty matrix: 0-by-1
回答 (1 件)
Bjorn Gustavsson
2021 年 12 月 15 日
You problem is dificult in principle. How are the unwanted triangles supposed to be determined? In a general enough case that you can use it, and not only in this specific case.
Perhaps you can somehow identify convex region(s) in your perimeter and find triangles with only points from the same convex set of points? That would be my (current) first approach to this problem. How does that generalize to more complex perimeters or general sets of points I cannot tell, but that might get you somewhere.
参考
カテゴリ
Help Center および File Exchange で Bounding Regions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!