BBofBB

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

scales an axis our bounding box

Description

if abs(d) > 1 then d consists of absolute values
if abs(d) < 1 then d consists of relative values


See Also: BBofCPL , BBofCPS , BBofPose , BBofPS , BBofSG , BBofT , BBofVL , BBofSGcutT

Example Illustration

 missing image of BBofBB(ax,d)

Syntax

nx=BBofBB([ax,d])

Input Parameter

ax: Bounding box
d: scaling vector

Output Parameter

nx: new exis

Examples


SGbox;ax=BBofBB(axis,0.1); axis(ax)
BBofBB('',0.1);




Copyright 2021-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, BBofBB, is designed to scale a bounding box by a specified scaling vector. It is part of the SolidGeometry library and was introduced in version 5.1. The function takes in two main parameters and returns a new bounding box.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the bounding box ax and scaling vector d from the input parameters using getfuncparams.
  2. Check the magnitude of d:
    • If abs(d) > 1, expand d to a three-element vector [d d d].
    • If abs(d) < 1, calculate the size of the bounding box using sofBB and scale d accordingly.
  3. Initialize nx with the value of ax. If ax has four elements, extend it to six elements by adding [-0.1, 0.1].
  4. Adjust the bounding box:
    • Subtract d from the minimum coordinates [1, 3, 5] of nx.
    • Add d to the maximum coordinates [2, 4, 6] of nx.
  5. If the original bounding box ax had four elements, truncate nx back to four elements.
  6. If no output is requested (nargout == 0), visualize the original and new bounding boxes:
    • Display the current figure using shg.
    • Set the title with SGtitle.
    • Create and plot the original bounding box in red using SGofBB and SGplotalpha.
    • Create and plot the new bounding box in green using SGofBB and SGplotalpha.
Algorithm explaination created using ChatGPT on 2025-08-19 00:44. (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