cosplay: Touhou/Houjuu Nue #1

Closed
aniva wants to merge 37 commits from touhou/houjuu-nue into main
2 changed files with 10 additions and 4 deletions
Showing only changes of commit cec2f4da55 - Show all commits

View File

@ -7,20 +7,24 @@ class Test(unittest.TestCase):
def test_hs_joint_parent(self):
p = M.Parameters()
obj = p.hs_joint_parent()
assert isinstance(obj.val().solids(), Cq.Solid), "H-S joint must be in one piece"
self.assertIsInstance(obj.val().solids(), Cq.Solid, msg="H-S joint must be in one piece")
def test_wing_root(self):
p = M.Parameters()
obj = p.wing_root()
assert isinstance(obj.solids(), Cq.Solid), "Wing root must be in one piece"
self.assertIsInstance(obj.solids(), Cq.Solid, msg="Wing root must be in one piece")
def test_wings(self):
p = M.Parameters()
p.wing_r1()
def test_harness(self):
p = M.Parameters()
p.harness_assembly()
def test_trident():
def test_trident(self):
p = M.Parameters()
p.trident_assembly()
assembly = p.trident_assembly()
bbox = assembly.toCompound().BoundingBox()
length = bbox.zlen
self.assertGreater(length, 1300)
self.assertLess(length, 1700)
if __name__ == '__main__':
unittest.main()

View File

@ -26,5 +26,7 @@ def trident_assembly(
.constrain("i2?lip", "s2?mate1", "Plane", param=0)
.add(handle.insertion(), name="i3", color=mat_i.color)
.constrain("s2?mate2", "i3?lip", "Plane", param=0)
.add(handle.one_side_connector(), name="head", color=mat_i.color)
.constrain("i3?mate", "head?mate", "Plane")
)
return assembly.solve()