diff --git a/src/compas/geometry/geometry.py b/src/compas/geometry/geometry.py index ab5b8b9fbdf..d9c378d0fec 100644 --- a/src/compas/geometry/geometry.py +++ b/src/compas/geometry/geometry.py @@ -75,6 +75,7 @@ def compute_obb(self): """ raise NotImplementedError + @reset_computed def transform(self, transformation): """Transform the geometry. @@ -122,6 +123,7 @@ def transformed(self, transformation): # type: (...) -> G geometry.transform(transformation) return geometry # type: ignore + @reset_computed def scale(self, x, y=None, z=None): """Scale the geometry. @@ -195,6 +197,7 @@ def scaled(self, x, y=None, z=None): # type: (...) -> G return self.transformed(Scale.from_factors([x, y, z])) + @reset_computed def translate(self, vector): """Translate the geometry. @@ -244,6 +247,7 @@ def translated(self, vector): # type: (...) -> G return self.transformed(Translation.from_vector(vector)) + @reset_computed def rotate(self, angle, axis=None, point=None): """Rotate the geometry. diff --git a/src/compas/geometry/shapes/box.py b/src/compas/geometry/shapes/box.py index ab3b3739d7a..b4d64b52f0f 100644 --- a/src/compas/geometry/shapes/box.py +++ b/src/compas/geometry/shapes/box.py @@ -625,6 +625,7 @@ def to_brep(self): # Transformations # ========================================================================== + @reset_computed def scale(self, factor): """Scale the box. diff --git a/src/compas/geometry/shapes/shape.py b/src/compas/geometry/shapes/shape.py index 64cec89afb0..f43d18efc31 100644 --- a/src/compas/geometry/shapes/shape.py +++ b/src/compas/geometry/shapes/shape.py @@ -165,6 +165,7 @@ def to_brep(self): # Transformation # ============================================================================= + @reset_computed def transform(self, transformation): """Transform the shape. @@ -191,6 +192,7 @@ def transform(self, transformation): """ self.frame.transform(transformation) + @reset_computed def translate(self, vector): """Translate the shape. @@ -212,6 +214,7 @@ def translate(self, vector): """ self.frame.point += vector + @reset_computed def rotate(self, angle, axis=None, point=None): """Rotate the shape. @@ -236,6 +239,7 @@ def rotate(self, angle, axis=None, point=None): matrix = Rotation.from_axis_and_angle(axis=axis, angle=angle, point=point) self.transform(matrix) + @reset_computed def scale(self, scale): """Scale the shape.