cosplay: Touhou/Houjuu Nue #4
|
@ -265,7 +265,7 @@ class TorsionJoint:
|
|||
spring_thickness: float = 2
|
||||
spring_height: float = 15
|
||||
|
||||
spring_tail_length: float = 40
|
||||
spring_tail_length: float = 35
|
||||
|
||||
groove_radius_outer: float = 35
|
||||
groove_radius_inner: float = 20
|
||||
|
@ -314,15 +314,11 @@ class TorsionJoint:
|
|||
l = self.spring_tail_length
|
||||
if self.right_handed:
|
||||
r2 = -r2
|
||||
# This is (0, r2) and (l, r2) transformed by right handed rotation
|
||||
# matrix `[[c, -s], [s, c]]`
|
||||
return [
|
||||
(0, 0, height),
|
||||
(c, s, height)
|
||||
]
|
||||
# This is (0, r2) and (l, r2) transformed by rotation matrix
|
||||
# [[c, s], [-s, c]]
|
||||
return [
|
||||
(s * r2, -s * l + c * r2, height),
|
||||
(c * l + s * r2, -s * l + c * r2, height),
|
||||
(-s * r2, c * r2, height),
|
||||
(c * l - s * r2, s * l + c * r2, height),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ class TestJoints(unittest.TestCase):
|
|||
assembly = joint.rider_track_assembly(slot)
|
||||
bbox = assembly.toCompound().BoundingBox()
|
||||
self.assertAlmostEqual(bbox.zlen, joint.total_height)
|
||||
self.assertAlmostEqual(bbox.xlen, joint.radius * 2)
|
||||
self.assertAlmostEqual(bbox.ylen, joint.radius * 2)
|
||||
self.assertEqual(pairwise_intersection(assembly), [])
|
||||
|
||||
def test_torsion_joint(self):
|
||||
|
|
Loading…
Reference in New Issue