Syntax
textT(T,TStr,[c,s])
Input Parameter
T : | | T matrix |
TStr : | | Text string |
c : | | color |
s : | | font size |
Copyright 2013-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, textT
, is designed to display text at a specific position defined by a homogeneous transformation (HT) matrix. It is part of the SolidGeometry library and was created by Tim Lueth.
Input Parameters
- T: A 4x4 HT matrix or an array of such matrices. The function uses the translation vector from the matrix, specifically the elements T(1:3,4), to determine the position where the text will be displayed.
- TStr: A string that represents the text to be displayed.
- c: (Optional) A string representing the color of the text. The default value is 'k' (black).
- s: (Optional) A number representing the font size of the text. The default value is 16.
Algorithm Steps
- The function begins by extracting the input parameters using the helper function
getfuncparams
. It assigns default values if optional parameters are not provided.
- The variable
To
is initialized with the value of TStr
.
- The function determines the number of transformation matrices,
n
, by checking the third dimension of T
.
- An empty array
ha
is initialized to store handles to the text objects created.
- A loop iterates over each transformation matrix (from 1 to
n
):
- If there is more than one matrix, the function updates
TStr
to include an index, using the helper function num2strCNT
.
- The
text
function is called to display the text at the position specified by the translation vector of the current matrix. The text is formatted using sprintf
to include the index.
- The properties of the text object, such as color and font size, are set using the
set
function.
- The handle to the text object is appended to the
ha
array.
- The function returns the array
ha
, which contains handles to all the text objects created.
Algorithm explaination created using ChatGPT on 2025-08-18 23:12. (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