Modern Python bindings for Poisson Surface Reconstruction (v18.74)
Project description
pypoisson2
A new Python bindings for Poisson Reconstruction with optional grid output, density values, and gradient vectors.
The corresponding C++ version: v18.74 of PoissonRecon by mkazhdan.
Features
- Poisson surface reconstruction via C++ libraries (int32/int64 auto-selection)
- Optional implicit grid field output
- Boundary condition support (neumann/dirichlet/free)
- Optional density and gradient outputs
Requirements
- Python 3.9+
- NumPy
- Compiled PoissonRecon shared libraries in
poisson/lib/,lib/, orbuild/ - C++ build deps:
cmake,g++,make,zlib,libpng,libjpeg, OpenMP
Installation
pip install -e .
Quick Start
# Build shared libs
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
make -C build -j$(nproc)
# Install Python package
pip install -e .
# Run a basic reconstruction
python - <<'PY'
import numpy as np
from poisson import poisson_reconstruction
points = np.random.randn(1000, 3).astype(np.float64)
points /= np.linalg.norm(points, axis=1, keepdims=True)
normals = points.copy()
vertices, faces = poisson_reconstruction(points, normals, depth=6)
print(vertices.shape, faces.shape)
PY
Build (PoissonRecon + Dump Tool)
This repo builds two executables:
PoissonReconinbuild/PoissonReconDumpinbuild_dump/(exports density/gradients for test alignment)
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
make -C build -j$(nproc)
cmake -S poisson_dump -B build_dump -DCMAKE_BUILD_TYPE=Release
make -C build_dump -j$(nproc)
Note: Do not define FAST_COMPILE if you need full boundary/degree support.
PyPI Release (Maintainers)
python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*
Basic Usage
import numpy as np
from poisson import poisson_reconstruction
points = np.random.randn(1000, 3).astype(np.float64)
points /= np.linalg.norm(points, axis=1, keepdims=True)
normals = points.copy()
vertices, faces = poisson_reconstruction(points, normals, depth=6)
Advanced Outputs
vertices, faces, grid, iso_value, densities, gradients = poisson_reconstruction(
points,
normals,
depth=6,
grid_depth=5,
output_density=True,
output_gradients=True,
)
Core Parameters
poisson_reconstruction exposes core solver parameters:
depth,full_depth,cg_depth,iters,degreescale,samples_per_node,point_weight,confidenceexact_interpolation,show_residual,low_depth_cutoffwidth,cg_solver_accuracy,base_depth,solve_depth,kernel_depth,base_v_cyclesparallel_type,grid_depthvalidate_finite(default True),force_big(force int64 library)
Tests
Tests use unittest and are run as modules (not pytest).
python -m unittest poisson.tests.exe.test_exe_consistency_core
python -m unittest poisson.tests.exe.test_exe_consistency_params
python -m unittest poisson.tests.exe.test_exe_boundary
python -m unittest poisson.tests.exe.test_dump_outputs
python -m unittest poisson.tests.python.test_python_validation
Executable paths (optional overrides):
POISSON_EXE_PATHdefaults tobuild/PoissonReconPOISSON_DUMP_EXE_PATHdefaults tobuild_dump/PoissonReconDump
Notes:
- Boundary tests default to the horse dataset:
poisson/examples/horse_with_normals.xyz. PoissonReconDumpsupports ASCII PLY inputs (x y z nx ny nz).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pypoisson2-1.0.0.tar.gz.
File metadata
- Download URL: pypoisson2-1.0.0.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c1f62e25eaf0c27f5daac78ede2f2a52e31dba23db8dd7f58b4ca8809bbeb58
|
|
| MD5 |
769888cdc01d093ff9d97f6065e5a8af
|
|
| BLAKE2b-256 |
d45e4a57eed8302aca804d92f3b07f36bd917106cd600739bfcb680fb918960f
|
File details
Details for the file pypoisson2-1.0.0-cp312-cp312-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: pypoisson2-1.0.0-cp312-cp312-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
612ad0f4e0312c6f0cdfc3add35c71b26ff0cbecdececce4123717a145fd559e
|
|
| MD5 |
20930893cac4ae28c1a05aac4ffd7316
|
|
| BLAKE2b-256 |
512bc0065630bafdeccbe29c3e98604fa80f765661516e48e439d292e6fecb6a
|