CPLisccw

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 2.0, Creation date: 2014-12-05, Last change: 2025-09-14

returns index list for CPL direction

Description

the same as ~ispolycw
This function is unchanged and valid even with the new polyshape concept

See Also: CPLisccwinout , CPLsortinout , CPLisccwcorrected , CPLsetallcw

Example Illustration

 missing image of CPLisccw(CPL)

Syntax

[cwi,nani]=CPLisccw(CPL)

Input Parameter

CPL: CPL

Output Parameter

cwi: counter-clockwise index
nani: NAN-indices

Examples


CPLisccw(CPLsample(11))




Copyright 2014-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, CPLisccw, determines the counter-clockwise orientation of a closed polygonal line (CPL) and identifies any NaN indices within the input data.

Input Parameters

Output Results

Algorithm Steps

  1. Check if the input CPL is empty. If it is, set cwi to false and nani to an empty array, then return.
  2. Determine the orientation of the polygon using the ispolycw function from the Mapping Toolbox. The result is negated to get the counter-clockwise index cwi.
  3. Identify NaN indices in the first column of CPL to separate different polygonal segments. Store these indices in nani, including the start (0) and end (size of CPL + 1) indices.
  4. If no output arguments are specified, visualize the polygon:
Algorithm explaination created using ChatGPT on 2025-08-19 07:20. (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