Skip to content

Commit

Permalink
format, lint, changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
obucklin committed Apr 25, 2024
1 parent 62ee25d commit 09b77ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Added
* Added `center_of_mass` property to Assembly class.
* Added `volume` property to Assembly class.

### Changed

Expand Down
6 changes: 3 additions & 3 deletions src/compas_timber/assembly/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ def center_of_mass(self):
for beam in self._beams:
vol = beam.blank.volume
point = beam.blank_frame.point
point += beam.blank_frame.xaxis * (beam.blank_length / 2)
total_vol += vol
point += beam.blank_frame.xaxis * (beam.blank_length / 2)
total_vol += vol
total_position += point * vol

return Point(*total_position) * (1.0 / total_vol)

@property
def volume(self):
"""Returns the center of mass of the assembly.
Expand Down

0 comments on commit 09b77ee

Please sign in to comment.