From 09b77ee66a2ba3ba605291eed49ad283f4e474f1 Mon Sep 17 00:00:00 2001 From: oliver bucklin Date: Thu, 25 Apr 2024 17:37:26 +0200 Subject: [PATCH] format, lint, changelog --- CHANGELOG.md | 2 ++ src/compas_timber/assembly/assembly.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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.