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