フィルターのクリア

How to triangulate a non-convex ordered set of points?

11 ビュー (過去 30 日間)
Luca M
Luca M 2021 年 1 月 23 日
回答済み: Luca M 2021 年 1 月 23 日
I have a polygon defined by this anti-clockwise ordered set of points
points = [0 0; 1 0; 0.5 0.5; 1 1; 0 1];
patch(points(:, 1), points(:, 2))
I'd like to have any triangulation of this non convex polygon available. I know that delaunayTriangulation is only for convex-hulls.
I need something that can be automated for an arbitray (connected) non-convex or convex polygon (always ordered anti-clockwise). I know that alphaShape can be used somehow for this, but from the documentation I have no idea how to automate the creation of the correct non-convex polygon using an alphaShape.
The alternative I have is computing the constrained (else I could create holes) delaunay triangulation and then removing manually the triangles whose baricenter is outside the polygon (if there is a way to check), but I hope there is a better way for this.
Thanks for tips.

採用された回答

Luca M
Luca M 2021 年 1 月 23 日
T = triangulation(polyshape(points));
triplot(T)

その他の回答 (1 件)

Bruno Luong
Bruno Luong 2021 年 1 月 23 日
I recommednd this Mesh2D FEX
  1 件のコメント
Luca M
Luca M 2021 年 1 月 23 日
Thank you, but I found out a very simple solution. Using a polyshape object:
T = triangulation(polyshape(points));
triplot(T)

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

カテゴリ

Help Center および File ExchangeBounding Regions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by