Sparse local operations for point clouds in any dimension.
Project description
❒ SquareNet
SquareNet maps unstructured point clouds to structured grids through a bijective transformation. It replaces expensive spatial queries (k-NN, radius search) with super fast sliding window operations. Think of it as a powerful alternative to kd-trees, voxelization, rasterization and neighborhood graphs. ✔ Works in any dimension ✔ Handles non-convex geometries ✔ Scales to millions of points (fast processing) ✔ Support for Pytorch and Jax
Animation ✨
🚀 Why SquareNet?
- Speed: $O(N)$ local operations via vectorized sliding windows.
- Memory: Contiguous memory access instead of irregular spatial lookups.
- Simplicity: No heavy spatial dependencies, pure native sorting logic
📦 Installation
pip install squarenet
🧠 Quick Start
-> 00_getting_started.ipynb
from squarenet import SquareNet
import numpy as np
# Initialize and Fit
N = 5*11*7*13
d = 4
X = np.random.rand(N, d)
IJKL = (5, 11, 7, 13)
sn = SquareNet(gridshape=IJKL)# Define grid dimensions, here 4D
sn.fit(X)
# Map any data indexed on the points e.g (N, *C) to the grid
Xgrid = sn.map(X) #(5, 11, 7, 13, 4)
#and back
sn.invert_map(Xgrid) # = X
Query neighbors
# d-dimensional query method
# approximate but super fast
sn.search_sorted(point)
🗺️ Visualizing the Mapping
sn = SquareNet(gridshape=(400, 400))
sn.fit("france")
sn.plot()
📈 Key Applications
- Point-Cloud Processing: Fast spatial querys (neighbors, intersections...).
- Kernel Methods: Efficient approximation of large kernels (sparse Gram matrix).
- Deep Learning: Tensorization of flat datasets (CNN-Ready)
License: MIT | Author: ArmanddeCacqueray
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 squarenet-1.1.0.tar.gz.
File metadata
- Download URL: squarenet-1.1.0.tar.gz
- Upload date:
- Size: 30.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fbd04443f8184992df6652fc8f01cac1907a13e3b0a170cdb6d0a6134cf14a1
|
|
| MD5 |
56dc514a3fbf162429a1e091651b2d32
|
|
| BLAKE2b-256 |
a2ed83e59e05de381ed0587b0cec97273f1ddae5af1894cc126a4373ad9dd3cf
|
File details
Details for the file squarenet-1.1.0-py3-none-any.whl.
File metadata
- Download URL: squarenet-1.1.0-py3-none-any.whl
- Upload date:
- Size: 36.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cb8b3e0f03ecf5a3c5d37619c18598071be1b9043699f57e153b6c86c53d9ce
|
|
| MD5 |
bece08ef181d0b8383204e05cded2d90
|
|
| BLAKE2b-256 |
b3b0543c9a548456c16c8b3f2ccc1c164fa15366a7c4483d79075e4d214c93b1
|