SGTtrans0

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 5.0, Creation date: 2021-01-31, Last change: 2025-09-15

move the center of the solid into the origin of the coordinate system

Description

Should better be intergrated into SGtrans0

See Also: SGtrans0

Example Illustration

 missing image of SGTtrans0(SG,z0)

Syntax

SGN=SGTtrans0(SG,[z0])

Input Parameter

SG: Solid Geoemtry
z0: if used, the minimal z value is this paremter z0

Output Parameter

SGN: Resulting Geometry with all frames modified

Examples


SGTtrans0(SGbox,100)




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, SGTtrans0, is designed to move the center of a solid geometry (SG) to the origin of the coordinate system. It is part of the SolidGeometry library and was introduced in version 5.0. The function takes in a solid geometry object and an optional parameter z0, which specifies the minimal z value.

Input Parameters

Output Results

Algorithm Steps

  1. Calculate the size (ss) and center point (cp) of the bounding box of the solid geometry SG using the function sofBB.
  2. Check if z0 is provided and is a scalar. If so, convert it into a vector with the form [-ss(1)/2, -ss(2)/2, z0].
  3. If z0 is not empty, adjust the center point cp by subtracting half the size of the bounding box and the z0 vector from it.
  4. Calculate the transformation matrix T using the function TofP with the adjusted center point cp.
  5. Apply the inverse of the transformation matrix T to the solid geometry SG using the function SGtransT to obtain the transformed geometry SGN.
  6. If no output is requested (nargout==0), plot the original and transformed geometries using SGfigure, SGplotalpha, and SGTplotalpha for visualization.
Algorithm explaination created using ChatGPT on 2025-08-18 23: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