BBofCPS

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Geometric Queries
Introduced first in SolidGeometry 4.5, Creation date: 2019-02-12, Last change: 2025-09-14

returns the bounding box for a polyshape or CPS



See Also: CPLofBB , BBofVL , BBofSG , BBofCPL , BBofPS , BBofPose , BBofT

Example Illustration

 missing image of BBofCPS(CPS)

Syntax

bb=BBofCPS(CPS)

Input Parameter

CPS: Colored polyshape struct or polyshape

Output Parameter

bb: bounding box

Examples


ps=polyshape(PLcircle(10)), BBofCPS(ps)




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, BBofCPS, calculates the bounding box for a given polyshape or a colored polyshape struct (CPS). The function is part of the SolidGeometry library and was introduced in version 4.5.

Input Parameters

Output Results

Algorithm Steps

  1. The function first checks if the input CPS is a struct with a field named 'ps'. If so, it assigns the value of CPS.ps to the variable ps. Otherwise, it assigns CPS directly to ps.
  2. It then calculates the bounding box of the polyshape ps using the boundingbox function. This function returns two values, a and b, which represent the coordinates of the bounding box.
  3. The bounding box coordinates are combined into a single vector bb as [a b].
  4. If no output is requested (i.e., nargout==0), the function proceeds to visualize the results:

Example Usage

An example of how to use the function is provided:

ps = polyshape(PLcircle(10));
BBofCPS(ps);

This example creates a polyshape of a circle with a radius of 10 and calculates its bounding box using the BBofCPS function.

Algorithm explaination created using ChatGPT on 2025-08-18 22:49. (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