Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed May 26, 2024
1 parent 687b571 commit e4b0938
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/compas/geometry/_core/_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1496,13 +1496,6 @@ def decompose_matrix(M):
for j in range(4):
Mt[i][j] /= Mt[3][3]

translation = [M[0][3], M[1][3], M[2][3]]

# scale, shear, angles
scale = [0.0, 0.0, 0.0]
shear = [0.0, 0.0, 0.0]
angles = [0.0, 0.0, 0.0]

# copy Mt[:3, :3] into row
row = [
[0, 0, 0],
Expand All @@ -1513,6 +1506,14 @@ def decompose_matrix(M):
for j in range(3):
row[i][j] = Mt[i][j]

# translation
translation = [M[0][3], M[1][3], M[2][3]]

# scale, shear, angles
scale = [0.0, 0.0, 0.0]
shear = [0.0, 0.0, 0.0]
angles = [0.0, 0.0, 0.0]

scale[0] = norm_vector(row[0])
for i in range(3):
row[0][i] /= scale[0] # type: ignore
Expand Down

0 comments on commit e4b0938

Please sign in to comment.