warp.HashGrid#

class warp.HashGrid(*args, **kwargs)[source]#
__init__(dim_x, dim_y, dim_z, device=None)[source]#

Class representing a hash grid object for accelerated point queries.

id#

Unique identifier for this mesh object, can be passed to kernels.

device#

Device this object lives on, all buffers must live on the same device.

Parameters:
  • dim_x (int) – Number of cells in x-axis

  • dim_y (int) – Number of cells in y-axis

  • dim_z (int) – Number of cells in z-axis

Methods

__init__(dim_x, dim_y, dim_z[, device])

Class representing a hash grid object for accelerated point queries.

build(points, radius)

Updates the hash grid data structure.

reserve(num_points)

build(points, radius)[source]#

Updates the hash grid data structure.

This method rebuilds the underlying datastructure and should be called any time the set of points changes.

Parameters:
  • points (warp.array) – Array of points of type warp.vec3

  • radius (float) – The cell size to use for bucketing points, cells are cubes with edges of this width. For best performance the radius used to construct the grid should match closely to the radius used when performing queries.

reserve(num_points)[source]#