Skip to content

Main content

Hex Cube Line Coordinate List

Enumerate a bounded shortest hex cube line by linear interpolation and deterministic zero-sum rounding, including both endpoints; no obstacles or tie-randomization.

Loading tool…

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

  1. Enter from, to using the field definitions below.
  2. Run the operation. Correct input errors before interpreting an output.
  3. 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 fieldMeaning and unitsAccepted input
fromStarting integer cube coordinate [x, y, z].Dense list of at most 128 finite numbers; integer/shape constraints above also apply.
toEnding integer cube coordinate [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.coordinatesEndpoint-inclusive sequence of rounded integer cube cells.
json
{
  "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

  1. Tool behavior and example: Hex Cube Line Coordinate List — tool.io

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.