Test the result of a well-known concatenated rotation example.
(self)
| 350 | assert rotated.origin.toTuple() == approx(origin) |
| 351 | |
| 352 | def testPlaneRotateConcat(self): |
| 353 | """ |
| 354 | Test the result of a well-known concatenated rotation example. |
| 355 | """ |
| 356 | xdir = (1, 0, 0) |
| 357 | normal = (0, 0, 1) |
| 358 | k = 2.0 ** 0.5 / 2.0 |
| 359 | origin = (2, -1, 1) |
| 360 | plane = Plane(origin=origin, xDir=xdir, normal=normal) |
| 361 | plane = plane.rotated((0, 0, 45)) |
| 362 | assert plane.xDir.toTuple() == approx((k, k, 0)) |
| 363 | assert plane.yDir.toTuple() == approx((-k, k, 0)) |
| 364 | assert plane.zDir.toTuple() == approx((0, 0, 1)) |
| 365 | plane = plane.rotated((0, 45, 0)) |
| 366 | assert plane.xDir.toTuple() == approx((0.5, 0.5, -k)) |
| 367 | assert plane.yDir.toTuple() == approx((-k, k, 0)) |
| 368 | assert plane.zDir.toTuple() == approx((0.5, 0.5, k)) |
| 369 | assert plane.origin.toTuple() == origin |
| 370 | |
| 371 | def testPlaneRotateConcatRandom(self): |
| 372 | """ |