feat: Child guard to prevent collision in shoulder
This commit is contained in:
parent
433a553957
commit
560e9b54dd
|
@ -252,14 +252,19 @@ class ShoulderJoint(Model):
|
||||||
parent_lip_ext: float = 40.0
|
parent_lip_ext: float = 40.0
|
||||||
parent_lip_guard_height: float = 8.0
|
parent_lip_guard_height: float = 8.0
|
||||||
|
|
||||||
# Measured from centre of axle
|
# Generates a child guard which covers up the internals. The lip length is
|
||||||
child_lip_length: float = 45.0
|
# 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_lip_width: float = 20.0
|
||||||
child_conn_hole_diam: float = 6.0
|
child_conn_hole_diam: float = 6.0
|
||||||
# Measured from centre of axle
|
# 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
|
child_core_thickness: float = 3.0
|
||||||
|
|
||||||
|
|
||||||
# Rotates the torsion joint to avoid collisions or for some other purpose
|
# Rotates the torsion joint to avoid collisions or for some other purpose
|
||||||
axis_rotate_bot: float = 225.0
|
axis_rotate_bot: float = 225.0
|
||||||
axis_rotate_top: float = -225.0
|
axis_rotate_top: float = -225.0
|
||||||
|
@ -345,7 +350,6 @@ class ShoulderJoint(Model):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
joint = self.torsion_joint
|
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)
|
assert all(r < self.child_lip_length for r in self.child_conn_hole_pos)
|
||||||
|
|
||||||
# Half of the height of the bridging cylinder
|
# Half of the height of the bridging cylinder
|
||||||
|
@ -371,6 +375,30 @@ class ShoulderJoint(Model):
|
||||||
.assemble()
|
.assemble()
|
||||||
.circle(radius_core_inner, mode='s')
|
.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 = (
|
core = (
|
||||||
Cq.Workplane('XY')
|
Cq.Workplane('XY')
|
||||||
.placeSketch(core_profile1)
|
.placeSketch(core_profile1)
|
||||||
|
@ -381,6 +409,7 @@ class ShoulderJoint(Model):
|
||||||
.toPending()
|
.toPending()
|
||||||
.extrude(dh * 2)
|
.extrude(dh * 2)
|
||||||
.translate(Cq.Vector(0, 0, -dh))
|
.translate(Cq.Vector(0, 0, -dh))
|
||||||
|
.union(core_guard)
|
||||||
)
|
)
|
||||||
assert self.child_lip_width / 2 <= joint.radius_rider
|
assert self.child_lip_width / 2 <= joint.radius_rider
|
||||||
lip_thickness = joint.rider_disk_height
|
lip_thickness = joint.rider_disk_height
|
||||||
|
@ -391,15 +420,6 @@ class ShoulderJoint(Model):
|
||||||
hole_loc=self.child_conn_hole_pos,
|
hole_loc=self.child_conn_hole_pos,
|
||||||
hole_diam=self.child_conn_hole_diam,
|
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
|
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_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)
|
||||||
|
@ -412,9 +432,9 @@ class ShoulderJoint(Model):
|
||||||
.add(joint.rider(rider_slot_begin=180), name="rider_bot",
|
.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)
|
loc=loc_axis_rotate_bot * Cq.Location((0, 0, -dh), (0, 0, 1), -90) * loc_rotate)
|
||||||
.add(lip, name="lip_top",
|
.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",
|
.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
|
return result
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class WingProfile(Model):
|
||||||
|
|
||||||
self.shoulder_joint.angle_neutral = -self.shoulder_angle_neutral - self.shoulder_angle_bias
|
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_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
|
assert self.spacer_thickness == self.root_joint.child_mount_thickness
|
||||||
|
|
||||||
@submodel(name="shoulder-joint")
|
@submodel(name="shoulder-joint")
|
||||||
|
|
Loading…
Reference in New Issue