Skip to content

[Draft] support PointCloud pickle#7374

Open
chunibyo-wly wants to merge 1 commit intoisl-org:mainfrom
chunibyo-wly:pickle
Open

[Draft] support PointCloud pickle#7374
chunibyo-wly wants to merge 1 commit intoisl-org:mainfrom
chunibyo-wly:pickle

Conversation

@chunibyo-wly
Copy link
Copy Markdown
Contributor

Type

  • Bug fix (non-breaking change which fixes an issue): Fixes #
  • New feature (non-breaking change which adds functionality). Resolves #
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

Currently, the Non-tensor version of Geometry Class can not work with multiprocessing very well, as these classes miss the implementation of py::pickle.

May I ask if it is the proper implementation to support pickle? If so, I will continue to finish the remaining classes (lineset, triangle mesh, ...).

@update-docs
Copy link
Copy Markdown

update-docs bot commented Nov 16, 2025

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@chunibyo-wly
Copy link
Copy Markdown
Contributor Author

The minimal test case is

import pickle

import numpy as np
import open3d as o3d

pcd = o3d.io.read_point_cloud(o3d.data.KnotMesh().path)
pcd.estimate_normals()
pcd.estimate_covariances()
print(pcd.has_covariances(), pcd.has_normals())
data = pickle.dumps(pcd)
pcd_loaded = pickle.loads(data)


print(np.all(np.asarray(pcd.points) == np.asarray(pcd_loaded.points)))
print(np.all(np.asarray(pcd.normals) == np.asarray(pcd_loaded.normals)))
print(np.all(np.asarray(pcd.colors) == np.asarray(pcd_loaded.colors)))
print(np.all(np.asarray(pcd.covariances) == np.asarray(pcd_loaded.covariances)))

And the stdout is

True True
True
True
True
True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant