Model.hm_comparegettransformationmatrix#

Model.hm_comparegettransformationmatrix(transformation_index)#

Returns the 4x4 transformation matrix (16 values) for a specific transformation. This must be preceded by a call to a relevant hm_compareentities function.

Parameters:

transformation_index (int) – The index of the transformation to query, starting with 0. The number of transformations can be found using Model.hm_comparegettransformationcount().

Returns:

Example#

Find the transformation matrix for transformation 0 for the recursive comparison of surfces with IDs 1 - 20 and 101 - 120#
import hm
import hm.entities as ent

model = hm.Model()

surf1 = hm.Collection(model, ent.Surface, list(range(1, 21)))
surf2 = hm.Collection(model, ent.Surface, list(range(101, 121)))

model.hm_compareinit()

model.hm_compareentitiesrecursive(
    source_surfaces=surf1,
    target_surfaces=surf2,
    tolerance=0.1,
    result_type=2,
    review_results=False,
)

_, result = model.hm_comparegettransformationmatrix(transformation_index=0)

matrix  = result.transformationMatrix
print("matrix ", matrix )

model.hm_compareend()