Syntax
[FL,n,dn]=FLsort(FL)
Input Parameter
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
- FL: The original facet list, which is a matrix where each row represents a facet defined by three vertex indices.
Output Results
- FL: The optimized facet list with degenerated facets removed.
- n: The length of the optimized facet list.
- dn: The number of removed degenerated or doubled facets.
Algorithm Steps
- Check the number of columns in FL. If there is only one column, transpose FL, set n to 1, dn to 0, and return.
- 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.
- For each facet in FL, find the smallest vertex index. Reorder the vertices in the facet so that the smallest index is first.
- 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].
- Remove duplicate rows from FL using the 'unique' function. If the first row is [0 0 0], remove it.
- Calculate the new number of facets (n) and the number of removed facets (dn).
- 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