hextraj.redblobhex_array#

Attributes#

Classes#

Functions#

hex_corner_offset(layout, corner)

hex_round(hex)

hex_to_pixel(layout, h)

pixel_to_hex(layout, p)

Module Contents#

hextraj.redblobhex_array.INTNaN = 0#
class hextraj.redblobhex_array.Hex#

Bases: NamedTuple

q: numpy.typing.NDArray#
r: numpy.typing.NDArray#
s: numpy.typing.NDArray#
name: str = 'Hex'#
class hextraj.redblobhex_array.Point#

Bases: NamedTuple

x: float#
y: float#
name: str = 'Point'#
class hextraj.redblobhex_array.Orientation#

Bases: NamedTuple

f0: float#
f1: float#
f2: float#
f3: float#
b0: float#
b1: float#
b2: float#
b3: float#
start_angle: float#
name: str = 'Orientation'#
hextraj.redblobhex_array.orientation_pointy#
hextraj.redblobhex_array.orientation_flat#
class hextraj.redblobhex_array.Layout#

Bases: NamedTuple

orientation: Orientation#
size: Point#
origin: Point#
name: str = 'Layout'#
hextraj.redblobhex_array.hex_corner_offset(layout, corner)#
hextraj.redblobhex_array.hex_round(hex: Hex)#
hextraj.redblobhex_array.hex_to_pixel(layout, h)#
hextraj.redblobhex_array.pixel_to_hex(layout, p)#