Skip to content

Commit 1fd4d8f

Browse files
committed
Fix box_to_compas
1 parent b1c7276 commit 1fd4d8f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Removed `planarity` from requirements.
1616
* Fixed argument order at `compas.geometry.cone.circle`.
1717
* Pinned `jsonschema` version to >=4.17, <4.18 to avoid Rust toolchain
18+
* Fixed `box_to_compas` in `compas_rhino.conversions` to correctly take in the center of the box as the center point of the frame.
1819

1920
### Removed
2021

src/compas_rhino/conversions/shapes.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,7 @@ def box_to_compas(box):
216216
ysize = box.Y.Length
217217
zsize = box.Z.Length
218218
frame = plane_to_compas_frame(box.Plane)
219-
frame.point += frame.xaxis * 0.5 * xsize
220-
frame.point += frame.yaxis * 0.5 * ysize
221-
frame.point += frame.zaxis * 0.5 * zsize
219+
frame.point = point_to_compas(box.Center)
222220
return Box(xsize, ysize, zsize, frame=frame)
223221

224222

0 commit comments

Comments
 (0)