Skip to content

Commit

Permalink
Fixed the calculation of the starting position (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatoKnap authored Dec 30, 2024
1 parent f54d90b commit b8a784d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,6 @@ cython_debug/
# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,pycharm

**/*.dat
**/info*.json
!tests/shieldhit/resources/expected_shieldhit_output/*.dat
.vscode/settings.json
4 changes: 3 additions & 1 deletion converter/shieldhit/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def _parse_box(box: BoxFigure, number: int) -> str:
x_vec = rotate([box.x_edge_length, 0, 0], box.rotation)
y_vec = rotate([0, box.y_edge_length, 0], box.rotation)
z_vec = rotate([0, 0, box.z_edge_length], box.rotation)
diagonal_vec = x_vec + y_vec + z_vec
diagonal_vec = [x_vec[0] + y_vec[0] + z_vec[0],
x_vec[1] + y_vec[1] + z_vec[1],
x_vec[2] + y_vec[2] + z_vec[2],]
start_position = (
box.position[0] - diagonal_vec[0] / 2,
box.position[1] - diagonal_vec[1] / 2,
Expand Down

0 comments on commit b8a784d

Please sign in to comment.