Skip to content

Commit b07bf72

Browse files
committed
Move object scaling away from pymvr
1 parent f9b2534 commit b07bf72

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
### Changelog
22

3+
### 1.0.6
4+
5+
* Matrix class is no longer scaling objects down/up (it should never have done
6+
that). You must ensure scaling in the consumer code from now on.
7+
38
### 1.0.5
49

510
* Breaking: Switch `Addresses` to plural fields (`addresses`/`networks`) to match spec semantics; remove singular access and update tests/docs.

pymvr/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from .value import Matrix, Color # type: ignore
3333
from enum import Enum
3434

35-
__version__ = "1.0.5"
35+
__version__ = "1.0.6.dev0"
3636

3737

3838
def _find_root(pkg: "zipfile.ZipFile") -> "ElementTree.Element":

pymvr/value.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,8 @@ def __init__(self, str_repr):
106106
[component[0], component[1], component[2], 0],
107107
[component[3], component[4], component[5], 0],
108108
[component[6], component[7], component[8], 0],
109-
[component[9] * 0.001, component[10] * 0.001, component[11] * 0.001, 0],
109+
[component[9], component[10], component[11], 0],
110110
]
111-
# TODO: the matrix down-scaling should not be done here but in the consumer, based on scaling settings and so on
112-
# same below, where we up-scale it again as mere re-processing via pymvr will cause loss of precision
113-
# another option is to have a global settings for the GeneralSceneDescription but we then must pass the GSD class
114-
# down through the hierarchy all the way to the Matrix class
115111

116112
def __eq__(self, other):
117113
return self.matrix == other.matrix
@@ -127,7 +123,7 @@ def __repr__(self):
127123

128124
def to_xml(self, parent):
129125
u, v, w, x = self.matrix
130-
matrix_str = f"{{{u[0]},{u[1]},{u[2]}}}{{{v[0]},{v[1]},{v[2]}}}{{{w[0]},{w[1]},{w[2]}}}{{{x[0] / 0.001},{x[1] / 0.001},{x[2] / 0.001}}}"
126+
matrix_str = f"{{{u[0]},{u[1]},{u[2]}}}{{{v[0]},{v[1]},{v[2]}}}{{{w[0]},{w[1]},{w[2]}}}{{{x[0]},{x[1]},{x[2]}}}"
131127
matrix = ElementTree.SubElement(parent, type(self).__name__)
132128
matrix.text = matrix_str
133129

0 commit comments

Comments
 (0)