FLorder

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 2.1, Creation date: 2015-01-11, Last change: 2025-09-14

returns a shifted and ordered facet list

Description

The facet list is rotated line by line so that the smallest vertex index is in the left column.

In contrast to FLshift, by using FLorder the facet list is sorted by increasing numbers of column sortrows(FL,[1 2 3]).

See Also: ELorder , FLseparate , TRorder , SGorder , SGseparate

Example Illustration

 missing image of FLorder(FL)

Syntax

FL=FLorder(FL)

Input Parameter

FL: Original facet list

Output Parameter

FL: Final facet list

Examples


FL=[10 20 30; 30 10 20; 20 30 10]
FL=[FL*1.5;FL]
FLorder(FL)




Copyright 2015-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 process a facet list (FL) by rotating and sorting it. The goal is to ensure that each row in the facet list is ordered such that the smallest vertex index is in the first column, and the entire list is sorted in ascending order based on the vertex indices.

Input Parameters

Output Results

Algorithm Steps

  1. For each row in the facet list, check if the first vertex index is greater than the second. If true, rotate the row so that the second index becomes the first, the third becomes the second, and the first becomes the third. This is done using the operation: FL(FL(:,1)>FL(:,2),:)=FL(FL(:,1)>FL(:,2),[2 3 1]);
  2. Repeat the check for the first vertex index against the third. If the first index is greater than the third, rotate the row similarly: FL(FL(:,1)>FL(:,3),:)=FL(FL(:,1)>FL(:,3),[3 1 2]);
  3. Perform the first check again to ensure all rows are correctly rotated: FL(FL(:,1)>FL(:,2),:)=FL(FL(:,1)>FL(:,2),[2 3 1]);
  4. Sort the entire facet list in ascending order based on the vertex indices using the sortrows function: FL=sortrows(FL);

Example

Given a facet list FL = [10 20 30; 30 10 20; 20 30 10], the algorithm will process it to ensure each row is ordered with the smallest index first and then sort the entire list. The result will be a sorted and ordered facet list.

Algorithm explaination created using ChatGPT on 2025-08-18 23:11. (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