https://github.com/daavoo/pyntcloud
pyntcloud is a Python library for working with 3D point clouds.
https://github.com/daavoo/pyntcloud
3d 3d-deep-learning 3d-graphics 3d-models 3d-point-clouds deep-learning point-clouds python python-library
Last synced: about 2 months ago
JSON representation
pyntcloud is a Python library for working with 3D point clouds.
- Host: GitHub
- URL: https://github.com/daavoo/pyntcloud
- Owner: daavoo
- License: mit
- Created: 2016-10-03T16:16:44.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2025-03-15T11:51:53.000Z (4 months ago)
- Last Synced: 2025-04-26T16:40:14.688Z (2 months ago)
- Topics: 3d, 3d-deep-learning, 3d-graphics, 3d-models, 3d-point-clouds, deep-learning, point-clouds, python, python-library
- Language: Python
- Homepage: http://pyntcloud.readthedocs.io
- Size: 15.1 MB
- Stars: 1,447
- Watchers: 44
- Forks: 226
- Open Issues: 59
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.rst
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Making point clouds fun again

**pyntcloud** is a Python library for working with 3D point clouds leveraging the power of the Python scientific stack.
- [Examples](https://github.com/daavoo/pyntcloud/tree/master/examples).
- [Documentation](http://pyntcloud.readthedocs.io/en/latest/)## Installation
```bash
pip install pyntcloud
```## Quick Overview
You can access most of pyntcloud's functionality from its core class: PyntCloud.
With PyntCloud you can perform complex 3D processing operations with minimum lines of
code. For example you can:- Load a PLY point cloud from disk.
- Add 3 new scalar fields by converting RGB to HSV.
- Build a grid of voxels from the point cloud.
- Build a new point cloud keeping only the nearest point to each occupied voxel center.
- Save the new point cloud in numpy's NPZ format.With the following concise code:
```python
from pyntcloud import PyntCloudcloud = PyntCloud.from_file("some_file.ply")
cloud.add_scalar_field("hsv")
voxelgrid_id = cloud.add_structure("voxelgrid", n_x=32, n_y=32, n_z=32)
new_cloud = cloud.get_sample("voxelgrid_nearest", voxelgrid_id=voxelgrid_id, as_PyntCloud=True)
new_cloud.to_file("out_file.npz")
```## Integration with other libraries
pyntcloud offers seamless integration with other 3D processing libraries.
You can create / convert PyntCloud instances from / to many 3D processing libraries using the `from_instance` / `to_instance` methods:
- [Open3D](https://www.open3d.org)
```python
import open3d as o3d
from pyntcloud import PyntCloud# FROM Open3D
original_triangle_mesh = o3d.io.read_triangle_mesh("diamond.ply")
cloud = PyntCloud.from_instance("open3d", original_triangle_mesh)# TO Open3D
cloud = PyntCloud.from_file("diamond.ply")
converted_triangle_mesh = cloud.to_instance("open3d", mesh=True) # mesh=True by default
```- [PyVista](https://docs.pyvista.org)
```python
import pyvista as pv
from pyntcloud import PyntCloud# FROM PyVista
original_point_cloud = pv.read("diamond.ply")
cloud = PyntCloud.from_instance("pyvista", original_point_cloud)# TO PyVista
cloud = PyntCloud.from_file("diamond.ply")
converted_triangle_mesh = cloud.to_instance("pyvista", mesh=True)
```