CPLN=CPL2cw(CPL)
CPL : | CPL with nested CPLS |
CPLN : | CPL with nested CPLS all in cw |
SGfigure; CPLplotcwccw(CPLsample(44))
SGfigure; CPLplotcwccw(CPL2cw(CPLsample(44)))
SGfigure; CPLplotcwccw(CPLCPL2ccwinvert(CPLsample(4)))
SGfigure; CPLplotcwccw(CPLinvert(CPLsample(44)))
This function, CPL2cw
, is designed to change the orientation of all nested closed polygon lists (CPLs) to clockwise (cw). It is part of the SolidGeometry library and was introduced in version 5.5.
poly2cw
function, which takes the x and y coordinates of the CPL and returns them oriented in a clockwise direction. The output is stored in variables x
and y
.CPLN
by combining the x
and y
vectors into a two-column matrix.nargout==0
), the function will plot the resulting CPLN using the SGfigure
and CPLplotcolors
functions. The plot is displayed with a red star marker and line style ('r*-').The function can be called with a sample CPL as follows:
CPL2cw(CPLsample(44))
This will convert the orientation of the CPL sample with ID 44 to clockwise.
Algorithm explaination created using ChatGPT on 2025-08-18 22:41. (Please note: No guarantee for the correctness of this explanation)