DelaunayTri

1 回表示 (過去 30 日間)
dk
dk 2011 年 10 月 18 日
コメント済み: Divyam 2024 年 10 月 8 日
I already have a triangulation (x,y,z,tri). How can I create a DelaunayTri class without re-triangulating?

回答 (2 件)

Divyam
Divyam 2024 年 10 月 8 日
編集済み: Divyam 2024 年 10 月 8 日
Hi @dk,
It is not possible to create a "DelaunayTri" object without re-triangulation. To create the "DelaunayTri " object you have to use the extracted points from the "triangulation" object. As of MATLAB R2024b, "DelaunayTri " class is not recommended and it's preferable to use the "delaunayTriangulation" class instead.
% Assume T is your Triangulation object
T = triangulation([1, 2, 3; 1, 3, 4], [0, 0; 1, 0; 0, 1; 1, 1]);
% Extract the points
points = T.Points;
% Create a DelaunayTri object
delaunayTriObj = DelaunayTri(points);
% Define points to check
P = [0.5, 0.5; 0.75, 0.75; 0.25, 0.25];
% Use pointLocation to find the triangles containing the points
triangleIndices = pointLocation(delaunayTriObj, P);
% Display the results
fprintf('Triangle indices for the query points: [%s]\n', join(string(triangleIndices),','));
Triangle indices for the query points: [2,2,1]
For more information regarding the "delaunayTriangulation" class, refer to the following documentation: https://www.mathworks.com/help/matlab/ref/delaunaytriangulation.html
  2 件のコメント
Walter Roberson
Walter Roberson 2024 年 10 月 8 日
However, this series of steps involves re-triangulating, which the original poster hoped to avoid.
Divyam
Divyam 2024 年 10 月 8 日
I edited the answer and explicitly pointed out that it isn't possible to create a DelaunayTri object without re-triangulating the points.
Thanks for pointing it out Walter!

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


Walter Roberson
Walter Roberson 2024 年 10 月 8 日
As of R2013a you can create a triangulation object, passing in the connectivity and x and y and z data.
Unfortunately, you cannot create a DelaunayTri object or delaunayTriangulation object without re-triangulating.

カテゴリ

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