Syntax
[XVL]=barycartNT(dt,Fi,XPL)
Input Parameter
dt : | | DelaunayTri object |
Fi : | | Facet index to relate to |
XPL : | | Vertex list, the 2D barycentric coordianates are requested |
Output Parameter
[XVL] : | | Point list (2D) of barycentric coordinates |
Examples
Transform a 3D vertex list into a 2D point list an back into a 3D vertex list
PL=cartbaryNT(dt,Fi,VL)
VL=barycartNT (dt,Fi,XPL)
Copyright 2014-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, barycartNT
, converts 2D barycentric coordinates into 3D Cartesian coordinates relative to a specified facet of a Delaunay triangulation.
Input Parameters
- dt: A DelaunayTri object representing the triangulation. It contains the vertices and the triangulation information.
- Fi: The index of the facet (triangle) within the triangulation to which the barycentric coordinates relate.
- XPL: A list of points in 2D barycentric coordinates that need to be converted to 3D Cartesian coordinates.
Output
- XVL: A list of points in 3D Cartesian coordinates corresponding to the input 2D barycentric coordinates.
Algorithm Steps
- Check if
XPL
is empty. If it is, return an empty array XVL
.
- Extract the vertex list
VL
from the DelaunayTri object dt
.
- Retrieve the indices of the vertices that form the specified facet
Fi
from the triangulation.
- Calculate the vectors
p1
and p2
by subtracting the first vertex of the facet from the second and third vertices, respectively.
- Initialize an empty array
XVL
to store the resulting 3D Cartesian coordinates.
- For each point in
XPL
:
- Compute the 3D Cartesian coordinates using the formula:
XVL(j,:) = p0 + p1 * XPL(j,1) + p2 * XPL(j,2)
.
This algorithm effectively maps 2D barycentric coordinates back to their corresponding 3D Cartesian coordinates using the vertices of a specified facet in a Delaunay triangulation.
Algorithm explaination created using ChatGPT on 2025-08-19 06:58. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21