CELflip

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.1, Creation date: 2013-08-13, Last change: 2025-09-14

Flips orientation of contour edge list

Description

Work similar to ELflip but handles the invidiual subsequent contours in the contour edge list independently

Example Illustration

 missing image of CELflip(CEL)

Syntax

CEL=CELflip(CEL)

Input Parameter

CEL: Contour edge list

Output Parameter

CEL: Contour edge list flipped

Examples


CEL=[1 2;2 3;3 4;4 1;5 6; 6 7;7 8;9 5]
[CEL CELflip(CEL)]




Copyright 2013-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 flip the orientation of a contour edge list (CEL). It processes each individual contour within the list independently.

Input Parameters

Output

Algorithm Steps

  1. Initialize variables: Determine the number of rows in CEL (n) and set the index (i) to 1. Create an empty matrix CIL to store contour indices.
  2. Identify Contours: Use a while loop to iterate through CEL. For each edge, find the end index (e) where the second column matches the start of the current edge. Append the start and end indices of each contour to CIL. Increment i to e+1 to move to the next contour.
  3. Flip Contours: Determine the number of contours (n) from CIL. For each contour, use the ELflip function to reverse the order of edges within the contour, updating CEL accordingly.
Algorithm explaination created using ChatGPT on 2025-08-18 22:34. (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