Syntax
ELD=ELdirectVLEL(VL,EL)
Input Parameter
VL : | | Vertex list |
EL : | | Facet list |
Output Parameter
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 processes a list of vertices and edges to ensure that all contours have the same direction, following the right-hand rule. It is part of the SG-Library and was developed by Tim Lueth in 2013.
Input Parameters
- VL: Vertex list, which contains the coordinates of the vertices.
- EL: Facet list, which contains the edges defined by pairs of vertex indices.
Output
- ELD: Directed edge list, where all contours have the same direction.
Algorithm Steps
- Generate a contour index list (CIL) from the edge list (EL) using the function
CILofEL(EL)
.
- Determine the number of contours
nC
using the size of CIL.
- Calculate the transformation matrix
TO
for the first contour using the function TofPCVL
on the vertices of the first contour.
- Select and transform the vertex list
VL
and edge list EL
using VLELselect
and VLtransT
with the inverse of TO
.
- Extract the 2D coordinates
PLx
from the transformed vertex list.
- For each contour
i
from 1 to nC
:
- Extract the points
pl
of the current contour using EofELCIL
.
- Calculate the cross product
s
of the vectors formed by the first three points of the contour.
- If
s
is positive, swap the direction of the edges in the current contour using ELswap
.
- Return the directed edge list
ELD
by applying the selection index SI
to the modified edge list ELx
.
Algorithm explaination created using ChatGPT on 2025-08-19 00: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