フィルターのクリア

Using Delaunay triangulation to approximate the area

3 ビュー (過去 30 日間)
fengsen huang
fengsen huang 2018 年 11 月 14 日
コメント済み: madhan ravi 2018 年 11 月 14 日
Hi,
I try to use delaunay triangulation but it also connected the boundary point
As you an see the X shape, thats what I wanted only, not the square too.
thank you
  2 件のコメント
John D'Errico
John D'Errico 2018 年 11 月 14 日
編集済み: John D'Errico 2018 年 11 月 14 日
Why did you need to ask this question twice? As I showed the last time you asked the question, you cannot use a Delaunay triangulation to do what you want, at least not without understanding how to code an alpha shape.
madhan ravi
madhan ravi 2018 年 11 月 14 日
please don‘t ask the same question twice , this discourages the answerers who answer the question

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

回答 (1 件)

KSSV
KSSV 2018 年 11 月 14 日
Taking the code from John D'Errico. answer here
xy = rand(5000,2);
k = (sqrt(sum((xy - [1 .5]).^2,2)) < 0.3) | ...
(sqrt(sum((xy - [0 .5]).^2,2)) < 0.3) | ...
(sqrt(sum((xy - [0.5 1]).^2,2)) < 0.3) | ...
(sqrt(sum((xy - [0.5 0]).^2,2)) < 0.3);
xy(k,:) = [];
x = xy(:,1) ; y = xy(:,2) ;
idx = boundary(x,y) ; % gives boundary
plot(x,y,'.r')
hold on
plot(x(idx),y(idx),'b')
A = polyarea(x(idx),y(idx))

カテゴリ

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