Skip to content

Commit 06e4484

Browse files
committed
adding axes to box as well
1 parent ca5f874 commit 06e4484

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## Unreleased
99

1010
### Added
11-
* Added `Frame.axes`
11+
* Added `Frame.axes` and `Box.axes`
1212

1313
### Changed
1414

src/compas/geometry/shapes/box.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class Box(Shape):
6565
Diagonal of the box.
6666
dimensions : list[float], read-only
6767
The dimensions of the box in the local frame.
68+
axes : list[:class:`~compas.geometry.Vector`], read-only
69+
The XYZ axes of the box frame.
6870
area : float, read-only
6971
The surface area of the box.
7072
volume : float, read-only
@@ -263,6 +265,10 @@ def diagonal(self):
263265
def dimensions(self):
264266
return [self.xsize, self.ysize, self.zsize]
265267

268+
def axes(self):
269+
"""The XYZ axes of the box frame."""
270+
return self.frame.axes
271+
266272
@property
267273
def area(self):
268274
return 2 * self.xsize * self.ysize + 2 * self.ysize * self.zsize + 2 * self.zsize * self.xsize

0 commit comments

Comments
 (0)