wrap.rigidAlignment

wrap.rigidAlignment(geomFloating, pointsFloating, geomFixed, pointsFixed, matchScale = True)

Finds transformation matrix 4x4 that transforms geomFloating to geomFixed based on a set of user specified point correspondences. pointsFloating and pointsFixed should be the same length.

Parameters:

geomFloating : wrap.Geom

Geometry to be transformed

pointsFloating : sequence of wrap.PointOnTriangle

A set of points on geomFloating

geomFixed : wrap.Geom

Geometry to match to

pointsFixed : sequence of wrap.PointOnTriangle

A set of points on geomFixed

matchScale : bool, optional

If False the resulting matrix will only rotate and translate the floating geometry. If True it will also match the scale of floating model to fixed model. Defaults to True

Returns:

result : wrap.Matrix4x4

Returns matrix 4x4 that will transform geomFloating to geomFixed

Examples

# finding transformation matrix
m = wrap.rigidAlignment(geomFloating,pointsFloating,geomFixed,pointsFixed)
# applying the transformation
geomFloating.transform(m)