Compress point cloud geometry without losing a single detail.
Overview
gridity is a high-performance Python library backed by a Rust computational core. It is designed to compress the geometric information of a point cloud by identifying the minimal set of pairwise distances needed to reconstruct the full shape exactly up to rotation and reflection.
Bridging the gap between computational geometry and deep learning, gridity provides the foundational tools for rigidity analysis, exact shape reconstruction, and Graph Neural Network experimentation.
Key Features
- Blazing-Fast Rust Core: Heavy computations run in Rust with the Python GIL released, enabling seamless parallel training with PyTorch.
- Minimal Distance Compression: Finds the exact minimal set of independent edges required to preserve the full geometric structure of 2D and 3D point clouds.
- Dual Algorithm Support:
- Rigidity Matrix: Classical Gaussian elimination for general d-dimensional spaces.
- Pebble Game: A deterministic O(n²) algorithm optimized for lightning-fast 2D rigidity analysis.
- Exact Shape Reconstruction: Recovers original coordinates from compressed distance sets using Classical Multidimensional Scaling (MDS).
- Geometric Validation: Compute Gram matrices, verify isometry and measure reconstruction fidelity through stress metrics.
- GNN Data Generation: Generate massive, reproducible batches of random rigidity graphs to train GNNs that learn to predict edge independence directly from geometry.
🛠️ Installation
pip install gridity