prepmd.lib package

Submodules

prepmd.lib.icp module

ICP method in python by Clay Fannigan. Improvement by Max Bazik. This version originally had scaling, added by Alvin Wan. I have removed the scalilng but kept some changes that allow for differently-sized point clouds to be aligned. This code was originally licensed under the Apache License version 2.0.

prepmd.lib.icp.best_fit_transform(A, B)[source]

Calculates the least-squares best-fit transform between corresponding 3D points A->B Input:

A: Nx3 numpy array of corresponding 3D points B: Nx3 numpy array of corresponding 3D points

Returns:

T: 4x4 homogeneous transformation matrix R: 3x3 rotation matrix t: 3x1 column vector for translation s: 3x1 column vector for scaling

prepmd.lib.icp.nearest_neighbor(src, dst)[source]

Find the nearest (Euclidean) neighbor in dst for each point in src Input:

src: Nx3 array of points dst: Nx3 array of points

Output:

distances: Euclidean distances of the nearest neighbor indices: dst indices of the nearest neighbor

prepmd.lib.icp.icp(A, B, init_pose=None, max_iterations=100, tolerance=1e-10)[source]

The Iterative Closest Point method Input:

A: Nx3 numpy array of source 3D points B: Nx3 numpy array of destination 3D point init_pose: 4x4 homogeneous transformation max_iterations: exit algorithm after max_iterations tolerance: convergence criteria

Output:

T: final homogeneous transformation distances: Euclidean distances (errors) of the nearest neighbor

prepmd.lib.mdaCIF module

Module contents

Created on Tue Feb 17 13:53:45 2026

@author: rob