Syntax
[CILC,VL,CIL]=CILofCVL(CPL)
Input Parameter
CPL : | | CLosed Polygon list CPL/CVL |
Output Parameter
CILC : | | Contour index list related to CPL |
VL : | | Vertex list without doubles and NaNs |
CIL : | | Contour index list related to VL |
Examples
[CILC,VL,CIL]=CILofCVL(CPLsample(26))
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 is designed to process a Closed Polygon List (CPL) and generate a Contour Index List (CIL) and a Vertex List (VL) without duplicates or NaN values. Below is a detailed explanation of the algorithm and its parameters.
Input Parameters
- CPL: A Closed Polygon List, which is a list of vertices that define one or more closed polygons.
Output Results
- CILC: Contour Index List related to the original CPL.
- VL: Vertex List without duplicate entries and NaN values.
- CIL: Contour Index List related to the processed Vertex List (VL).
Algorithm Steps
- Use the function
separateNaN(CPL)
to separate the CPL into segments, identifying NaN values that separate different contours. This function returns n
(number of contours) and a
(indices of NaN values).
- Calculate
CILC
by creating pairs of indices from a
that define the start and end of each contour in the CPL.
- Convert the CPL into a standard Polygon List (PL) using
PLofCPL(CPL)
.
- Repeat the separation process on the new PL to get updated
n
and a
values.
- Calculate
CIL
similarly to CILC
, using the updated indices.
- Generate
VL
by removing NaN values from the CPL using woNaN(CPL)
.
- Adjust
CIL
by subtracting a sequence of numbers from 0 to n-1
from each index pair, aligning it with the new vertex list.
- If no output arguments are specified, visualize the contours using
SGfigure
and CVLplot
functions, iterating over each contour and plotting it with a unique color.
Algorithm explaination created using ChatGPT on 2025-08-18 22:51. (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