A fork of heremaps/pptk, updated to build and run on modern Python (3.12+) and CMake (3.28+).
The Point Processing Toolkit (pptk) is a Python package for visualizing and processing 2-d/3-d point clouds.
- 3D point cloud viewer — renders tens of millions of points interactively using octree-based level of detail
- Accepts any 3-column NumPy array as input
- Point selection (rectangular and polygon/lasso) for inspecting and annotating point data
- Per-point sizes, colors (RGB or scalar colormap), and shapes (circle, square, diamond)
- Line and edge rendering between points
- Depth buffer export via
depth_capture() - Camera animation with
play()andrecord() - HiDPI / Retina display support
- Auto-centering for large coordinates (e.g. UTM) to avoid float32 precision loss
- Window resizing via
set(window_size=...) preserve_cameraoption forviewer.load()to keep the current viewpointviewer.connect(port)to attach to an already-running viewer processwait_async()returning aFuturefor non-blocking wait
- Jupyter notebook integration — viewer objects render as interactive 3D visualizations inline via Three.js (drag to orbit, scroll to zoom, right-click to pan)
- Parallelized k-d tree — k-nearest neighbor and r-near range queries (both build and queries are parallelized via TBB)
- Normal estimation — PCA-based surface normal estimation using local point neighborhoods
- PLY file loader —
pptk.load_ply()reads ASCII and binary PLY files - Sequence animation —
pptk.sequence()for animating through lists of point clouds
Unless otherwise noted in LICENSE files for specific files or directories,
the LICENSE in the root applies to all content in this repository.
Install from PyPI:
pip install pptk-revived
or from a locally built wheel (see Build):
pip install <.whl file>
Both import pptk and import pptk_revived work and are identical:
import numpy as np
import pptk # or: import pptk_revived
x = np.random.rand(100, 3)
v = pptk.viewer(x)
v.set(point_size=0.01)Viewer objects display as interactive 3D visualizations in Jupyter notebooks — drag to orbit, scroll to zoom, right-click to pan:
v = pptk.viewer(xyz, rgb)
v # renders inline via Three.js| Notebook | Description |
|---|---|
examples/quickstart.ipynb |
Basic viewer usage, scalar and RGB coloring |
examples/documentation_examples.ipynb |
k-NN queries, normal estimation, camera animation, Möbius strip |
examples/jupyter_interactive_demo.ipynb |
Inline Three.js viewer with colormaps and large point cloud subsampling |
For more examples, see the tutorials.
pptk-revived contains C++ extensions (Qt viewer, k-d tree, normal estimator) that must be compiled before packaging. The build process is:
- Compile C++ extensions with CMake
- Package the compiled artifacts into a wheel
On Ubuntu/Debian:
sudo apt install build-essential cmake patchelf libtbb-dev libeigen3-dev qtbase5-dev libqt5opengl5-dev# 1. Compile C++ extensions
mkdir _cmake_build && cd _cmake_build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . -- -j$(nproc)
cd ..
# 2. Package into a wheel (uv detects the pre-compiled .so files and skips cmake)
uv build
# 3. Install the wheel
uv pip install dist/pptk_revived-*.whl# 1. Create a venv
python3 -m venv venv && source venv/bin/activate
pip install numpy
# 2. Compile C++ extensions
mkdir _cmake_build && cd _cmake_build
cmake .. -DCMAKE_BUILD_TYPE=Release -DPython3_EXECUTABLE=$(which python)
cmake --build . -- -j$(nproc)
cd ..
# 3. Package and install
python setup.py bdist_wheel
pip install dist/pptk_revived-*.whl --force-reinstallmkdir _cmake_build && cd _cmake_build
cmake -G "NMake Makefiles" ..
nmake
cd ..
python setup.py bdist_wheel
pip install dist\pptk_revived-*.whlOriginally developed by HERE Europe B.V. (Copyright 2011–2018). This fork is maintained by Nikolaas Steenbergen.
