CPLregions

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 5.1, Creation date: 2021-08-05, Last change: 2025-09-15

sorts a CPL with respect to regions

Description

mainly same as CPLsortinout

See Also: CPLsortinout , CPLselectinout

Example Illustration

 missing image of CPLregions(CPL)

Syntax

[CPLN,PiL]=CPLregions(CPL)

Input Parameter

CPL: Closed Polygon Line

Output Parameter

CPLN: Sorten to regions
PiL: [parent-index of CPLN, region leve, 0 = outsidel]

Examples


CPLregions(CPLsample(27));




Copyright 2021-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, CPLregions, is designed to sort a Closed Polygon Line (CPL) with respect to regions. It is part of the SolidGeometry library and was introduced in version 5.1. The function primarily relies on another function, CPLsortinout, to perform its operations.

Input Parameters

Output Results

Algorithm Steps

  1. The function first checks if the input CPL is empty. If it is, the function returns empty arrays for both CPLN and PiL.
  2. If CPL is not empty, the function calls CPLsortinout to sort the CPL into regions. The sorted CPL is stored in CPLN.
  3. If the number of output arguments requested is greater than one, the function calls CPLsortinout again to obtain the parent index list PiL.
  4. If no output arguments are requested, the function visualizes the CPL using SGfigure, CPLplotcolors, and textCPL functions.

Example Usage

The function can be called with a sample CPL as follows:

CPLregions(CPLsample(27));
Algorithm explaination created using ChatGPT on 2025-08-18 23:06. (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