Add features to x nut mount TODO make z nut mount

This commit is contained in:
Kelvin Ly 2025-03-22 01:12:16 -04:00
parent 2f0c46dcdf
commit 8a9df2a62b
1 changed files with 35 additions and 9 deletions

View File

@ -96,14 +96,19 @@ class Gantry:
.rect(column_spacing + tube_w, tube_w)
.extrude(plate_z)
)
self.ball_screw_w = w.transformed(
offset=(
ballscrew_len / 2 - (-15 - 39 + 25 + 10 - 7 / 2 - 20 / 2) / 2,
ballscrew_x_offset,
(upper_center + lower_center) / 2,
),
rotate=(0, 0, 90),
).transformed(rotate=(0, 90, 0))
self.ball_screw_w = (
cq.Workplane()
.copyWorkplane(w)
.transformed(
offset=(
ballscrew_len / 2 - (-15 - 39 + 25 + 10 - 7 / 2 - 20 / 2) / 2,
ballscrew_x_offset,
(upper_center + lower_center) / 2,
),
rotate=(0, 0, 90),
)
.transformed(rotate=(0, 90, 0))
)
self.ball_screw_model = SFU1204(self.ball_screw_w, ballscrew_len)
self.floating_mount_w = self.ball_screw_w.transformed(
offset=(0, ballscrew_len + (-10 + 7 / 2 + 20 / 2), 0), rotate=(-90, 0, 0)
@ -372,7 +377,7 @@ class Carriage:
.copyWorkplane(rbolster_w)
.rect(bolster_w, carriage_h)
.extrude(bolster_z)
.copyWorkplane(lbolster_w.transformed(rotate=(0, 180, 0)))
.copyWorkplane(rbolster_w.transformed(rotate=(0, 180, 0)))
.pushPoints(points)
.hole(3)
)
@ -399,6 +404,27 @@ class Carriage:
.rect(60, 60)
.extrude(64)
)
self.x_nut_mount = gantry.ball_screw_model.nutHoles(
self.x_nut_mount, x + carriage_w / 2
)
self.x_nut_mount = self.x_nut_mount.copyWorkplane(
gantry.ball_screw_model.w.transformed(
offset=(0, x + carriage_w / 2, 0), rotate=(90, 0, 0)
),
).hole(14)
def nut_mount_holes(s, forward=True):
return (
s.copyWorkplane(back)
.center(-x - HGR20.L - x_carriage_spacing / 2, -x_rail_spacing / 2)
.transformed(rotate=(0 if forward else 180, 0, 0))
.rect(44, 44)
.vertices()
.hole(5)
)
self.x_nut_mount = nut_mount_holes(self.x_nut_mount)
self.plate = nut_mount_holes(self.plate, forward=False)
# these are filled in by the carrier
self.z_nut_mount = None