CPLofCPS
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.5, Creation date: 2019-03-03, Last change: 2025-09-14
returns a CPL from a CPS or an array of polyshapes
Description
same as CPLofpolyshape.
All polyshape functions will be replaced by CPS function to support (CPL,CPLS, polyshape and polygons)
See Also: CPLofpolyshape
Example Illustration
Syntax
CPL=CPLofCPS(CPS);
Input Parameter
Output Parameter
Copyright 2019-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, CPLofCPS, is designed to convert a CPS (Closed Polygon Structure) or an array of polyshapes into a CPL (Closed Polygon List). It is part of the SolidGeometry library and was introduced in version 4.5.
Input Parameters
- CPS: This can be a CPS structure or a polyshape. The function checks if the input is a structure with a field named 'ps'. If so, it extracts this field; otherwise, it assumes the input is already a polyshape.
Output Results
- CPL: The output is a Closed Polygon List (CPL) derived from the input CPS or polyshape.
Algorithm Steps
- Check if the input
CPS has a field named 'ps'.
- If the field 'ps' exists, assign its value to the variable
ps.
- If the field 'ps' does not exist, assign the input
CPS directly to ps.
- Call the function
CPLofpolyshape with ps as the argument to convert it into a CPL.
- If no output is requested (i.e.,
nargout == 0), call CPLofpolyshape with the original CPS to perform the conversion without returning a value.
This function is part of a transition from using polyshape functions to CPS functions to support various polygon representations, including CPL, CPLS, polyshape, and polygons.
Algorithm explaination created using ChatGPT on 2025-08-18 22:34. (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