barycartNT

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 1.1, Creation date: 2014-01-11, Last change: 2025-09-14

returns the vertex list (3D) of a point list (2D) relative to one facet

Description

Many geometrical calculations must be executed in 2D relatively to a given facet. Here, we use a Normalize Triangle PL0=[0 0;1 0;0 1] and calculate the barycentric coordinates back into the 3D Cartesian space. Use cartbaryNT for receiving the 2D barycentric coordinates

See Also: cartbaryNT

Example Illustration

 missing image of barycartNT(dt,Fi,XPL)

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

Output

Algorithm Steps

  1. Check if XPL is empty. If it is, return an empty array XVL.
  2. Extract the vertex list VL from the DelaunayTri object dt.
  3. Retrieve the indices of the vertices that form the specified facet Fi from the triangulation.
  4. Calculate the vectors p1 and p2 by subtracting the first vertex of the facet from the second and third vertices, respectively.
  5. Initialize an empty array XVL to store the resulting 3D Cartesian coordinates.
  6. 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