Skip to content

Main content

Voxel Box Tile Index Record

Map a bounded voxel to tile/local coordinates and clipped half-open edge-tile bounds under explicit positive tile dimensions.

Loading tool…

Description

Map a bounded voxel to tile/local coordinates and clipped half-open edge-tile bounds under explicit positive tile dimensions.

A voxel is a cell on a three-dimensional integer lattice. Coordinates use [x, y, z] order; a box uses an inclusive low corner and exclusive high corner, so its dimensions count cells rather than physical distance. Occupancy records can repeat the same cell without creating extra occupied space.

Map a bounded voxel to tile/local coordinates and clipped half-open edge-tile bounds under explicit positive tile dimensions.

When to use this tool

Use this tool to map a bounded voxel to tile/local coordinates and clipped half-open edge-tile bounds under explicit positive tile dimensions.

How to use the tool and how it works

  1. Enter coordinate, dimensions, tileSize using the field definitions below.
  2. Run the operation. Correct input errors before interpreting an output.
  3. Read result.tile, result.local, result.tileLow, result.tileHigh. Use the ordering, boundary rules and absence conditions described below.

Divide each bounded coordinate by its tile size to obtain a floored tile index and a remainder local coordinate. Clip tileHigh at the volume dimensions.1

Input fieldMeaning and unitsAccepted input
coordinateA single [x, y, z] integer cell coordinate; a slice instead uses one integer axis coordinate.Dense list of at most 128 finite numbers; integer/shape constraints above also apply.
dimensionsThree positive cell counts [sizeX, sizeY, sizeZ].Dense list of at most 128 finite numbers; integer/shape constraints above also apply.
tileSizeThree positive tile cell counts [x, y, z].Dense list of at most 128 finite numbers; integer/shape constraints above also apply.
Output fieldInterpretation
resultObject containing the named fields below.
result.tileTile indexes along x, y and z.
result.localCoordinate offsets within the selected tile.
result.tileLowInclusive low coordinate of the selected tile.
result.tileHighExclusive high coordinate, clipped at the volume dimensions.
json
{
  "input": {
    "coordinate": [
      4,
      2,
      1
    ],
    "dimensions": [
      5,
      4,
      3
    ],
    "tileSize": [
      3,
      3,
      2
    ]
  },
  "output": {
    "result": {
      "tile": [
        1,
        0,
        0
      ],
      "local": [
        1,
        2,
        1
      ],
      "tileLow": [
        3,
        0,
        0
      ],
      "tileHigh": [
        5,
        3,
        2
      ]
    }
  }
}

Limitations and assumptions

  • Edge tiles may be smaller than tileSize; high bounds are exclusive.
  • Voxel components are integers from −1,000,000,000 through 1,000,000,000; dimensions are three integers from 1 through 1,000,000. Counts or strides returned as decimal text use exact integer arithmetic. No physical voxel size is assumed.
  • Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
  • Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.

Alternative or Complementary methods

Keep cell coordinates, storage order and physical scale separate. Use coordinate conversion for a different memory layout and a separate meshing or geometric model for rendered surfaces.

References

  1. Tool behavior and example: Voxel Box Tile Index Record — tool.io

Similar or alternative tools