Cell3D

class Cell3D(val x: Int, val y: Int, val z: Int, val cellSize: Double)(source)

Represents a 3D cell with a fixed size in a spatial hash grid structure. A Cell3D is aligned along a grid using its integer coordinates and supports operations to manage points within its bounds, calculate distances to a query point, and retrieve its own bounding boxes.

Constructors

Link copied to clipboard
constructor(x: Int, y: Int, z: Int, cellSize: Double)

Properties

Link copied to clipboard
val bounds: Box

Represents the 3D bounding box of the cell.

Link copied to clipboard

The size of the cell in all dimensions.

Link copied to clipboard
val contentBounds: Box

Provides the bounding 3D box that contains all the points within the cell. If the points collection is empty, it returns an empty box. Otherwise, it calculates the bounding box based on the minimum and maximum coordinates of the stored points (xMin, xMax, yMin, yMax, zMin, zMax).

Link copied to clipboard
val x: Int

The x-coordinate of the cell within the grid.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val y: Int

The y-coordinate of the cell within the grid.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val z: Int

The z-coordinate of the cell within the grid.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun points(): Sequence<Pair<Vector3, Any?>>

Generates a sequence of all the points stored in the points collection.