smbSetTransformationMatrix

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SimMechanics
Introduced first in SolidGeometry 3.0, Creation date: 2016-11-13, Last change: 2025-09-14

Sets a Block Transformation

Description

Only the R and t part of the HT matrix are used. If the third parameter is used, the Rotation part is turned
rel='match' - T is unchanged
rel='align' - T is turned around y-axis

See Also: smbSetTransformationMatrix , smbSetRotationMatrix , smbSetTranslationVector , smbCreateSG

Example Illustration

 missing image of smbSetTransformationMatrix (BName,T,rel)

Syntax

smbSetTransformationMatrix(BName,T,[rel])

Input Parameter

BName: Block Name or gcb
T: 4x4 Transformation Matrix
rel: default is 'match'




Copyright 2016-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, smbSetTransformationMatrix, is designed to set a transformation matrix for a specified block in a simulation environment. It is part of the SG-Library and was created by Tim Lueth.

Input Parameters

Algorithm Steps

  1. Check if BName is empty. If it is, set BName to gcb.
  2. Set the default value of rel to 'match'. If a third argument is provided and is not empty, update rel with this value.
  3. Use a switch statement to handle the rel parameter:
    • Case 'match': The transformation matrix T remains unchanged.
    • Case 'align': The rotation part of T is modified by multiplying it with a rotation matrix that represents a 180-degree rotation around the y-axis.
    • Otherwise: If rel is not recognized, an error is thrown indicating an unknown spatial relation.
  4. Call smbSetRotationMatrix with BName and the rotation part of T (first 3x3 submatrix).
  5. Call smbSetTranslationVector with BName and the translation part of T (first 3 elements of the fourth column).
Algorithm explaination created using ChatGPT on 2025-08-19 01:00. (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