VLFLfaceneighborangle
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Geometric Queries
Introduced first in SolidGeometry 5.1, Creation date: 2021-04-09, Last change: 2025-09-15
returns a signed (convex/concave) normal vector difference
Description
used in VLFLremovekinks
positive angle is concave
negative angle is convex
See Also: VLFLremovekinks
Example Illustration
Syntax
w=VLFLfaceneighborangle(VL,FLi,FLn)
Input Parameter
VL: | | Vertex list |
FLi: | | single face row |
FLn: | | up to 3 rows for neighbor facets |
Output Parameter
w: | | angles related to the FLn |
Examples
A=SGbox;
VLFLfaceneighborangle(A.VL,A.FL(1,:),A.FL([2 5 10 ],:))
Copyright 2021-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 calculates the signed angle between the normal vectors of a given face and its neighboring faces in a 3D mesh.
Input Parameters
- VL: Vertex list, a matrix where each row represents the coordinates of a vertex.
- FLi: A single face row, representing a face in the mesh using indices of vertices from the vertex list.
- FLn: Up to 3 rows for neighboring facets, each row representing a neighboring face using vertex indices.
Output
- w: Angles related to the neighboring faces (FLn), indicating the difference in orientation between the given face and its neighbors.
Algorithm Steps
- Retrieve the neighboring faces (FLn) using the function
getfuncparams.
- Calculate the normal vector
z of the given face FLi using the cross product of two edge vectors.
- Normalize the normal vector
z to get ez.
- Compute the transformation matrix
T3 using TofPez and its inverse Ti.
- Initialize an array
w to store the angles for each neighboring face.
- Iterate over each neighboring face:
- Identify the vertex
i4 that is not part of the given face FLi.
- Calculate the normal vector
e of the neighboring face using the cross product.
- Normalize the normal vector
e to get ei.
- Transform the vertex
i4 using VLtransT and the inverse transformation Ti.
- Determine the sign
sigi based on the transformed vertex's z-coordinate.
- Calculate the angle between
ez and ei using the dot product and acos, then multiply by sigi to get the signed angle.
- If no output is requested, plot the faces using
SGfigure and VLFLplotalpha.
Algorithm explaination created using ChatGPT on 2025-08-19 06:53. (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