SGfigtrans0

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - User interface
Introduced first in SolidGeometry 5.0, Creation date: 2020-09-24, Last change: 2025-09-14

moves all parts of the current axis into the first octand



See Also: SGtrans0

Example Illustration

 missing image of SGfigtrans0(cax)

Syntax

SGfigtrans0([cax])

Input Parameter

cax: default is gca

Examples


SGjacohand, axis on
SGfigtrans0




Copyright 2020-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, SGfigtrans0, is designed to move all graphical elements within the current axis into the first octant. It is part of the SolidGeometry library and was introduced in version 5.0.

Input Parameters

Algorithm Steps

  1. Retrieve the current axis using getfuncparams, which checks if an axis handle is provided in the input arguments. If not, it defaults to gca.
  2. Obtain the SolidGeometry (SG) object associated with the current axis using SGofgca.
  3. Calculate the bounding box of the SG object using BBofSG. This returns a vector bb containing the minimum and maximum coordinates in each dimension.
  4. Determine the offset required to move the SG object into the first octant. This offset is the negative of the minimum coordinates in each dimension, stored in the vector offset.
  5. Find all graphical objects of type 'patch' within the current axis using findobj. For each patch object, adjust its vertices by subtracting the offset vector.
  6. Find all graphical objects of type 'Text' within the current axis. For each text object, adjust its position by subtracting the offset vector.
  7. Find all graphical objects of type 'Line' within the current axis. For each line object, adjust its XData, YData, and ZData by subtracting the corresponding components of the offset vector.
  8. Optionally, the function can update the display with drawnow and set the view to a top-down perspective with view(0,90). However, these lines are commented out.
  9. Finally, the axis is set to 'tight' to fit the adjusted graphical elements.
Algorithm explaination created using ChatGPT on 2025-08-18 23:33. (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