Syntax
[NL,AL]=PLFLfaceNormal(PL,FL,[fi])
Input Parameter
PL : | | Point list n x 2 |
FL : | | Facet list |
fi : | | optional value; facet index (list) |
Output Parameter
NL : | | n x [0 0 1] |
AL : | | Area list; |
Copyright 2015-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, PLFLfaceNormal
, calculates the normal vector and area of facets defined by a point list and a facet list. It is designed to adapt the VLFL syntax to MATLAB R2014b.
Input Parameters
- PL: A point list, which is an n x 2 matrix where each row represents a point in 2D space.
- FL: A facet list, which defines the facets using indices of points from the point list.
- fi (optional): A list of facet indices to process. If not provided, all facets are processed.
Output Results
- NL: A matrix where each row is the normal vector [0 0 1] for each facet. This indicates that the normal vector is always pointing in the z-direction in 2D space.
- AL: A list of areas for each facet, calculated using the cross product in 2D.
Algorithm Steps
- Initialize
fi
to cover all facets if not provided.
- Determine the number of facets to process,
ni
.
- Initialize
NL
and AL
to store results for each facet.
- Loop over each facet index in
fi
:
- Calculate the area of the facet using the
crossz
function, which computes the z-component of the cross product of two vectors formed by the points of the facet.
- Set the normal vector for each facet to [0 0 1], indicating a constant normal direction in 2D.
Algorithm explaination created using ChatGPT on 2025-08-18 23:35. (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