Tupright

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.0, Creation date: 2012-05-05, Last change: 2025-09-14

rotates an HT matrix to have the z-dimension upright.

Description

This function is used for automatic orientation detection

Example Illustration

 missing image of Tupright(T)

Syntax

T=Tupright(T)

Input Parameter

T: original HT matrix

Output Parameter

T: correct HT matrix




Copyright 2012-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 adjust a homogeneous transformation (HT) matrix so that the z-dimension is oriented upright. The function is named Tupright and is part of the SG-Library, specifically categorized under auxiliary procedures. Below is a detailed explanation of the algorithm based on the provided MATLAB code.

Input Parameters

Output Results

Algorithm Steps

  1. The function checks the value of the element at the third row and second column of the matrix T (i.e., T(3,2)).
  2. If T(3,2) is equal to -1, it negates the first two columns of the first three rows of T. This operation effectively flips the orientation of the x and y axes.
  3. Next, the function checks the value of the element at the third row and first column of the matrix T (i.e., T(3,1)).
  4. If T(3,1) is equal to -1, it swaps the first two columns of the first three rows of T and negates the new first column. This operation reorients the x and y axes to ensure the z-axis is upright.

The algorithm assumes that the input matrix T is a valid HT matrix and that the operations performed will correctly orient the z-dimension upright. The function does not handle any other cases or provide error checking for invalid input matrices.

Algorithm explaination created using ChatGPT on 2025-08-18 21:50. (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