PLELnorm
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PLEL/Point List/Edge List
Introduced first in SolidGeometry 1.1, Creation date: 2013-12-30, Last change: 2025-09-14
returns norm vectors of edges and points of contours
Description
For each edge and each point of a given PL and EL, the normalized direction vectors are calculated. Used in PLELpushin
See Also: PLnorm
, PLFLfaceNormal
, VLnorm
, VLFLfaceNormal
Example Illustration
Syntax
[PLN,ELN]=PLELnorm(PL,EL)
Input Parameter
PL: | | Point list |
EL: | | Edge list |
Output Parameter
PLN: | | Point list norm vectors |
ELN: | | edge list norm vectos |
Copyright 2013-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 algorithm calculates normalized direction vectors for each edge and point of given point and edge lists. It is part of the SG-Library and is used in the PLELpushin function.
Input Parameters
- PL: Point list, a matrix where each row represents a point in 2D space.
- EL: Edge list, a matrix where each row represents an edge by specifying two indices of points in the point list.
Output Results
- PLN: Point list norm vectors, a matrix where each row is the normalized vector for a point.
- ELN: Edge list norm vectors, a matrix where each row is the normalized vector for an edge.
Algorithm Steps
- Calculate the direction vectors for each edge by subtracting the coordinates of the starting point from the ending point of each edge. This is done using the expression
PL(EL(:,2),:) - PL(EL(:,1),:).
- Normalize these direction vectors using the
PLnorm function, resulting in ELN, the normalized edge vectors.
- Initialize
PLN as a zero matrix with the same number of rows as PL and two columns.
- Iterate over each edge in
ELN:
- For the starting point of the edge, add the normalized edge vector to the corresponding row in
PLN.
- For the ending point of the edge, subtract the normalized edge vector from the corresponding row in
PLN.
- Normalize the vectors in
PLN using the PLnorm function to ensure they are unit vectors.
Algorithm explaination created using ChatGPT on 2025-08-18 23:07. (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