Syntax
SG=SGTtransR(SG,FN,R,[p])
Input Parameter
SG : | | Solid geometry |
FN : | | Frame name |
R : | | Rotation matrix |
p : | | translation vector |
Output Parameter
SG : | | SG with modified Frame |
Examples
SGTtransR(SGbox,'F',[0 pi/6 0])
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, SGTtransR
, is designed to rotate a specified frame of a solid geometry. It is part of the SolidGeometry library and is useful after cutting procedures.
Input Parameters
- SG: The solid geometry object that contains the frames to be manipulated.
- FN: The name of the frame within the solid geometry that is to be rotated.
- R: The rotation matrix that defines the rotation to be applied to the specified frame.
- p (optional): A translation vector that can be applied alongside the rotation. If not provided, it defaults to [0, 0, 0].
Output
- SG: The modified solid geometry object with the specified frame rotated and optionally translated.
Algorithm Steps
- Store the original solid geometry in
SGorg
for comparison purposes.
- Retrieve the translation vector
p
using the function getfuncparams
, which defaults to [0, 0, 0] if not provided.
- Identify the index
i
of the frame name FN
within the solid geometry's frame names SG.Tname
.
- Update the transformation matrix
SG.T{i}
for the specified frame by multiplying it with the transformation matrix generated by TofR(R, p)
, which combines the rotation and translation.
- If no output is requested (i.e.,
nargout == 0
), visualize the changes:
- Call
SGfigure
to set up the figure window with specified view angles.
- Use
SGplotalpha
to plot the solid geometry with a specified transparency.
- Plot the new frame using
SGTframeplot
with the label 'NEW'.
- Plot the original frame using
SGTframeplot
with the label 'ORG'.
Algorithm explaination created using ChatGPT on 2025-08-18 23:27. (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