CPSouterboundary

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.5, Creation date: 2019-02-11, Last change: 2025-09-14

returns the outer boundary as CPS or polyshape



See Also: CPSplot

Example Illustration

 missing image of CPSouterboundary(CPS)

Syntax

CPSN=CPSouterboundary(CPS)

Input Parameter

CPS: CPS or polyshape

Output Parameter

CPSN: CPS or polyshape of outer boundary




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, CPSouterboundary, is designed to compute the outer boundary of a given closed polygon list (CPS) or polyshape. It was introduced in SolidGeometry 4.5 and is part of the SG-Library.

Input Parameters

Output Results

Algorithm Steps

  1. Check if the input CPS is numeric. If it is, convert it to a polyshape using polyshape(CPS,'simplify',false).
  2. Determine if CPS has a field named ps. If it does, assign ps = CPS.ps. If not, compute ps using PSregions(CPS).
  3. Sort the boundaries of ps by area in descending order using sortboundaries(ps,'area','descend').
  4. Iterate over each element in ps:
  5. Check if CPS has a field named ps. If it does, assign CPSN = CPS and update CPSN.ps = ps. If not, set CPSN = ps.
  6. If no output argument is specified (nargout == 0), plot the result:
Algorithm explaination created using ChatGPT on 2025-08-18 23:20. (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