cosplay: Touhou/Houjuu Nue #4

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

View File

@ -389,6 +389,8 @@ class ShoulderJoint(Model):
# The parent side has arms which connect to the lips
parent_arm_width: float = 25.0
parent_arm_height: float = 12.0
# remove a bit of material from the base so it does not interfere with gluing
parent_arm_base_shift: float = 2.0
# Generates a child guard which covers up the internals. The lip length is
# relative to the +X surface of the guard.
@ -515,17 +517,24 @@ class ShoulderJoint(Model):
assert self.parent_arm_width <= joint.radius_track * 2
assert self.parent_lip_ext > joint.radius_track
cut_arm = Cq.Solid.makeBox(
self.parent_lip_ext + self.parent_lip_width / 2,
self.parent_arm_width,
self.parent_arm_base_shift,
)
arm = (
Cq.Solid.makeBox(
self.parent_lip_ext + self.parent_lip_width / 2,
self.parent_arm_width,
self.parent_arm_height)
.cut(cut_arm)
.located(Cq.Location((0, -self.parent_arm_width/2 , 0)))
.cut(Cq.Solid.makeCylinder(joint.radius_track, self.parent_arm_height))
.cut(self._contraction_cut_geometry(parent=True, mirror=top))
)
t = self.parent_arm_base_shift
lip_args = dict(
length=self.parent_lip_length,
length=self.parent_lip_length - t,
width=self.parent_lip_width,
thickness=self.parent_lip_thickness,
hole_diam=self.parent_conn_hole_diam,
@ -534,19 +543,20 @@ class ShoulderJoint(Model):
lip1 = MountingBox(
**lip_args,
holes=[
Hole(x=self.height / 2 - x, y=-y)
Hole(x=self.height / 2 - x - t, y=-y)
for x, y in self.parent_conn_hole_pos
],
)
lip2 = MountingBox(
**lip_args,
holes=[
Hole(x=self.height / 2 - x, y=y)
Hole(x=self.height / 2 - x - t, y=y)
for x, y in self.parent_conn_hole_pos
],
)
lip_dy = self.parent_arm_width / 2 - self.parent_lip_thickness
# Flip so the lip's holes point to -X
loc_shift = Cq.Location((self.parent_arm_base_shift, 0, 0))
loc_axis = Cq.Location((0,0,0), (0, 1, 0), -90)
loc_dir1 = Cq.Location((0,lip_dy,0), (0, 0, 1), -90)
loc_dir2 = Cq.Location((0,-lip_dy,0), (0, 0, 1), 90)
@ -562,8 +572,8 @@ class ShoulderJoint(Model):
.add(joint.track(), name="track",
loc=Cq.Location((0, 0, 0), (0, 0, 1), rot))
.add(arm, name="arm")
.add(lip1.generate(), name=lip_p_tag, loc=loc_pos * loc_dir1 * loc_axis)
.add(lip2.generate(), name=lip_n_tag, loc=loc_pos * loc_dir2 * loc_axis)
.add(lip1.generate(), name=lip_p_tag, loc=loc_pos * loc_dir1 * loc_axis * loc_shift)
.add(lip2.generate(), name=lip_n_tag, loc=loc_pos * loc_dir2 * loc_axis * loc_shift)
)
return result