CILofCVL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 3.9, Creation date: 2017-06-10, Last change: 2025-09-14

creates a Contour index list for a CPL/CVL



See Also: CVLofVLCIL

Example Illustration

 missing image of CILofCVL(CPL)

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

Output Results

Algorithm Steps

  1. 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).
  2. Calculate CILC by creating pairs of indices from a that define the start and end of each contour in the CPL.
  3. Convert the CPL into a standard Polygon List (PL) using PLofCPL(CPL).
  4. Repeat the separation process on the new PL to get updated n and a values.
  5. Calculate CIL similarly to CILC, using the updated indices.
  6. Generate VL by removing NaN values from the CPL using woNaN(CPL).
  7. Adjust CIL by subtracting a sequence of numbers from 0 to n-1 from each index pair, aligning it with the new vertex list.
  8. 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