Tofn

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Kinematics and Frames
Introduced first in SolidGeometry 5.1, Creation date: 2021-03-27, Last change: 2025-09-15

provides a standardized test frame from 1 of 36 with different ez-vector and orientation

Description

Used for creating test cases for instance for TLof2T

See Also: TLofn , VLof2TR

Example Illustration

 missing image of Tofn(n,poff,woff)

Syntax

Tofn([n,poff,woff])

Input Parameter

n: 1..36 for an frame; if n==0 a random solution is selected
poff: offset value; default is [0 0 0]
woff: angle osset default is 0

Examples


Tofn(11)
Tofn('',[0 100 0], pi/10)




Copyright 2021-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, Tofn, is designed to generate a standardized test frame based on a specified index and optional offsets. It is part of the SolidGeometry library and is used for creating test cases.

Input Parameters

Algorithm Steps

  1. Retrieve the input parameters n, poff, and woff using the getfuncparams function. If n is not provided, it defaults to an empty array.
  2. Set nmax to 36, representing the maximum number of frames.
  3. If n is empty, display all 36 frames in a loop using SGfigure and tplot, then return an empty matrix T.
  4. If n is 0, select a random frame by generating a random number between 1 and nmax.
  5. Calculate m1 as the modulus of n with 6, and r1 as the integer division of (n-m1) by 6 plus 1.
  6. Adjust r1 using mod1 to ensure it is within the range of 1 to 6.
  7. Use a switch statement to determine the ez vector based on m1:
  8. Use another switch statement to determine the angle w based on r1:
  9. Calculate the transformation matrix T using the TofPez function with poff, ez, and the sum of w and woff.
  10. If no output is requested, display the frame using SGfigure and tplot, and label it with the frame number.
Algorithm explaination created using ChatGPT on 2025-08-19 08:19. (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