import meshlib.mrmeshpy as mrmeshpy
meshFloating = mrmeshpy.loadMesh("meshA.stl")
meshFixed = mrmeshpy.loadMesh("meshB.stl")
diagonal = meshFixed.getBoundingBox().diagonal()
icp_sampling_voxel_size = diagonal * 0.01
icp_params = mrmeshpy.ICPProperties()
icp_params.distThresholdSq = (diagonal * 0.1) ** 2
icp_params.exitVal = diagonal * 0.003
icp = mrmeshpy.ICP(meshFloating, meshFixed,
mrmeshpy.AffineXf3f(), mrmeshpy.AffineXf3f(),
icp_sampling_voxel_size)
icp.setParams(icp_params)
xf = icp.calculateTransformation()
meshFloating.transform(xf)
print(icp.getLastICPInfo())
mrmeshpy.saveMesh(meshFloating, "meshA_icp.stl")