smbSGtransP

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

Moves a SG without changing the

Description

Main motivation for this function was to create

Example Illustration

 missing image of smbSGtransP(SGName,delta)

Syntax

smbSGtransP(SGName,delta)

Input Parameter

SGName: Solid Name that has Baseframe and Follower Frame
delta: Delta vector




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 algorithm is designed to move a Solid Geometry (SG) in a SimMechanics model without altering its structure. The function smbSGtransP takes two input parameters: SGName and delta.

Input Parameters

Algorithm Steps

  1. Retrieve the current Simulink model using find_system(gcs), which returns all blocks in the current system.
  2. Identify the block associated with the Baseframe of the SG by searching for SGName.B in the list of blocks.
  3. Get the current translation offset of the Baseframe using get_param with the parameter 'TranslationCartesianOffset'.
  4. Convert the retrieved offset from a string to a numeric vector using str2num.
  5. Add the delta vector to the current offset to compute the new position.
  6. Format the new position as a string using sprintf and update the block's parameter with set_param.
  7. Repeat steps 2-6 for the Follower Frame by searching for SGName.F.
Algorithm explaination created using ChatGPT on 2025-08-18 22:40. (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