Spatial partitioning for neighbor search – Crucial for Solvers (Up to 50 times faster).
In current Geometry Nodes workflows, collision detection is often done by comparing a point’s position to the nearest other point using the “Index of Nearest” node.
This approach works for small point counts, but it does not scale. For simulations involving hundreds of thousands or millions of points, it becomes computationally too expensive, since each point effectively searches across all other points.
To address this, I propose a new node: Spatial Neighbor Search, with a user-defined grid size.
The idea is to split space into a regular grid and place each point into a cell based on its position. Instead of searching through all points, each point only looks at points in its own cell and the neighboring cells.
In practice, this works as follows:
Space is partitioned into equally sized 3D cells (based on the chosen grid size).
Each point is assigned to a cell using its position. When searching for neighbors, a point only considers points in its own cell and neighboring cells.
Distance checks are then performed only on this reduced set of candidates.
If the grid size is chosen to be at least as large as the interaction or collision radius, this method guarantees that all relevant neighbors are found while drastically reducing the number of comparisons.
This changes the complexity from effectively quadratic to near linear, making large-scale simulations feasible.
The node could expose parameters such as:
Grid Size (cell size) group ID
And provide outputs like:
Grid Indices Grid Neighbour Count
This approach is standard in particle-based simulation methods such as Discrete Element Method (DEM) and is essential for scaling to large point counts efficiently.
Depending on point count simulation speed can go up to 5-50x in speed.
I really hope this will be added to blender at one point because it's a huge step to catching up to Houdini.
0 Comments