CELofEL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - EL/Edge Lists
Introduced first in SolidGeometry 3.8, Creation date: 2017-04-07, Last change: 2025-09-14

returns a corrected succeding EL for a single contour

Description

branches are not alloweed, i.e.
- two terminals and m links
- or n links

See Also: treeNodesofEL

Example Illustration

 missing image of CELofEL(EL)

Syntax

[CEL,CHN]=CELofEL(EL)

Input Parameter

EL: unsorted but correct edge list

Output Parameter

CEL: Sorted Edge list of Contour or Line of Nodes
CHN: Chain [n x 1] with nodes

Examples


CELofEL([100 1; 100 2; 3 2; 1 3])




Copyright 2017-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 processes an unsorted edge list (EL) to produce a sorted edge list (CEL) and a chain of nodes (CHN) for a single contour without branches.

Input Parameters

Output Results

Algorithm Steps

  1. Call the function treeNodesofEL(EL) to obtain node information: vi (valid nodes), bi (branch nodes), and ti (terminal nodes).
  2. Check for branches using bi. If branches exist, plot the edge list and raise an error, as branches are not allowed.
  3. If there are no valid nodes (vi is empty), return empty CEL and CHN.
  4. Initialize CEL as a NaN matrix with the same size as EL and determine the number of edges ne.
  5. Determine the starting node si. If terminal nodes exist, use the first terminal node; otherwise, use the first valid node.
  6. Iterate over each edge (from 1 to ne):
  7. Construct the chain of nodes CHN by concatenating the first column of CEL with the last node of the last edge in CEL.
  8. If no output arguments are specified, display the original edge list OEL and the transposed chain of nodes CHN.
Algorithm explaination created using ChatGPT on 2025-08-19 01:09. (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