Description
Invert an exact zero-based voxel x-fastest row-major index with explicit positive dimensions, rejecting out-of-volume values rather than wrapping.
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.
Invert an exact zero-based voxel x-fastest row-major index with explicit positive dimensions, rejecting out-of-volume values rather than wrapping.
When to use this tool
Use this tool to invert an exact zero-based voxel x-fastest row-major index with explicit positive dimensions, rejecting out-of-volume values rather than wrapping.
How to use the tool and how it works
- Enter index, dimensions using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.coordinate. Use the ordering, boundary rules and absence conditions described below.
Parse the decimal index as an exact integer and require it below the volume. Recover x by remainder, y by division and remainder, and z by division.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| index | Exact zero-based linear index as decimal text. | Text, at most 8,192 UTF-16 code units; the operation’s grammar also applies. |
| dimensions | Three positive cell counts [sizeX, sizeY, sizeZ]. | Dense list of at most 128 finite numbers; integer/shape constraints above also apply. |
| Output field | Interpretation |
|---|---|
| result | Object containing the named fields below. |
| result.coordinate | Resulting [x, y, z] integer cell coordinate. |
{
"input": {
"index": "19",
"dimensions": [
3,
4,
2
]
},
"output": {
"result": {
"coordinate": [
1,
2,
1
]
}
}
} Limitations and assumptions
- Negative or out-of-volume indexes are errors; dimensions determine the coordinate convention.
- 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
Similar or alternative tools
- Voxel XYZ Row Major Index
Encode bounded voxel x,y,z to an exact row-major linear index with x fastest, then y, then z; dimensions are explicit positive cell counts.
- 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.