How to improve "pointLocation" detection on the outer boundary of a "delaunayTriangulation" object?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 31 Mag 2023
Risposto: MathWorks Support Team
il 5 Giu 2023
I have a "delaunayTriangulation" object of a collection of points, and I am trying to use "pointLocation" to find the enclosing triangle of a query point. According to the "inpolygon" function, the query point is on the edge of the polygon defined by the convex hull of the collection of points. However, the "pointLocation" method of the "delaunayTriangulation" object indicates that the query point lies outside the convex hull.
How can I correctly identify the enclosing triangle of a query point on the outer boundary of a "delaunayTriangulation" object?
Risposta accettata
MathWorks Support Team
il 31 Mag 2023
To identify the enclosing triangle of a query point on the outer boundary of a "delaunayTriangulation" object, please convert your "delaunayTriangulation" object into a regular "triangulation" object. From there, you can use the "pointLocation" method of the "triangulation" object to obtain more accurate results.
For example, consider the following code, where "DT" is the "delaunayTrianguation" object and "P" is the query point:
T = triangulation(DT.ConnectivityList, DT.Points); % convert delaunayTriangulation into triangulation
[ID, B] = pointLocation(T, P); % find the enclosing triangle and barycentric coordinates of the query point
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Delaunay Triangulation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!