feat: Child guard to prevent collision in shoulder

This commit is contained in:
Leni Aniva 2024-07-19 16:37:47 -07:00
parent 433a553957
commit 560e9b54dd
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
2 changed files with 36 additions and 16 deletions

View File

@ -252,14 +252,19 @@ class ShoulderJoint(Model):
parent_lip_ext: float = 40.0
parent_lip_guard_height: float = 8.0
# Measured from centre of axle
child_lip_length: float = 45.0
# Generates a child guard which covers up the internals. The lip length is
# relative to the +X surface of the guard.
child_guard_ext: float = 30.0
child_guard_width: float = 25.0
# guard length measured from axle
child_lip_length: float = 40.0
child_lip_width: float = 20.0
child_conn_hole_diam: float = 6.0
# Measured from centre of axle
child_conn_hole_pos: list[float] = field(default_factory=lambda: [25, 35])
child_conn_hole_pos: list[float] = field(default_factory=lambda: [15, 25])
child_core_thickness: float = 3.0
# Rotates the torsion joint to avoid collisions or for some other purpose
axis_rotate_bot: float = 225.0
axis_rotate_top: float = -225.0
@ -345,7 +350,6 @@ class ShoulderJoint(Model):
"""
joint = self.torsion_joint
assert all(r > joint.radius_rider for r in self.child_conn_hole_pos)
assert all(r < self.child_lip_length for r in self.child_conn_hole_pos)
# Half of the height of the bridging cylinder
@ -371,6 +375,30 @@ class ShoulderJoint(Model):
.assemble()
.circle(radius_core_inner, mode='s')
)
core_guard = (
Cq.Workplane('XY')
.box(
length=self.child_guard_ext,
width=self.child_guard_width,
height=self.height,
centered=(False, True, True),
)
.copyWorkplane(Cq.Workplane('XY'))
.cylinder(
radius=self.radius,
height=self.height,
combine='cut',
centered=True,
)
.copyWorkplane(Cq.Workplane('XY'))
.box(
length=self.child_guard_ext,
width=self.child_lip_width,
height=self.height - self.torsion_joint.total_height * 2,
combine='cut',
centered=(False, True, True),
)
)
core = (
Cq.Workplane('XY')
.placeSketch(core_profile1)
@ -381,6 +409,7 @@ class ShoulderJoint(Model):
.toPending()
.extrude(dh * 2)
.translate(Cq.Vector(0, 0, -dh))
.union(core_guard)
)
assert self.child_lip_width / 2 <= joint.radius_rider
lip_thickness = joint.rider_disk_height
@ -391,15 +420,6 @@ class ShoulderJoint(Model):
hole_loc=self.child_conn_hole_pos,
hole_diam=self.child_conn_hole_diam,
)
lip = (
lip
.copyWorkplane(Cq.Workplane('XY'))
.cylinder(
radius=joint.radius_rider,
height=lip_thickness,
centered=(True, True, False),
combine='cut')
)
theta = self.torsion_joint.spring.angle_neutral - self.torsion_joint.rider_slot_span
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)
@ -412,9 +432,9 @@ class ShoulderJoint(Model):
.add(joint.rider(rider_slot_begin=180), name="rider_bot",
loc=loc_axis_rotate_bot * Cq.Location((0, 0, -dh), (0, 0, 1), -90) * loc_rotate)
.add(lip, name="lip_top",
loc=Cq.Location((0, 0, dh)))
loc=Cq.Location((self.child_guard_ext, 0, dh)))
.add(lip, name="lip_bot",
loc=Cq.Location((0, 0, -dh)) * loc_rotate)
loc=Cq.Location((self.child_guard_ext, 0, -dh)) * loc_rotate)
)
return result

View File

@ -96,7 +96,7 @@ class WingProfile(Model):
self.shoulder_joint.angle_neutral = -self.shoulder_angle_neutral - self.shoulder_angle_bias
self.shoulder_axle_loc = Cq.Location.from2d(self.shoulder_tip_x, self.shoulder_tip_y - self.shoulder_width / 2, self.shoulder_angle_bias)
self.shoulder_joint.child_guard_width = self.s1_thickness + self.panel_thickness * 2
assert self.spacer_thickness == self.root_joint.child_mount_thickness
@submodel(name="shoulder-joint")