45 lines
1.5 KiB
Python
45 lines
1.5 KiB
Python
import unittest
|
|
import cadquery as Cq
|
|
import nhf.touhou.houjuu_nue as M
|
|
from nhf.checks import pairwise_intersection
|
|
|
|
class Test(unittest.TestCase):
|
|
|
|
def test_hs_joint_parent(self):
|
|
p = M.Parameters()
|
|
obj = p.hs_joint_parent()
|
|
self.assertIsInstance(obj.val().solids(), Cq.Solid, msg="H-S joint must be in one piece")
|
|
def test_shoulder_joint(self):
|
|
p = M.Parameters()
|
|
shoulder = p.shoulder_assembly()
|
|
assert isinstance(shoulder, Cq.Assembly)
|
|
self.assertEqual(pairwise_intersection(shoulder), [])
|
|
|
|
def test_wing_root(self):
|
|
p = M.Parameters()
|
|
obj = p.wing_root()
|
|
assert isinstance(obj, Cq.Assembly)
|
|
#self.assertIsInstance(obj.solids(), Cq.Solid, msg="Wing root must be in one piece")
|
|
bbox = obj.toCompound().BoundingBox()
|
|
|
|
msg = "Must fix 256^3 bbox"
|
|
self.assertLess(bbox.xlen, 255, msg=msg)
|
|
self.assertLess(bbox.ylen, 255, msg=msg)
|
|
self.assertLess(bbox.zlen, 255, msg=msg)
|
|
def test_wings_assembly(self):
|
|
p = M.Parameters()
|
|
p.wings_assembly()
|
|
def test_harness_assembly(self):
|
|
p = M.Parameters()
|
|
p.harness_assembly()
|
|
def test_trident_assembly(self):
|
|
p = M.Parameters()
|
|
assembly = p.trident_assembly()
|
|
bbox = assembly.toCompound().BoundingBox()
|
|
length = bbox.zlen
|
|
self.assertGreater(length, 1300)
|
|
self.assertLess(length, 1700)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|