Browse Source

robot axle in progress

master
wes 8 months ago
parent
commit
294e66e703
  1. 12
      amp_case.py
  2. 132
      robot_wheel_axle.py

12
amp_case.py

@ -121,7 +121,7 @@ result = result.cut(panel_holes_2)
back = (
result.workplane(offset=-6.3)
.center(-(amp_width) + 2, 0)
.box(panel_width * 2.5, amp_width + side_width, amp_height + 3)
.box(panel_width * 2.5, amp_width + side_width, amp_height + 4)
)
back_screws = (
@ -161,11 +161,11 @@ top = (
.line(0, amp_width, forConstruction=True)
.vertices()
.box(amp_length - side_width - 10, 2.0, 0.5)
.workplane(offset=-1)
.workplane(offset=-1.5)
.center(5, amp_width - side_width * 3)
.box(amp_width / 1.5, amp_height / 2, 1)
.box(amp_width / 1.5, amp_height / 2, 3.2)
.center(0, -((amp_height / 2) + side_width * 2))
.box(amp_width / 1.5, amp_height / 2, 1)
.box(amp_width / 1.5, amp_height / 2, 3.2)
)
result = result.cut(back_screws)
@ -181,9 +181,9 @@ cq.exporters.export(back, "/home/deck/model_files/amp_case_back.step")
cq.exporters.export(top, "/home/deck/model_files/amp_case_top.step")
try:
show_object(back)
# show_object(back)
# show_object(front_text)
# show_object(result)
# show_object(top)
show_object(top)
except NameError:
pass

132
robot_wheel_axle.py

@ -0,0 +1,132 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
from cq_warehouse.fastener import *
from cq_warehouse.thread import *
from cqmore.curve import archimedeanSpiral, circle
from cqmore.polygon import regularPolygon, star
from cqmore.polyhedron import polarZonohedra, Polyhedron, superellipsoid
from svg_path import addSvgPath
from svgpathtools import svg2paths
import cadquery as cq
import cqmore
from cq_gears import (
SpurGear,
Worm,
HerringboneGear,
RackGear,
HerringboneRackGear,
BevelGear,
BevelGearPair,
)
simple = False
screw = ButtonHeadScrew(
size="M6-1", fastener_type="iso7380_1", length=15 * MM, simple=simple
)
scaled_screw = screw.scale(0.9)
outer_screw = ButtonHeadScrew(
size="M3-0.5", fastener_type="iso7380_1", length=12 * MM, simple=simple
)
scaled_outer_screw = outer_screw.scale(0.95)
outer_screw_plane = (
Workplane()
.union(scaled_outer_screw)
.workplane(offset=4)
.cylinder(8, 8, combine="cut")
.workplane(offset=4)
.cylinder(3, 4)
)
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
outer_axle_diameter = 14.1 # how wide the part in the wheel you press it into is
outer_axle_radius = outer_axle_diameter / 2
outer_axle_length = 30 # length of the first part that sticks in the wheel
second_outer_axle_length = 2.5 # length of the part after the part that sticks in the wheel that it spins against
inner_axle_length = 4
inner_axle_diameter = 1.8
wheel_axle_outer = Workplane().workplane(invert=True).union(scaled_screw)
wheel_axle_outer = (
wheel_axle_outer.workplane(offset=0, invert=True)
.makePolygon(
regularPolygon(
nSides=6,
radius=outer_axle_radius,
thetaStart=0,
thetaEnd=360,
)
)
.extrude(outer_axle_length)
)
wheel_axle_outer = wheel_axle_outer.workplane(
offset=outer_axle_length / 2, invert=True
).cylinder(second_outer_axle_length, outer_axle_diameter)
wheel_axle_outer = wheel_axle_outer.workplane(offset=12, invert=False).cylinder(
inner_axle_length, inner_axle_diameter * 2
)
wheel_axle_outer = wheel_axle_outer.workplane(offset=-13.8).threadedHole(
scaled_outer_screw, 6, simple=simple, fit="Loose"
)
inner_nut = (
Workplane()
.cylinder(second_outer_axle_length + 1, outer_axle_diameter)
.workplane(offset=5)
.threadedHole(screw, 6, simple=simple, fit="Loose")
)
main_axle_length = 100 # how wide the robot will be basically
main_axle_diameter = 12
main_axle_radius = main_axle_diameter / 2
main_axle = (
Workplane()
.makePolygon(
regularPolygon(
nSides=6,
radius=main_axle_radius,
thetaStart=0,
thetaEnd=360,
)
)
.extrude(main_axle_length)
)
main_axle = (
main_axle.workplane(offset=0)
.line(main_axle_length - 10, 0, forConstruction=True)
.rotateAboutCenter((0, main_axle_length - 10, 0), 90)
.vertices()
.translate((-((main_axle_length / 2) - 5), 25, 0))
.box(6, 49, 1.1) # ends up being about 45 mm
)
cq.exporters.export(
wheel_axle_outer, "/home/deck/model_files/robot_wheel_axle_outer.step"
)
cq.exporters.export(inner_nut, "/home/deck/model_files/robot_wheel_axle_nut.step")
cq.exporters.export(
outer_screw_plane, "/home/deck/model_files/robot_wheel_axle_outer_screw.step"
)
cq.exporters.export(main_axle, "/home/deck/model_files/robot_wheel_axle_main.step")
try:
# show_object(inner_nut)
# show_object(wheel_axle_outer)
# show_object(outer_screw_plane)
show_object(main_axle)
except NameError:
pass
Loading…
Cancel
Save