Syntax
SG=SGTduplicateframe(SG,FN,DN,[flip])
Input Parameter
SG : | | Solid |
FN : | | Frame Name |
DN : | | Duplicated Name |
flip : | | if true; fliped around y, align to match |
Output Parameter
SG : | | Solid with additional duplicated Frame |
Examples
A=SGbar([10 5 10]);
A=SGTset(A,'B',TofFS(A,[0 1 0]));
SGTduplicateframe(A,'B','New')
SGTduplicateframe(A,'B','New',true)
Copyright 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 duplicates a frame within a solid geometry object, potentially flipping it around the y-axis.
Input Parameters
- SG: The solid geometry object that contains the frame to be duplicated.
- FN: The name of the frame within the solid geometry object that is to be duplicated.
- DN: The name for the new duplicated frame.
- flip: An optional boolean parameter. If true, the frame is flipped around the y-axis before duplication. Defaults to false if not provided.
Output
- SG: The solid geometry object with the additional duplicated frame.
Algorithm Steps
- Retrieve the 'flip' parameter from the variable arguments, defaulting to false if not provided.
- Use the
SGTget
function to obtain the transformation matrix T
of the frame specified by FN
.
- If
flip
is true, modify the rotation part of the matrix T
by multiplying it with a rotation matrix that represents a 180-degree rotation around the y-axis.
- Use the
SGTset
function to add the new frame with the name DN
and the transformation matrix T
to the solid geometry object SG
.
- If no output is requested (i.e.,
nargout==0
), visualize the solid geometry object:
- Call
SGfigure
to set up the figure window.
- Use
SGplotalpha
to plot the solid geometry with a specified transparency.
- If
flip
is false, plot the transformation T
with a label showing the original and new frame names.
- If
flip
is true, plot both the original transformation TO
and the new transformation T
with their respective labels.
Algorithm explaination created using ChatGPT on 2025-08-19 00:28. (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