feat(cad): modify the bearing hole to actually hold the bearing
This commit is contained in:
+17
-12
@@ -1,14 +1,16 @@
|
|||||||
# pyright: reportUnusedCallResult=false, reportWildcardImportFromLibrary=false
|
# pyright: reportUnusedCallResult=false, reportWildcardImportFromLibrary=false
|
||||||
from build123d import *
|
from build123d import *
|
||||||
|
|
||||||
hole_offset = 20
|
bearing_offset = 20
|
||||||
hole_diameter = 22
|
bearing_diameter = 22
|
||||||
|
bearing_through_hole_diameter = 15
|
||||||
|
bearing_height = 8
|
||||||
|
|
||||||
core_width = 40
|
core_width = 40
|
||||||
thickness = 20
|
thickness = 20
|
||||||
|
|
||||||
screw_blocks_width = thickness
|
screw_blocks_width = thickness
|
||||||
screw_blocks_height = hole_offset
|
screw_blocks_height = bearing_offset
|
||||||
screw_blocks_radius = 3
|
screw_blocks_radius = 3
|
||||||
|
|
||||||
screw_head_diameter = 8.5
|
screw_head_diameter = 8.5
|
||||||
@@ -18,10 +20,10 @@ screw_body_diameter = 5
|
|||||||
track_width = 6.2
|
track_width = 6.2
|
||||||
track_height = 1.8
|
track_height = 1.8
|
||||||
|
|
||||||
assert (hole_offset - hole_diameter / 2) > 0
|
assert (bearing_offset - bearing_diameter / 2) > 0
|
||||||
assert (core_width - hole_diameter) > 0
|
assert (core_width - bearing_diameter) > 0
|
||||||
assert (screw_blocks_width - (screw_blocks_radius * 2)) >= 0
|
assert (screw_blocks_width - (screw_blocks_radius * 2)) >= 0
|
||||||
assert (hole_offset - screw_blocks_height) >= 0
|
assert (bearing_offset - screw_blocks_height) >= 0
|
||||||
|
|
||||||
|
|
||||||
with BuildPart() as builder:
|
with BuildPart() as builder:
|
||||||
@@ -37,7 +39,7 @@ with BuildPart() as builder:
|
|||||||
((l1 @ 1).X, screw_blocks_height),
|
((l1 @ 1).X, screw_blocks_height),
|
||||||
(core_width / 2, screw_blocks_height),
|
(core_width / 2, screw_blocks_height),
|
||||||
)
|
)
|
||||||
match (float)(hole_offset - screw_blocks_height):
|
match (float)(bearing_offset - screw_blocks_height):
|
||||||
case 0:
|
case 0:
|
||||||
FilletPolyline(
|
FilletPolyline(
|
||||||
*polyline_path,
|
*polyline_path,
|
||||||
@@ -50,26 +52,29 @@ with BuildPart() as builder:
|
|||||||
)
|
)
|
||||||
Line(
|
Line(
|
||||||
sbl @ 1,
|
sbl @ 1,
|
||||||
((sbl @ 1).X, hole_offset)
|
((sbl @ 1).X, bearing_offset)
|
||||||
)
|
)
|
||||||
case len if len >= screw_blocks_radius:
|
case len if len >= screw_blocks_radius:
|
||||||
FilletPolyline(
|
FilletPolyline(
|
||||||
*polyline_path,
|
*polyline_path,
|
||||||
(core_width / 2, hole_offset),
|
(core_width / 2, bearing_offset),
|
||||||
radius=screw_blocks_radius
|
radius=screw_blocks_radius
|
||||||
)
|
)
|
||||||
case _: assert False
|
case _: assert False
|
||||||
|
|
||||||
CenterArc((0, hole_offset), core_width / 2, 90, -90)
|
CenterArc((0, bearing_offset), core_width / 2, 90, -90)
|
||||||
mirror(profile.line, Plane.YZ)
|
mirror(profile.line, Plane.YZ)
|
||||||
make_face()
|
make_face()
|
||||||
|
|
||||||
with Locations((0, hole_offset)):
|
with Locations((0, bearing_offset)):
|
||||||
Circle(hole_diameter / 2, mode=Mode.SUBTRACT)
|
Circle(bearing_through_hole_diameter / 2, mode=Mode.SUBTRACT)
|
||||||
|
|
||||||
extrude(amount=thickness / 2)
|
extrude(amount=thickness / 2)
|
||||||
mirror(about=Plane.XY)
|
mirror(about=Plane.XY)
|
||||||
|
|
||||||
|
with Locations((0, bearing_offset, builder.faces().sort_by(Axis.Z)[-1].center().Z)):
|
||||||
|
Hole(bearing_diameter / 2, bearing_height)
|
||||||
|
|
||||||
Box(core_width + (screw_blocks_width * 2), track_width, track_height, (90, 0, 0), (Align.CENTER, Align.CENTER, Align.MIN))
|
Box(core_width + (screw_blocks_width * 2), track_width, track_height, (90, 0, 0), (Align.CENTER, Align.CENTER, Align.MIN))
|
||||||
|
|
||||||
with Locations(builder.faces().filter_by(Plane.XZ).sort_by(Axis.Y)[-2:]):
|
with Locations(builder.faces().filter_by(Plane.XZ).sort_by(Axis.Y)[-2:]):
|
||||||
|
|||||||
Reference in New Issue
Block a user