sortFL

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

returns a sorted and circular shifted facet list (see FLsort)

Description

This function ensures that the first index of a facet list column is always smaller than the 2nd and 3rd. The rows are circular shifted and rotated to achieve that. Fast implementation. Developed a second time but this time much faster than FLsort

Example Illustration

 missing image of sortFL(XFL)

Syntax

XFL=sortFL(XFL)

Input Parameter

XFL: Facet list

Output Parameter

XFL: 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 sort and circularly shift a facet list, ensuring that the first index of each facet list column is always the smallest. The process involves checking conditions and rearranging the rows accordingly.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize three logical arrays, a, b, and c, to determine the smallest index in each row of XFL:
    • a: True if the first index is the smallest.
    • b: True if the second index is the smallest.
    • c: True if the third index is the smallest.
  2. Rearrange the rows of XFL based on the conditions:
    • Rows where a is true remain in the order [1 2 3].
    • Rows where b is true are circularly shifted to [2 3 1].
    • Rows where c is true are circularly shifted to [3 1 2].
  3. Concatenate the rearranged rows to form the new XFL.
  4. Sort the rows of XFL using sortrows to ensure the entire list is ordered.
Algorithm explaination created using ChatGPT on 2025-08-18 23:59. (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