diff --git a/CHANGELOG.md b/CHANGELOG.md index b83e297bd..a72727b62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/compas_timber/assembly/assembly.py b/src/compas_timber/assembly/assembly.py index d31c9cc8a..304854664 100644 --- a/src/compas_timber/assembly/assembly.py +++ b/src/compas_timber/assembly/assembly.py @@ -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.