VLFLshort2
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.1, Creation date: 2014-01-10, Last change: 2025-09-14
shortens a vertex list to the vertices that are really used in the facet list
Description
Faster and easier than VLFLshort
See Also: VLFLshort2
, VLELselect
, VLFLselect
, PLELselect
, PLFLselect
, TRselect
Example Illustration
Syntax
[VL,FL,n]=VLFLshort2(VL,FL,[thr])
Input Parameter
VL: | | Original vertex list |
FL: | | Original facet list |
thr: | | optional threshold, default is 1e-12 |
Output Parameter
VL: | | Shortend vertex list |
FL: | | Shortend and sorted facet list |
n: | | |
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, VLFLshort2, is designed to optimize a vertex list (VL) and a facet list (FL) by removing unused vertices and sorting the facet list. It is part of the SolidGeometry library and is an auxiliary procedure for handling 3D geometric data.
Input Parameters
- VL (Original Vertex List): A matrix where each row represents a vertex in 3D space.
- FL (Original Facet List): A matrix where each row represents a facet, defined by indices pointing to the vertex list.
- thr (Threshold): An optional parameter with a default value of 1e-12. It is used to determine the precision for rounding operations.
Output Results
- VL (Shortened Vertex List): The optimized list of vertices that are actually used in the facet list.
- FL (Shortened and Sorted Facet List): The updated list of facets, sorted and referencing the new vertex list.
- n: The number of vertices removed from the original list.
Algorithm Steps
- Initialize the threshold
thr to 1e-12, unless a different value is provided.
- Check if the facet list
FL is empty. If so, return the original vertex list OVL, an empty facet list, and n=0.
- Check if the original vertex list
OVL is empty. If so, return empty lists for both vertices and facets, and n=0.
- Round the original vertex list
OVL using the threshold thr to reduce precision errors.
- Use the
unique function to remove duplicate vertices, maintaining the original order ('stable').
- Update the facet list
FL to reference the new, unique vertex indices.
- Call
VLFLselect to further refine the vertex and facet lists by removing any redundant points.
- Ensure the facet list
FL is a row vector if it contains only one column.
- Calculate
n as the difference in the number of vertices between the original and the shortened list.
- If no output arguments are specified, plot the resulting geometry using
VLFLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 07:41. (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