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
- CPL: The closed polygon list to be decomposed.
- da: The angle threshold for decomposition. The default value is Ã/6.
- mix: A boolean flag. If true, the decomposition starts with the segment containing the minimum x and y coordinates. The default is true.
Output
- SIL: The Separation Index List, which indicates the segments of the CPL.
Algorithm Steps
- Retrieve the angle threshold
da
and the mix
flag from the input parameters using getfuncparams
.
- Use
separateNaN
to separate the CPL into segments, storing the number of segments in n
and their indices in a
.
- Initialize the
SIL
array with NaN values, having the same number of rows as the CPL and two columns.
- Iterate over each segment of the CPL:
- Determine the indices
il
for the current segment.
- Decompose the segment using
PLdecompose
with the specified angle da
and mix
flag, storing the result in SIL
.
- If no output is requested (
nargout==0
), visualize the decomposition:
- Initialize a figure with
SGfigure
.
- For each segment, plot the points and lines using
CPLplot
and PLplot
.
- Label each segment with
textVL
.
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