Closed MatthiasJ1 closed 7 months ago
I don't have an Apple Silicon Mac so I'm unable to work on this issue. Hopefully someone with the appropriate H/W will be able to help.
The difference is 360 degrees, so maybe the solution is not to fix e.g. def test_make_brake_formed(self):
or the underlying cause but instead to have a version of assertVectorAlmostEquals
that takes this into account e.g. assertOrientationVectorAlmostEquals
Or migrate from euler angles to quaternions
I don't have an Apple Silicon Mac so I'm unable to work on this issue. Hopefully someone with the appropriate H/W will be able to help.
Just FYI, in case you ever want to test on M1 yourself, you can get an M1 VPS here for only 0.11/hr
@MatthiasJ1 I created a (rough) prototype of orientation vector comparison that internally converts both inputs to quaternions, and then converts back into Euler angles and then compares those. It passes tests on all x86 platforms. Could you test it, available here: https://github.com/jdegenstein/build123d/blob/dev/tests/test_direct_api.py#L114
I did not point all the tests at the new comparison method, just the one that failed above (test_neg
)
EDIT: I pointed all applicable tests at the new method and they all passed.
@MatthiasJ1 tested orientation vector comparison via quaternions and it is still failing on M1 (this previously passed on all other platforms) https://github.com/jdegenstein/build123d/actions/runs/7645068147/job/20830789244?pr=4
def test_neg(self):
loc = Location((1, 2, 3), (0, 35, 127))
n_loc = -loc
self.assertVectorAlmostEquals(n_loc.position, (1, 2, 3), 5)
> self.assertOrientationVectorAlmostEquals(n_loc.orientation, (180, -35, -127), 5)
tests/test_direct_api.py:1630:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_direct_api.py:146: in assertOrientationVectorAlmostEquals
self.assertAlmostEqual(first_vector.X, second_vector.X, places, msg=msg)
E AssertionError: -53.24031235481778 != 53.24031235481776 within 5 places (106.48062470963555 difference)