cosplay: Touhou/Houjuu Nue #4

Open
aniva wants to merge 189 commits from touhou/houjuu-nue into main
1 changed files with 53 additions and 1 deletions
Showing only changes of commit a9b3aa8f70 - Show all commits

View File

@ -305,13 +305,28 @@ class ShoulderJoint(Model):
angle_neutral: float = -15.0 angle_neutral: float = -15.0
angle_max_deflection: float = 65.0 angle_max_deflection: float = 65.0
spool_radius: float = 14.0
spool_groove_depth: float = 1.0
spool_base_height: float = 3.0
spool_height: float = 5.0
spool_groove_inset: float = 2.0
def __post_init__(self): def __post_init__(self):
assert self.parent_lip_length * 2 < self.height assert self.parent_lip_length * 2 < self.height
assert self.spool_groove_depth < self.spool_radius < self.torsion_joint.radius_rider - self.child_core_thickness
assert self.spool_base_height > self.spool_groove_depth
@property @property
def radius(self): def radius(self):
return self.torsion_joint.radius return self.torsion_joint.radius
@property
def draft_length(self):
"""
Amount of wires that need to draft on the spool
"""
return (self.spool_radius - self.spool_groove_depth / 2) * math.radians(self.angle_max_deflection)
def parent_lip_loc(self, left: bool=True) -> Cq.Location: def parent_lip_loc(self, left: bool=True) -> Cq.Location:
""" """
2d location of the arm surface on the parent side, relative to axle 2d location of the arm surface on the parent side, relative to axle
@ -416,7 +431,10 @@ class ShoulderJoint(Model):
@target(name="parent-bot") @target(name="parent-bot")
def parent_bot(self) -> Cq.Assembly: def parent_bot(self) -> Cq.Assembly:
return self.parent(top=False) result = (
self.parent(top=False)
)
return result
@target(name="parent-top") @target(name="parent-top")
def parent_top(self) -> Cq.Assembly: def parent_top(self) -> Cq.Assembly:
return self.parent(top=True) return self.parent(top=True)
@ -430,6 +448,36 @@ class ShoulderJoint(Model):
joint = self.torsion_joint joint = self.torsion_joint
return self.height - 2 * joint.total_height + 2 * joint.rider_disk_height return self.height - 2 * joint.total_height + 2 * joint.rider_disk_height
def _spool(self) -> Cq.Workplane:
"""
Generates the spool piece which holds the line in tension
"""
t = self.spool_groove_depth
bulk = Cq.Solid.makeCylinder(
radius=self.spool_radius,
height=self.spool_height,
).located(Cq.Location((0, 0, self.spool_base_height)))
base = Cq.Solid.makeCylinder(
radius=self.spool_radius - t,
height=self.spool_base_height,
)
hole_x = self.spool_radius - (t + self.spool_groove_inset)
slot = Cq.Solid.makeBox(
length=t + self.spool_groove_inset,
width=t,
height=self.spool_base_height,
).located(Cq.Location((hole_x, -t/2, 0)))
hole = Cq.Solid.makeBox(
length=t,
width=t,
height=self.spool_height + self.spool_base_height,
).located(Cq.Location((hole_x, -t/2, 0)))
centre_hole = Cq.Solid.makeCylinder(
radius=self.torsion_joint.radius_axle,
height=self.spool_height + self.spool_base_height,
)
return bulk.fuse(base).cut(slot, hole, centre_hole)
@target(name="child") @target(name="child")
def child(self) -> Cq.Assembly: def child(self) -> Cq.Assembly:
""" """
@ -512,6 +560,8 @@ class ShoulderJoint(Model):
loc_rotate = Cq.Location((0, 0, 0), (1, 0, 0), 180) loc_rotate = Cq.Location((0, 0, 0), (1, 0, 0), 180)
loc_axis_rotate_bot = Cq.Location((0, 0, 0), (0, 0, 1), self.axis_rotate_bot + self.angle_neutral) loc_axis_rotate_bot = Cq.Location((0, 0, 0), (0, 0, 1), self.axis_rotate_bot + self.angle_neutral)
loc_axis_rotate_top = Cq.Location((0, 0, 0), (0, 0, 1), self.axis_rotate_top + self.angle_neutral) loc_axis_rotate_top = Cq.Location((0, 0, 0), (0, 0, 1), self.axis_rotate_top + self.angle_neutral)
spool_dz = self.height / 2 - self.torsion_joint.total_height
spool_angle = 180 + self.angle_neutral
result = ( result = (
Cq.Assembly() Cq.Assembly()
.add(core, name="core", loc=Cq.Location()) .add(core, name="core", loc=Cq.Location())
@ -523,6 +573,8 @@ class ShoulderJoint(Model):
loc=Cq.Location((self.child_guard_ext, 0, dh))) loc=Cq.Location((self.child_guard_ext, 0, dh)))
.add(lip, name="lip_bot", .add(lip, name="lip_bot",
loc=Cq.Location((self.child_guard_ext, 0, -dh)) * loc_rotate) loc=Cq.Location((self.child_guard_ext, 0, -dh)) * loc_rotate)
.add(self._spool(), name="spool",
loc=Cq.Location((0, 0, -spool_dz), (0, 0, 1), spool_angle))
) )
return result return result