SGorder
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 2.0, Creation date: 2014-12-20, Last change: 2025-09-14
reorders the triangle facets to individual solids
Description
Equivalent to TRorder but on facet level (one day may be fused). Improved in comparision with VLFLseparate.
All surface facets of a solid use the same points. In case that a solid geometry has a facet list that in fact is separated into several solids, this functions reorders the facet list to connected surfaces and returns also a list with starting facet and end facet of the list.
See Also: ELorder
, FLorder
, FLseparate
, TRorder
, SGseparate
Example Illustration
Syntax
[SG,SIL]=SGorder(SG)
Input Parameter
SG: | | Solid geometry whose facet list consisting of several solids |
Output Parameter
SG: | | Solid geometry whose facet list consisting of several solids |
SIL: | | Solid index list (start and end-facet) in facet list |
Examples
Separate the surface of SGsample(13)
SGsample(13);[a,b]=SGorder(SGsample(13)); b
Copyright 2014-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 reorder the triangle facets of a solid geometry (SG) into individual connected surfaces. It processes the facet list of a solid geometry, which may consist of several disconnected solids, and organizes them into separate connected surfaces. The algorithm returns the reordered solid geometry and a solid index list indicating the start and end facets of each connected surface.
Input Parameters
- SG: A solid geometry object whose facet list may consist of several disconnected solids.
Output Results
- SG: The reordered solid geometry with facets organized into connected surfaces.
- SIL: A solid index list indicating the start and end facets of each connected surface in the facet list.
Algorithm Steps
- Extract the facet list (FL) from the input solid geometry (SG).
- Initialize variables:
nc as the number of facets, k as the starting index for reordering, FLN as a zero matrix to store the reordered facets, and SIL as a zero matrix to store the start and end indices of each connected surface.
- Initialize a counter
i to track the number of connected surfaces.
- While there are facets remaining in
FL:
- Increment the surface counter
i.
- Select the first facet's first vertex as the starting point
a.
- Iteratively find all connected vertices to
a until no new vertices are found.
- Identify all facets that are fully connected to the vertices in
a.
- Update
SIL with the start and end indices of the current connected surface.
- Store the connected facets in
FLN and remove them from FL.
- Trim
SIL to the number of identified connected surfaces.
- Update the solid geometry
SG with the reordered facet list FLN.
Algorithm explaination created using ChatGPT on 2025-08-19 07:30. (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