squarenet documentation

Open In Colab PyPI version Documentation Status GitHub

Introduction

SquareNet example plot

SquareNet maps unstructured point clouds to structured grids through a bijective transformation: one point, one cell, no overlap, fully invertible.

The practical payoff: you replace expensive spatial queries (k-NN, radius search, neighborhood graphs) with plain tensor indexing.

Think of it as an alternative to kd-trees, voxelization, rasterization, or graph-based approaches, but with a regular tensor structure allowing for massive parallelisation.

Features

  • βœ” Works in any dimension

  • βœ” Handles non-convex geometries and irregular distributions

  • βœ” Scales to millions of points (seconds, not minutes)

  • βœ” Compatible with PyTorch and JAX

  • βœ” Native padding for mismatch between number of grid slots and number of points (since version 1.2)

Raw gridification example