cosplay: Touhou/Houjuu Nue #4
|
@ -326,8 +326,8 @@ class DiskJoint(Model):
|
||||||
radius_disk: float = 20.0
|
radius_disk: float = 20.0
|
||||||
radius_axle: float = 3.0
|
radius_axle: float = 3.0
|
||||||
|
|
||||||
housing_thickness: float = 5.0
|
housing_thickness: float = 4.0
|
||||||
disk_thickness: float = 5.0
|
disk_thickness: float = 7.0
|
||||||
# Gap between disk and the housing
|
# Gap between disk and the housing
|
||||||
#disk_thickness_gap: float = 0.1
|
#disk_thickness_gap: float = 0.1
|
||||||
|
|
||||||
|
@ -382,9 +382,8 @@ class DiskJoint(Model):
|
||||||
"""
|
"""
|
||||||
return self.total_thickness / 2 - self.housing_thickness
|
return self.total_thickness / 2 - self.housing_thickness
|
||||||
|
|
||||||
@target(name="disk")
|
def _disk_cut(self) -> Cq.Workplane:
|
||||||
def disk(self) -> Cq.Workplane:
|
return (
|
||||||
cut = (
|
|
||||||
Cq.Solid.makeBox(
|
Cq.Solid.makeBox(
|
||||||
length=self.spring.tail_length,
|
length=self.spring.tail_length,
|
||||||
width=self.spring.thickness,
|
width=self.spring.thickness,
|
||||||
|
@ -393,6 +392,9 @@ class DiskJoint(Model):
|
||||||
.located(Cq.Location((0, self.spring.radius_inner, 0)))
|
.located(Cq.Location((0, self.spring.radius_inner, 0)))
|
||||||
.rotate((0, 0, 0), (0, 0, 1), self.spring_slot_offset)
|
.rotate((0, 0, 0), (0, 0, 1), self.spring_slot_offset)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@target(name="disk")
|
||||||
|
def disk(self) -> Cq.Workplane:
|
||||||
radius_tongue = self.radius_disk + self.tongue_length
|
radius_tongue = self.radius_disk + self.tongue_length
|
||||||
tongue = (
|
tongue = (
|
||||||
Cq.Solid.makeCylinder(
|
Cq.Solid.makeCylinder(
|
||||||
|
@ -419,7 +421,7 @@ class DiskJoint(Model):
|
||||||
centered=(True, True, False),
|
centered=(True, True, False),
|
||||||
combine='cut',
|
combine='cut',
|
||||||
)
|
)
|
||||||
.cut(cut)
|
.cut(self._disk_cut())
|
||||||
)
|
)
|
||||||
plane = result.copyWorkplane(Cq.Workplane('XY'))
|
plane = result.copyWorkplane(Cq.Workplane('XY'))
|
||||||
theta = math.radians(self.spring_slot_offset)
|
theta = math.radians(self.spring_slot_offset)
|
||||||
|
@ -460,7 +462,7 @@ class DiskJoint(Model):
|
||||||
result = result.cut(
|
result = result.cut(
|
||||||
self
|
self
|
||||||
.wall()
|
.wall()
|
||||||
.located(Cq.Location((0, 0, self.disk_thickness - self.wall_inset)))
|
.located(Cq.Location((0, 0, self.housing_thickness - self.wall_inset)))
|
||||||
#.rotate((0, 0, 0), (1, 0, 0), 180)
|
#.rotate((0, 0, 0), (1, 0, 0), 180)
|
||||||
#.located(Cq.Location((0, 0, self.disk_thickness + self.housing_thickness)))
|
#.located(Cq.Location((0, 0, self.disk_thickness + self.housing_thickness)))
|
||||||
)
|
)
|
||||||
|
@ -512,8 +514,8 @@ class DiskJoint(Model):
|
||||||
)
|
)
|
||||||
result = (
|
result = (
|
||||||
result
|
result
|
||||||
.cut(carve.located(Cq.Location((0, 0, -self.housing_upper_carve_offset))))
|
|
||||||
.union(wall, tol=TOL)
|
.union(wall, tol=TOL)
|
||||||
|
.cut(carve.located(Cq.Location((0, 0, -self.housing_upper_carve_offset))))
|
||||||
)
|
)
|
||||||
return result.clean()
|
return result.clean()
|
||||||
|
|
||||||
|
@ -597,7 +599,7 @@ class ElbowJoint(Model):
|
||||||
lip_thickness: float = 5.0
|
lip_thickness: float = 5.0
|
||||||
lip_length: float = 60.0
|
lip_length: float = 60.0
|
||||||
hole_pos: list[float] = field(default_factory=lambda: [15, 25])
|
hole_pos: list[float] = field(default_factory=lambda: [15, 25])
|
||||||
parent_arm_span: float = 30.0
|
parent_arm_width: float = 10.0
|
||||||
# Angle of the beginning of the parent arm
|
# Angle of the beginning of the parent arm
|
||||||
parent_arm_angle: float = 180.0
|
parent_arm_angle: float = 180.0
|
||||||
|
|
||||||
|
@ -612,7 +614,6 @@ class ElbowJoint(Model):
|
||||||
assert self.child_arm_radius > self.disk_joint.radius_housing
|
assert self.child_arm_radius > self.disk_joint.radius_housing
|
||||||
assert self.parent_arm_radius > self.disk_joint.radius_housing
|
assert self.parent_arm_radius > self.disk_joint.radius_housing
|
||||||
self.disk_joint.tongue_length = self.child_arm_radius - self.disk_joint.radius_disk - self.lip_thickness / 2
|
self.disk_joint.tongue_length = self.child_arm_radius - self.disk_joint.radius_disk - self.lip_thickness / 2
|
||||||
assert self.disk_joint.movement_angle < self.parent_arm_angle < 360 - self.parent_arm_span
|
|
||||||
|
|
||||||
def lip(self) -> Cq.Workplane:
|
def lip(self) -> Cq.Workplane:
|
||||||
holes = [
|
holes = [
|
||||||
|
@ -642,14 +643,18 @@ class ElbowJoint(Model):
|
||||||
flip_x = Cq.Location((0, 0, 0), (1, 0, 0), 180)
|
flip_x = Cq.Location((0, 0, 0), (1, 0, 0), 180)
|
||||||
flip_z = Cq.Location((0, 0, 0), (0, 0, 1), 180)
|
flip_z = Cq.Location((0, 0, 0), (0, 0, 1), 180)
|
||||||
lip_dz = self.lip_thickness
|
lip_dz = self.lip_thickness
|
||||||
|
loc_lip = (
|
||||||
|
Cq.Location((0, 0, 0), (0, 1, 0), 180) *
|
||||||
|
Cq.Location((-lip_dz, 0, 0), (1, 0, 0), 90) *
|
||||||
|
Cq.Location((0, 0, 0), (0, 1, 0), 90)
|
||||||
|
)
|
||||||
|
loc_disk = flip_x * flip_z * Cq.Location((-self.child_arm_radius, 0, -dz), (0, 0, 1), angle)
|
||||||
|
disk_cut = self.disk_joint._disk_cut().located(
|
||||||
|
loc_lip.inverse * Cq.Location((0, self.disk_joint.spring.radius_inner, 0)) * loc_disk)
|
||||||
result = (
|
result = (
|
||||||
Cq.Assembly()
|
Cq.Assembly()
|
||||||
.add(self.lip(), name="lip", loc=
|
.add(self.lip().cut(disk_cut), name="lip", loc=loc_lip)
|
||||||
Cq.Location((0, 0, 0), (0, 1, 0), 180) *
|
.add(self.disk_joint.disk(), name="disk", loc=loc_disk)
|
||||||
Cq.Location((-lip_dz, 0, 0), (1, 0, 0), 90) *
|
|
||||||
Cq.Location((0, 0, 0), (0, 1, 0), 90))
|
|
||||||
.add(self.disk_joint.disk(), name="disk",
|
|
||||||
loc=flip_x * flip_z * Cq.Location((-self.child_arm_radius, 0, -dz), (0, 0, 1), angle))
|
|
||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@ -661,18 +666,25 @@ class ElbowJoint(Model):
|
||||||
def parent_joint_upper(self):
|
def parent_joint_upper(self):
|
||||||
axial_offset = Cq.Location((self.parent_arm_radius, 0, 0))
|
axial_offset = Cq.Location((self.parent_arm_radius, 0, 0))
|
||||||
housing_dz = self.disk_joint.housing_upper_dz
|
housing_dz = self.disk_joint.housing_upper_dz
|
||||||
conn_h = self.lip_thickness
|
conn_h = self.disk_joint.total_thickness
|
||||||
|
conn_w = self.parent_arm_width
|
||||||
connector = (
|
connector = (
|
||||||
Cq.Solid.makeCylinder(
|
Cq.Solid.makeBox(
|
||||||
|
length=self.parent_arm_radius,
|
||||||
|
width=conn_w,
|
||||||
height=conn_h,
|
height=conn_h,
|
||||||
radius=self.parent_arm_radius - self.lip_thickness / 2,
|
).located(Cq.Location((0, -conn_w/2, 0)))
|
||||||
angleDegrees=self.parent_arm_span)
|
#Cq.Solid.makeCylinder(
|
||||||
|
# height=conn_h,
|
||||||
|
# radius=self.parent_arm_radius - self.lip_thickness / 2,
|
||||||
|
# angleDegrees=self.parent_arm_span)
|
||||||
.cut(Cq.Solid.makeCylinder(
|
.cut(Cq.Solid.makeCylinder(
|
||||||
height=conn_h,
|
height=conn_h,
|
||||||
radius=self.disk_joint.radius_housing,
|
radius=self.disk_joint.radius_housing,
|
||||||
))
|
))
|
||||||
.located(Cq.Location((0, 0, -conn_h / 2)))
|
.located(Cq.Location((0, 0, -conn_h / 2)))
|
||||||
.rotate((0,0,0), (0,0,1), 180-self.parent_arm_span / 2)
|
.rotate((0,0,0), (0,0,1), 180)
|
||||||
|
#.rotate((0,0,0), (0,0,1), 180-self.parent_arm_span / 2)
|
||||||
)
|
)
|
||||||
housing = self.disk_joint.housing_upper()
|
housing = self.disk_joint.housing_upper()
|
||||||
housing_loc = Cq.Location(
|
housing_loc = Cq.Location(
|
||||||
|
|
|
@ -50,6 +50,7 @@ class WingProfile(Model):
|
||||||
disk_joint=DiskJoint(
|
disk_joint=DiskJoint(
|
||||||
movement_angle=55,
|
movement_angle=55,
|
||||||
),
|
),
|
||||||
|
hole_diam=6.0,
|
||||||
))
|
))
|
||||||
# Distance between the two spacers on the elbow, halved
|
# Distance between the two spacers on the elbow, halved
|
||||||
elbow_h2: float = 5.0
|
elbow_h2: float = 5.0
|
||||||
|
@ -62,8 +63,11 @@ class WingProfile(Model):
|
||||||
radius_disk=13.0,
|
radius_disk=13.0,
|
||||||
radius_housing=15.0,
|
radius_housing=15.0,
|
||||||
),
|
),
|
||||||
child_arm_radius=20.0,
|
hole_pos=[10, 20],
|
||||||
|
lip_length=50,
|
||||||
|
child_arm_radius=23.0,
|
||||||
parent_arm_radius=30.0,
|
parent_arm_radius=30.0,
|
||||||
|
hole_diam=4.0,
|
||||||
))
|
))
|
||||||
# Distance between the two spacers on the elbow, halved
|
# Distance between the two spacers on the elbow, halved
|
||||||
wrist_h2: float = 5.0
|
wrist_h2: float = 5.0
|
||||||
|
|
Loading…
Reference in New Issue