Position3D#
- class tqec.utils.Position3D(x, y, z)[source]#
Bases:
Vec3D
A 3D integer position.
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
Detailed methods
- Parameters:
x (int)
y (int)
z (int)
- __init__(x, y, z)#
- Parameters:
x (int)
y (int)
z (int)
- Return type:
None
- is_neighbour(other)[source]#
Check if the other position is near to this position, i.e. Manhattan distance is 1.
- Parameters:
other (Position3D)
- Return type:
bool
- shift_by(dx=0, dy=0, dz=0)[source]#
Shift the position by the given offset.
- Parameters:
dx (int)
dy (int)
dz (int)
- Return type:
- shift_in_direction(direction, shift)[source]#
Shift the position in the given direction by the given shift.
- Parameters:
direction (Direction3D)
shift (int)
- Return type: