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
- SG: The solid geometry object that needs to be transformed.
- z0: An optional parameter. If provided, it sets the minimal z value for the transformation. If z0 is a scalar, it is converted into a vector with the form [-ss(1)/2, -ss(2)/2, z0], where ss is the size of the bounding box of SG.
Output Results
- SGN: The resulting geometry after the transformation, with all frames modified to move the center to the origin.
Algorithm Steps
- Calculate the size (ss) and center point (cp) of the bounding box of the solid geometry SG using the function sofBB.
- 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].
- 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.
- Calculate the transformation matrix T using the function TofP with the adjusted center point cp.
- Apply the inverse of the transformation matrix T to the solid geometry SG using the function SGtransT to obtain the transformed geometry SGN.
- 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