PSregions

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.4, Creation date: 2018-12-30, Last change: 2025-08-19

returns the regions of a polyshape

Description

This function extends the concept of regions of a polyshape which is available only for scalar polyshapes to arrays and cells of polyshape.
SGfigure; CPLplotasPS(CPLsample(14)); ps=PSofgca; ps=regions(ps), r=regions(ps) % fails!
create polyshape arrays:

See Also: PSofgca

Example Illustration

 missing image of PSregions(PS)

Syntax

PSR=PSregions(PS)

Input Parameter

PS:

Output Parameter

PSR:

Examples


SGfigure; CPLplotasPS(CPLsample(14)); ps=PSofgca; ps=regions(ps) % array of polyshape
ps, ps=regions(ps); % fails
ps=PSregions(ps) % works




Copyright 2018-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, PSregions, is designed to handle polyshape objects in MATLAB, specifically extending the concept of regions for polyshape arrays and cells. Below is a detailed explanation of the algorithm and its parameters.

Input Parameters

Output Results

Algorithm Steps

  1. Check if ps is numeric. If true, convert it to a polyshape object without simplification.
  2. Check if ps is a polyshape object:
  3. Check if ps is a cell array:
  4. If no output argument is specified, plot the regions using SGfigure and CPSplot.
Algorithm explaination created using ChatGPT on 2025-08-19 07:24. (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