Base: fix conversion from Placement to Matrix
See also: https://forum.freecadweb.org/viewtopic.php?f=3&t=61000
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user