Syntax
bb=BBofPose(PS)
Input Parameter
Output Parameter
bb : | | bb [xmin xmax ymin ymax] |
Examples
BBofPose(Posesample(7)); Poseplot(Posesample(7));
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, BBofPose
, calculates the bounding box of a given pose. The function is part of the SG-Library and was introduced in SolidGeometry 4.5. It is designed to work with closed polygon lines (CPL).
Input Parameters
- PS: A structure representing a closed polygon line. It should contain fields such as
CPLE
and A
.
- varargin: Additional optional parameters that can be passed to the function.
Output Results
- bb: A vector representing the bounding box in the format
[xmin xmax ymin ymax]
.
Algorithm Steps
- Check if the field
CPLE
exists in the input structure PS
. If it does not exist or is empty, initialize it with a square polygon using the function PLsquare
with parameters (1, 0.5)
.
- Determine the number of poses
np
by checking the number of rows in PS.A
.
- Calculate the transformation matrix
T
for the pose using the function TofPose
.
- Initialize a matrix
CPL
to store transformed polygon lines. The size is determined by the number of points in PS.CPLE
plus one, and the number of poses.
- Iterate over each transformation matrix
T(:,:,i)
and apply it to PS.CPLE
using the function PLtransT
. Store the result in CPL
.
- If the field
CPLB
exists in PS
, append it to CPL
.
- Calculate the bounding box
bb
using the function BBofCPL
with CPL
and any additional parameters from varargin
.
- If no output is requested, plot the transformed polygon lines and the bounding box using
SGfigure
, CPLplot
, and CPLofBB
.
Algorithm explaination created using ChatGPT on 2025-08-19 00:16. (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