Syntax
CVL=CVLofVLEL(VL,EL,[rem])
Input Parameter
VL : | | Vertex List |
EL : | | Edge list |
rem : | | if true; remeshing using CPLofPLEL / ELofELmesh; default is true |
Output Parameter
CVL : | | closed polygon vertex list |
Examples
[VL,EL]=VLELofCVL(VLsample(18)); CVLofVLEL(VL,EL)
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 function, CVLofVLEL
, is designed to generate a closed polygon vertex list (CVL) from a given vertex list (VL) and edge list (EL). It is part of the SG-Library and was originally developed by Tim Lueth.
Input Parameters
- VL: The Vertex List, which is a matrix where each row represents a vertex in the polygon.
- EL: The Edge List, which is a matrix where each row represents an edge by specifying two indices of vertices from the VL.
- rem: An optional boolean parameter. If set to true, the function performs remeshing using
CPLofPLEL
or ELofELmesh
. The default value is true.
Output
- CVL: The Closed Polygon Vertex List, which is a matrix representing the vertices of the closed polygon.
Algorithm Steps
- The function begins by determining the value of the
rem
parameter using getfuncparams
. If rem
is not provided, it defaults to true.
- If
rem
is true, the function calls CPLofPLEL
with VL
and EL
to perform remeshing and generate the closed polygon vertex list.
- If
rem
is false, the function executes the following steps:
- Appends a row of NaN values to
VL
to act as a separator.
- Calculates the new number of vertices,
nv
, as the number of rows in VL
.
- Appends a column of
nv
to EL
, effectively closing the polygon by connecting the last vertex to the first.
- Generates
CVL
by indexing into VL
using the modified EL
.
- If no output is requested (
nargout == 0
), the function visualizes the closed polygon using SGfigure
and CVLplots
.
Example Usage
An example of how to use this function is provided: [VL,EL]=VLELofCVL(VLsample(18)); CVLofVLEL(VL,EL)
.
Algorithm explaination created using ChatGPT on 2025-08-19 00:38. (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