FLsort

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Problems Find/Check/Fix
Introduced first in SolidGeometry 1.0, Creation date: 2012-04-21, Last change: 2025-09-14

Sorts FL by smallest vertex index and removes(!) degenerated facets

Description

This procedure is called by VLFLvertexfusion to remove the facets that are degenerated because of fused vertices.

See Also: SGfixerrors

Example Illustration

 missing image of FLsort(FL)

Syntax

[FL,n,dn]=FLsort(FL)

Input Parameter

FL: Original facet list

Output Parameter

FL: Optimized facet list
n: length of FL
dn: number of removed degenerated or doubled facets

Examples


load JACO_robot.mat
FLsort(JC01.VL)




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 sort a list of facets (FL) by the smallest vertex index and remove degenerated facets. It is part of the SG-Library and was created by Tim Lueth. The function is used to clean up facet lists by removing facets that have become degenerate due to vertex fusion.

Input Parameters

Output Results

Algorithm Steps

  1. Check the number of columns in FL. If there is only one column, transpose FL, set n to 1, dn to 0, and return.
  2. Check the number of rows in FL. If there are no rows, set FL to an empty array, n to 0, dn to 0, and return.
  3. For each facet in FL, find the smallest vertex index. Reorder the vertices in the facet so that the smallest index is first.
  4. For each facet, check if any two vertices are the same. If so, mark the facet as degenerate by setting it to [0 0 0].
  5. Remove duplicate rows from FL using the 'unique' function. If the first row is [0 0 0], remove it.
  6. Calculate the new number of facets (n) and the number of removed facets (dn).
  7. If any facets were removed, print a message indicating how many were removed.
Algorithm explaination created using ChatGPT on 2025-08-19 01:43. (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