sizePLFL
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 1.1, Creation date: 2014-01-04, Last change: 2025-09-14
returns the index of facets with area > 0
Description
uses crossz (limited to 2D points list) to calculate the size and orientation of 2D facets
Example Illustration
Syntax
[si,sf]=sizePLFL(PL,FL)
Input Parameter
PL: | | 2D Point list |
FL: | | Facet list |
Output Parameter
si: | | index of area > 0 |
sf: | | facet area (+1= upward, -1 = downward) |
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, sizePLFL, is designed to calculate the size and orientation of 2D facets using a list of points and a list of facets. It returns the indices of facets with a positive area and the orientation of each facet.
Input Parameters
- PL: A 2D point list. Each row represents a point in 2D space.
- FL: A facet list. Each row contains indices of points in
PL that form a facet (triangle).
Output Results
- si: An index array indicating which facets have an area greater than zero.
- sf: An array of facet areas, where +1 indicates an upward orientation and -1 indicates a downward orientation.
Algorithm Steps
- Initialize a threshold
thr to 1e-12 to determine significant areas.
- Create an array
sf with the same number of rows as FL and initialize it to zero. This will store the signed area of each facet.
- Iterate over each facet in
FL:
- For each facet, calculate the vectors from the first point to the second and third points using the indices in
FL.
- Use the
crossz function to compute the signed area of the facet. This function calculates the cross product of the two vectors, which gives the area and orientation of the facet.
- Store the result in the
sf array.
- Determine which facets have an area greater than the threshold by taking the absolute value of
sf and comparing it to thr. Store the result in si.
Algorithm explaination created using ChatGPT on 2025-08-18 22:26. (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