diff --git a/tools/coordinate.py b/tools/coordinate.py index 02f59bc..3609eff 100644 --- a/tools/coordinate.py +++ b/tools/coordinate.py @@ -195,10 +195,6 @@ class Coordinate: class Shape: - top_left: Coordinate - bottom_right: Coordinate - mode_3d: bool - def __init__(self, top_left: Coordinate, bottom_right: Coordinate): """ in 2D mode: top_left is the upper left corner and bottom_right the lower right @@ -211,7 +207,7 @@ class Shape: self.bottom_right = bottom_right self.mode_3d = top_left.z is not None and bottom_right.z is not None - def size(self): + def __len__(self): if not self.mode_3d: return (self.bottom_right.x - self.top_left.x + 1) * (self.bottom_right.y - self.top_left.y + 1) else: