Base: fix conversion from Placement to Matrix

See also: https://forum.freecadweb.org/viewtopic.php?f=3&t=61000
This commit is contained in:
wmayer
2022-04-29 13:45:50 +02:00
parent f2698ac017
commit 80c900cf52
2 changed files with 26 additions and 4 deletions

View File

@@ -407,6 +407,24 @@ class MatrixTestCase(unittest.TestCase):
res = self.mat * mat
self.assertEqual(type(res), FreeCAD.Matrix)
def testMatrixPlacementMatrix(self):
# Example taken from https://forum.freecadweb.org/viewtopic.php?f=3&t=61000
mat = FreeCAD.Matrix(-0.470847778020266,
0.8150598976807029,
0.3376088628746235,
-11.25290913640202,
-0.8822144756796808,
-0.4350066260577338,
-0.180185641360483,
-2876.45492562325,
1.955470978815492e-9,
-0.3826834326750831,
0.923879538425552,
941.3822018176414)
plm = FreeCAD.Placement(mat)
mat = plm.toMatrix()
self.assertEqual(mat.hasScale(), FreeCAD.ScaleType.NoScaling)
def testAnything(self):
with self.assertRaises(NotImplementedError):
self.mat * "string"