VLFLshort

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.0, Creation date: 2012-04-19, Last change: 2025-09-14

shortens a vertex list to the vertices that are really used in the facet list

Description

For color support use VLFLcolcat2 and VLFLshort
Used for example in VLOLwriteSTLb. Returns a shortened vertex list that does not contain vertices which are not used in FL. All unused vertices are eliminated. In addition FL is also shortened in case that a facet is zero.

See Also: VLFLshort2 , VLFLcat , VLFLcat2 , SGcat2 , SGShort

Example Illustration

 missing image of VLFLshort(VL,FL)

Syntax

[SVL,SFL]=VLFLshort(VL,FL)

Input Parameter

VL: Original vertex list
FL: Original facet list

Output Parameter

SVL: Shortend vertex list
SFL: Shortend and sorted facet list




Copyright 2012-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 is designed to shorten a vertex list (VL) to only include vertices that are actually used in a facet list (FL). It also shortens the facet list by removing any zero facets.

Input Parameters

Output Results

Algorithm Steps

  1. Determine which vertices in VL are used in FL using the ismember function. This creates a logical index (XL) of used vertices.
  2. Create the shortened vertex list (SVL) by selecting only the rows in VL that correspond to used vertices, ensuring uniqueness and stability in order.
  3. Map the original facet list (FL) to the new indices in SVL to create the shortened facet list (SFL).
  4. Sort the shortened facet list (SFL) using the FLsort function.
  5. If SFL is empty, set SVL to an empty array and exit the function.
  6. Check if the vertex [0 0 0] is present in SVL and whether it is used in SFL.
  7. If [0 0 0] is present but not used, remove it from SVL and adjust SFL indices accordingly.
Algorithm explaination created using ChatGPT on 2025-08-19 07:28. (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