Description
Enumerate a bounded shortest hex cube line by linear interpolation and deterministic zero-sum rounding, including both endpoints; no obstacles or tie-randomization.
Hexagonal grids can use axial, three-component cube or parity-based offset coordinates. Cube coordinates satisfy x + y + z = 0; axial coordinates use two components. Pixel layouts additionally need orientation, origin and center-to-corner size, which are separate from the integer coordinate convention.
Enumerate a bounded shortest hex cube line by linear interpolation and deterministic zero-sum rounding, including both endpoints; no obstacles or tie-randomization.
When to use this tool
Use this tool to enumerate a bounded shortest hex cube line by linear interpolation and deterministic zero-sum rounding, including both endpoints; no obstacles or tie-randomization.
How to use the tool and how it works
- Enter from, to using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.coordinates. Use the ordering, boundary rules and absence conditions described below.
Compute cube distance as the maximum absolute component difference. Interpolate distance + 1 points including endpoints and cube-round each one.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| from | Starting integer cube coordinate [x, y, z]. | Dense list of at most 128 finite numbers; integer/shape constraints above also apply. |
| to | Ending integer cube coordinate [x, y, z]. | 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.coordinates | Endpoint-inclusive sequence of rounded integer cube cells. |
{
"input": {
"from": [
0,
0,
0
],
"to": [
2,
-2,
0
]
},
"output": {
"result": {
"coordinates": [
[
0,
0,
0
],
[
1,
-1,
0
],
[
2,
-2,
0
]
]
}
}
} Limitations and assumptions
- Distance is limited to 127; tie handling follows the implementation without a geometric supercover or obstacle avoidance.
- Integer layout coordinates are bounded to ±1,000,000,000 where required. Cube components must sum to zero within 1e−8. Pixel coordinates, origin and size must use the same distance units; angular calculations use radians internally.
- 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 coordinate layout, parity convention and drawing orientation consistent. Use an explicit rounding operation to choose an integer cell from fractional coordinates and a separate pathfinding model for obstacles or routes.
References
Similar or alternative tools
- Hex Cube Axis Reflection
Reflect integer hex cube coordinates across a named cube axis by swapping the other two components; preserves zero-sum coordinates.
- Hex Fractional Cube Rounding
Round zero-sum fractional hex cube coordinates and repair the largest rounding-error component to preserve zero sum; ties repair z then y under the documented strict comparisons.