tqec.position.Position3D#

class Position3D(x: int, y: int, z: int)[source]#

A 3D integer position.

__init__(x: int, y: int, z: int) None#

Methods

__init__(x, y, z)

as_2d()

Return the position as a 2D position.

as_tuple()

Return the position as a tuple.

is_neighbour(other)

Check if the other position is near to this position, i.e. Manhattan distance is 1.

shift_by([dx, dy, dz])

Shift the position by the given offset.

shift_in_direction(direction, shift)

Shift the position in the given direction by the given shift.

Attributes

x

y

z