Skip to content

Commit

Permalink
aliasses
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Dec 13, 2024
1 parent 35ab0db commit 18b35ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Added implementation of `RhinoBrep.fillet()` and `RhinoBrep.filleted()` to `compas_rhino`.
* Added `Frame.invert` and `Frame.inverted`.
* Added `Frame.flip` and `Frame.flipped` as alias for invert and inverted.
* Added `Vector.flip` and `Vector.flipped` as alias for invert and inverted.

### Changed

Expand Down
4 changes: 4 additions & 0 deletions src/compas/geometry/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,12 +609,16 @@ def invert(self):
self._yaxis = self.yaxis * -1
self._zaxis = None

flip = invert

def inverted(self):
"""Return an inverted copy of the frame."""
frame = self.copy() # type: Frame
frame.invert()
return frame

flipped = inverted

def interpolate_frame(self, other, t):
"""Interpolates between two frames at a given parameter t in the range [0, 1]
Expand Down
4 changes: 4 additions & 0 deletions src/compas/geometry/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,8 @@ def invert(self):
"""
self.scale(-1.0)

flip = invert

def inverted(self):
"""Returns a inverted copy of this vector
Expand All @@ -697,6 +699,8 @@ def inverted(self):
"""
return self.scaled(-1.0)

flipped = inverted

def scale(self, n):
"""Scale this vector by a factor n.
Expand Down

0 comments on commit 18b35ba

Please sign in to comment.