CPLoutlinecontour
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.9.1, Creation date: 2020-08-29, Last change: 2025-09-14
just returns ALL OUTLINE contours
Description
The functions are based on the planar CPLfunctions
- CPLconvexhullfillgap - closes gaps and try to find a SINGLE OUTLINE contour
- CPLoutlinecontour - just returns ALL OUTLINE contours
- CPLfillgap -just fillgapsb etween contours
Mainly the same as CPLselectinout(CPL,0) but the name is easier to find than CPLselectinout. Simon Schiele noticed it. Nevertheless CPLselectinout is more powerful!
In contrast to CPLfillgap (Which returns always just ONE outline contour) this function will return the outmost contours of the CPL (level 0)
See Also: CPLselectinout
, CPLfillgap
, CPLconvexhullfillgap
Example Illustration
Syntax
CPLN=CPLoutlinecontour(CPL)
Input Parameter
CPL: | | CPL consisting of severalcontours |
Output Parameter
Examples
CPLoutlinecontour(CPLsample(14))
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, CPLoutlinecontour, is designed to process a Closed Polygon List (CPL) and return the outermost contours of the CPL. It is part of the SolidGeometry library and was introduced in version 5.0.
Input Parameters
- CPL: A matrix representing several contours, where each row corresponds to a point in 2D space (x, y).
Output Results
- CPLN: A new CPL containing only the outermost contours of the input CPL.
Algorithm Steps
- The function begins by ensuring that the input CPL only contains the first two columns, which represent the x and y coordinates of the points.
- It then calls the function
CPLselectinout with the input CPL and a parameter of 0. This function is responsible for selecting the outermost contours from the CPL.
- If no output arguments are specified (i.e.,
nargout==0), the function will plot the results using the SGfigure and CPLplot functions. The original CPL is plotted in red, and the resulting outermost contours are plotted in green.
Example Usage
An example call to this function is CPLoutlinecontour(CPLsample(14)), which processes a sample CPL and returns its outermost contours.
Related Functions
- CPLselectinout: A more powerful function for selecting in and out contours.
- CPLfillgap: Fills gaps between contours and returns a single outline contour.
- CPLconvexhullfillgap: Closes gaps and attempts to find a single outline contour.
Algorithm explaination created using ChatGPT on 2025-08-19 07:00. (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