CVLofVLEL2
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CVL/Closed Vertex Lists
Introduced first in SolidGeometry 5.0, Creation date: 2020-12-25, Last change: 2025-09-15
processes a fortmat of
See Also: CVLofVLEL
Example Illustration
Syntax
CVL=CVLofVLEL2(VLA,ELA)
Input Parameter
VLA: | | VLA or [p2 p2; p2 p3; ...] |
ELA: | | ELA if VLA is used |
Output Parameter
Examples
CVLofVLEL2([0 0 1 0 0 2; 0 0 2 0 0 3; 0 0 3 0 0 4; 0 0 5 0 0 6])
Copyright 2020-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, CVLofVLEL2, processes a format of closed polygon lists from vertex and edge lists. It is part of the SolidGeometry library.
Input Parameters
- VLA: A matrix representing vertex list arrays. It can be in the form of [p2 p2; p2 p3; ...].
- ELA: An edge list array, required if VLA is used.
Output
- CVL: The closed polygon list.
Algorithm Steps
- Check if VLA has less than one row. If true, return an empty CVL.
- If only one input argument is provided and VLA has 6 columns, treat VLA as a combined vertex and edge list array (VLELA).
- Split VLELA into separate VLA and ELA matrices.
- Use the
unique function to remove duplicate rows in VLA, rounding to two decimal places, and update ELA accordingly.
- Identify edges that form closed loops using the
circshift function.
- Initialize an array, CVL, to store the closed polygon list.
- Iterate over the identified closed loops, appending vertices to CVL and separating each loop with a row of NaN values.
- Trim the CVL array to remove unused rows.
- If no output is requested, plot the CVL using the
SGfigure and CVLplot functions.
Algorithm explaination created using ChatGPT on 2025-08-19 01:03. (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