Skip to content

Commit 02fbb3a

Browse files
authored
Merge pull request #778 from compas-dev/feature/scale_box
Update `Box` transform
2 parents 9de7c52 + 73877fc commit 02fbb3a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
### Changed
1717

18+
* Fixed box scaling.
19+
1820
### Removed
1921

2022

src/compas/geometry/shapes/box.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,11 @@ def transform(self, transformation):
555555
556556
"""
557557
self.frame.transform(transformation)
558+
# Always local scaling, non-uniform scaling based on frame not yet considered.
559+
Sc, _, _, _, _ = transformation.decomposed()
560+
self.xsize *= Sc[0, 0]
561+
self.ysize *= Sc[1, 1]
562+
self.zsize *= Sc[2, 2]
558563

559564

560565
# ==============================================================================

0 commit comments

Comments
 (0)