Syntax
BBC=BBconcat(BBA,BBB)
Input Parameter
BBA : | | Bounding box B or solid A |
BBB : | | Bounding box B or solid A |
Output Parameter
BBC : | | New boundin box [xmin xmax ymin ymax zmin zmax] |
Examples
BBconcat(SGbox,SGtransP(SGbox,[0 0 30]))
Copyright 2022-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)
The function BBconcat
is designed to concatenate two bounding boxes, BBA
and BBB
, and produce a new bounding box BBC
that encompasses both input boxes.
Input Parameters
- BBA: A bounding box or a solid object. If it is a solid, it is converted to a bounding box using the function
BBofSG
.
- BBB: Another bounding box or solid object. Similarly, if it is a solid, it is converted to a bounding box using
BBofSG
.
Output
- BBC: The resulting bounding box, defined by the minimum and maximum extents in the x, y, and z dimensions: [xmin, xmax, ymin, ymax, zmin, zmax].
Algorithm Steps
- Store the original inputs
BBA
and BBB
in BBAorg
and BBBorg
for potential plotting later.
- Check if
BBA
is a solid object using isSG
. If true, convert it to a bounding box using BBofSG
.
- Check if
BBB
is a solid object using isSG
. If true, convert it to a bounding box using BBofSG
.
- Initialize
BBC
with the values of BBB
.
- Calculate the minimum values for
xmin
, ymin
, and zmin
by comparing the corresponding values of BBA
and BBB
.
- Calculate the maximum values for
xmax
, ymax
, and zmax
by comparing the corresponding values of BBA
and BBB
.
- If no output is requested (i.e.,
nargout==0
), plot the resulting bounding box and the original inputs using SGfigure
and SGplotalpha
functions.
Algorithm explaination created using ChatGPT on 2025-08-19 00:58. (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