SGTduplicateframe

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Kinematics and Frames
Introduced first in SolidGeometry 5.5, Creation date: 2025-07-21, Last change: 2025-09-15

duplicates a single frame of solid using a new name



See Also: SGTget , SGTset

Example Illustration

 missing image of SGTduplicateframe(SG,FN,DN,flip)

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

Output

Algorithm Steps

  1. Retrieve the 'flip' parameter from the variable arguments, defaulting to false if not provided.
  2. Use the SGTget function to obtain the transformation matrix T of the frame specified by FN.
  3. 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.
  4. Use the SGTset function to add the new frame with the name DN and the transformation matrix T to the solid geometry object SG.
  5. If no output is requested (i.e., nargout==0), visualize the solid geometry object:
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