hm_getmatrixdifference
Given 4x4 transformation matrices M1 and M2, return the 4x4 matrix representing M1-1M2.
Syntax
hm_getmatrixdifference matrix_1 matrix_2
Type
HyperMesh Tcl Query Command
Description
Given 4x4 transformation matrices, representing the orientation and positions of two geometric shapes A and B, return the transformation matrix that brings the A to B. This can be used in conjunction with hm_getorientation that returns the transformation matrices for various entity types.
The ouput is a list of 16 values representing the 4x4 matrix M1-1M2.
Inputs
- matrix_1
- The first matrix, passed in as a list of 16 values.
- matrix_2
- The second matrix, passed in as a list of 16 values.
Examples
Find the difference between the orientation of two selections of surfaces:
*createmark surfs 1 23-44
set x [hm_getorientation surfs 1]
*createmark surfs 1 56-60
set y [hm_getorientation surfs 1]
hm_getmatrixdifference $x $y
Find the difference between the orientation of two components:
*createmark comps 1 44 45
set x [hm_getorientation comps 1 comparetype=1]
hm_getmatrixdifference [list [lindex $x 0]] [list [lindex $x 1]]
Errors
Incorrect usage results in a Tcl error. To detect
errors, you can use the catch
command:
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
2021