CPLdecompose

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

returns a list of contour segments that belong to the same angle segment

Description

still weak for contours with no auxiliary points

See Also: PLdecompose , PLconvexseg , CPLconvexseg

Example Illustration

 missing image of CPLdecompose(CPL,da,mix)

Syntax

SIL=CPLdecompose(CPL,[da,mix])

Input Parameter

CPL: CPL
da: angle; default si pi/6
mix: if true; minxy is used to start with segment 1

Output Parameter

SIL: Separation Index List

Examples


CPLdecompose(CPLaddauxpoints(CPLsample(14),1),pi);
CPLdecompose(CPLaddauxpoints(CPLsample(6),0.1),pi/2)




Copyright 2020-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, CPLdecompose, is designed to decompose a closed polygon list (CPL) into segments based on angle criteria. It is part of the SolidGeometry library and was introduced in version 5.0.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the angle threshold da and the mix flag from the input parameters using getfuncparams.
  2. Use separateNaN to separate the CPL into segments, storing the number of segments in n and their indices in a.
  3. Initialize the SIL array with NaN values, having the same number of rows as the CPL and two columns.
  4. Iterate over each segment of the CPL:
  5. If no output is requested (nargout==0), visualize the decomposition:
Algorithm explaination created using ChatGPT on 2025-08-19 07:52. (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