refactor(cad): wrap the drive_shaft_mount code in a function for organization
This commit is contained in:
+5
-1
@@ -1,6 +1,7 @@
|
|||||||
# pyright: reportUnusedCallResult=false, reportWildcardImportFromLibrary=false
|
# pyright: reportUnusedCallResult=false, reportWildcardImportFromLibrary=false
|
||||||
from build123d import *
|
from build123d import *
|
||||||
|
|
||||||
|
def build_drive_shaft_mount():
|
||||||
bearing_offset = 20
|
bearing_offset = 20
|
||||||
bearing_diameter = 22
|
bearing_diameter = 22
|
||||||
bearing_through_hole_diameter = 15
|
bearing_through_hole_diameter = 15
|
||||||
@@ -28,7 +29,7 @@ assert (bearing_offset - screw_blocks_height) >= 0
|
|||||||
|
|
||||||
|
|
||||||
with BuildPart() as drive_shaft_mount:
|
with BuildPart() as drive_shaft_mount:
|
||||||
with BuildSketch() as sketch:
|
with BuildSketch():
|
||||||
with BuildLine() as profile:
|
with BuildLine() as profile:
|
||||||
l1 = Line(
|
l1 = Line(
|
||||||
(0,0),
|
(0,0),
|
||||||
@@ -82,5 +83,8 @@ with BuildPart() as drive_shaft_mount:
|
|||||||
with Locations(drive_shaft_mount.faces().filter_by(Plane.XZ).sort_by(Axis.Y)[-2:]):
|
with Locations(drive_shaft_mount.faces().filter_by(Plane.XZ).sort_by(Axis.Y)[-2:]):
|
||||||
CounterBoreHole(screw_body_diameter / 2, screw_head_diameter / 2, screw_head_depth)
|
CounterBoreHole(screw_body_diameter / 2, screw_head_diameter / 2, screw_head_depth)
|
||||||
|
|
||||||
|
return drive_shaft_mount
|
||||||
|
|
||||||
|
drive_shaft_mount = build_drive_shaft_mount()
|
||||||
assert drive_shaft_mount.part is not None
|
assert drive_shaft_mount.part is not None
|
||||||
export_step(drive_shaft_mount.part, "drive shaft mount.step")
|
export_step(drive_shaft_mount.part, "drive shaft mount.step")
|
||||||
|
|||||||
Reference in New Issue
Block a user