CPLflipud(CPL)
CPL : | Closed Polygon Line; contours separated by nan nan |
CPLflipud(CPLsample(13))
CPLflipud(flipud(CPLsample(13)))
This function, CPLflipud
, is designed to flip the order of points in each contour of a Closed Polygon Line (CPL) without altering the sequence of the contours themselves. Below is a detailed explanation of the algorithm and its parameters:
nan nan
values. This input represents a series of points that form closed shapes, with each shape separated by nan
values.separateNaN
function. This function counts how many distinct contours are present by identifying the nan nan
separators.CPLN
to preserve the original data.n
, where n
is the number of contours identified).selectNaN
is used to extract the specific contour from CPLN
.flipud
function, which reverses the order of the points in the contour.CPLN
at the same position using the replaceNaN
function.nargout==0
), the function calls CPLisccw
to check the orientation of the contours and textCVL
to display the contours.This function is part of the SolidGeometry library and was introduced in version 4.7. It is specifically designed to handle closed polygon lists, ensuring that the orientation of each contour is flipped without altering the overall structure of the CPL.
Algorithm explaination created using ChatGPT on 2025-08-18 23:30. (Please note: No guarantee for the correctness of this explanation)