Point Cloud Utils
raw JSON → 0.34.0 verified Fri May 01 auth: no python
A Python library for common tasks on 3D point clouds and meshes, including sampling, distance computation (chamfer, Hausdorff, Earth Mover's), normal estimation, mesh reconstruction, and more. Current version: 0.34.0. Released under MIT license (since v0.30.0). Active development with frequent releases.
pip install point-cloud-utils Common errors
error ImportError: DLL load failed while importing point_cloud_utils: The specified module could not be found. ↓
cause Missing or incompatible C++ runtime libraries (e.g., Visual C++ Redistributable on Windows).
fix
Install Microsoft Visual C++ Redistributable (2015-2022) from https://aka.ms/vs/17/release/vc_redist.x64.exe.
error RuntimeError: CUDA error: no kernel image is available for execution on the device ↓
cause The library was compiled for a specific CUDA architecture, but the GPU does not support it.
fix
Install a version of point-cloud-utils built for your GPU architecture, or use pip install --no-binary point-cloud-utils to build from source with your CUDA setup.
error AttributeError: module 'point_cloud_utils' has no attribute 'chamfer_distance' ↓
cause Using an outdated version that did not have that function, or typo.
fix
Update to latest version: pip install --upgrade point-cloud-utils. Double-check the spelling: it's 'chamfer_distance'.
Warnings
breaking In v0.30.0, the license changed from GPL to MIT. All GPL dependencies were removed. If you relied on any functionality that might have been dropped, check the release notes. ↓
fix Upgrade to latest version (>=0.30.0) and verify that all needed functions still exist.
deprecated Some functions may have been renamed between versions. For example, 'voxelize_mesh' was changed in v0.30.0 to have the voxel center at origin. Existing code that expects previous behavior may produce different results. ↓
fix Update calls to voxelize_mesh to account for the origin shift.
gotcha Input point clouds and meshes must often be float32 arrays. Using float64 may silently cause issues or performance degradation. ↓
fix Ensure arrays are np.float32 before passing to pcu functions.
breaking In v0.32.0, numpy 2.0 ABI compatibility was fixed. Older versions may crash with numpy 2.0. ↓
fix Upgrade to v0.32.0 or later if using numpy 2.0+.
Imports
- point_cloud_utils wrong
import point_cloud_utilscorrectimport point_cloud_utils as pcu - chamfer_distance wrong
from pcu import chamfer_distancecorrectfrom point_cloud_utils import chamfer_distance
Quickstart
import point_cloud_utils as pcu
import numpy as np
# Load a point cloud from a PLY file
verts, faces = pcu.load_mesh_vf("bunny.ply")
# Compute chamfer distance between two point clouds
pcd1 = np.random.randn(100, 3).astype(np.float32)
pcd2 = np.random.randn(200, 3).astype(np.float32)
chamfer_dist, _ = pcu.chamfer_distance(pcd1, pcd2)
print("Chamfer distance:", chamfer_dist)
# Downsample point cloud
sampled_indices = pcu.downsample_point_cloud_uniform(pcd1, 50)
sampled_pcd = pcd1[sampled_indices]