Browse Source

adding a bunch of stuff

master
wes 5 months ago
parent
commit
13a802d056
  1. 59
      battery_cover.py
  2. 27
      book_stand.py
  3. 1
      enclosure.py
  4. 92
      fan_control_box.py
  5. 24
      hair_dryer_holder.py
  6. 59
      hexdriver_holder.py
  7. 59
      modified_enclosure_back.py
  8. 88
      music_player_case.py
  9. 26
      potentiometer_washer.py
  10. 23
      robot_wheel_axle.py
  11. 64
      screwdriver_holder.py
  12. 40
      stick.py
  13. 35
      tongs_part.py
  14. 61
      vacuum_adapter.py

59
battery_cover.py

@ -0,0 +1,59 @@
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 math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
side_notch_distance = 3.3 # how far from the main part to the side notch
side_notch_width = 4.0 # width of the side notch
side_notch_thickness = 1.5
side_notch_height = 3
width = 57.5
height = 44.5
# 6.3 x 7.11
side_width = 3.7
side_height = 7.11
side_thickness = 1.9
tooth_dist_from_side = 7.45
result = Workplane()
result = result.box(side_thickness, width, height)
result = (
result.workplane(offset=-(width / 2) + side_width)
.move(0, -(width / 2) + (side_width/2) + tooth_dist_from_side)
.line(0, width - tooth_dist_from_side*2 - side_width, forConstruction=True)
.vertices()
.box(side_thickness, side_width, side_height)
)
result = (
result
.workplane(offset=(height/2))
.box(side_thickness, width + side_notch_distance*2 + side_notch_width*2, side_notch_distance)
.workplane(offset=(height/2) - side_notch_width + 0.5)
.move(0, -(width/2) - (side_notch_distance + side_notch_width/2) + side_notch_distance/2)
.line(0, width + side_notch_distance*2 + side_notch_width - side_notch_distance, forConstruction=True)
.vertices()
.box(side_notch_thickness, side_notch_width - 2, side_notch_height)
)
cq.exporters.export(result, "/home/deck/model_files/mask_battery_cover.step")
try:
show_object(result)
except NameError:
pass

27
book_stand.py

@ -0,0 +1,27 @@
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 math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
book_width = 200
book_thickness = 13
result = Workplane().box(book_width, book_thickness, book_thickness)
cq.exporters.export(result, "/home/deck/model_files/book_stand.step")
try:
show_object(result)
except NameError:
pass

1
enclosure.py

@ -181,6 +181,7 @@ if p_flipLid:
result = topOfLid.union(bottom)
cq.exporters.export(bottom, "/home/deck/model_files/enclosure_bottom.step")
cq.exporters.export(topOfLid, "/home/deck/model_files/enclosure_lid.step")
try:
show_object(bottom)

92
fan_control_box.py

@ -0,0 +1,92 @@
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 math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
gland_diameter = 15
barrel_diameter = 11
# digikey perfboard
# It's the distance to the *middle* of the hole
breadboard_height = 81
breadboard_width = 50.8
bb_hole_dist_from_top = 5.37
bb_hole_dist_from_side = 25.23
bb_hole_diameter = 2.76
# buck converter
bc_height = 43.18
bc_width = 31.16
bc_hole_dist_from_top = 6.44
bc_hole_dist_from_side = 2.21 # distance to middle of hole as before, also it's the distance from the closer side
bc_hole_diameter = 4.18
# large buck converter
lbc_height = 57.8
lbc_width = 57.8
lbc_hole_dist_from_top = 4.5
lbc_hole_dist_from_side = 25.8
lbc_hole_diameter = 6.83
wall_thickness = 3
box_height = 115 + wall_thickness
box_width = 157 + wall_thickness
box_thickness = 25
pole_dist = 15
pole_dist = 15
pole_height = 24.5
lower_box = Workplane()
lower_box = (
lower_box.box(box_height, box_width, box_thickness)
.workplane(offset=1)
.box(
box_height - wall_thickness,
box_width - wall_thickness,
box_thickness,
combine="cut",
)
)
lower_box = (
lower_box
.workplane(offset=(pole_height/4))
.rect(
box_height - wall_thickness - pole_dist, box_width - wall_thickness - pole_dist
)
.vertices()
.cylinder(pole_height, 5)
.workplane(offset=(pole_height/4))
.rect(
box_height - wall_thickness - pole_dist, box_width - wall_thickness - pole_dist
)
.vertices()
.cylinder(pole_height, 1, combine="cut")
)
cq.exporters.export(lower_box, "/home/deck/model_files/fan_control_box_lower.step")
try:
show_object(lower_box)
except NameError:
pass

24
hair_dryer_holder.py

@ -0,0 +1,24 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
import cadquery as cq
result = Workplane()
length = 34
width = 10
height = 80
# l, w, h
result = result.box(length, width, height)
result = result.workplane(offset=-10).center(0, 0).box(length/2, width, height, combine="cut")
result = result.workplane(offset=-30).center(10, 0).box(length/2, width, height, combine="cut")
result = result.workplane(offset=-height/2).center(-30, -2.5).box(20, 5, 5)
result = result.workplane(offset=-height/2+10).center(-7.5, 0).box(5, 5, 20)
cq.exporters.export(result, "/home/deck/model_files/hair_dryer_holder.step")
try:
show_object(result)
except NameError:
pass

59
hexdriver_holder.py

@ -0,0 +1,59 @@
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 math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
shelf_width = 4.0
driver_diameter = 19
driver_radius = driver_diameter / 2
holder_width = 35
holder_thickness = 5
holder_length = holder_width * 6
shelf_hold_height = 20
result = Workplane()
result = result.box(holder_length, holder_width, holder_thickness).center(
-holder_length / 2, 0
)
offset = 26
for i in range(1, 8):
result = result.center(offset, 0)
result = result.cylinder(holder_thickness + 1, driver_radius, combine="cut")
result = (
result.workplane(offset=(shelf_hold_height / 2) - (holder_thickness / 2))
.center(-(holder_length / 2) + holder_width / 1.25, holder_width / 2 + 6)
.box(holder_length, shelf_width * 3, shelf_hold_height)
)
result = (
result.workplane(offset=(shelf_hold_height / 2) - (holder_thickness / 2))
.box(holder_length, shelf_width, shelf_hold_height, combine="cut")
)
result = result.center(-holder_length/2-offset, 0)
for i in range(1, 10):
result = result.center(offset, 0)
result = result.box(18, shelf_width*4, holder_width, combine="cut")
cq.exporters.export(result, "/home/deck/model_files/hexdriver_holder.step")
try:
show_object(result)
except NameError:
pass

59
modified_enclosure_back.py

@ -0,0 +1,59 @@
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 math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
width = 154
height = 182
holes_plane = (
Workplane("XZ")
.workplane(offset=-2)
.center(85, height - 75)
.cylinder(8, 14 / 2)
.center(-20, 0)
.cylinder(8, 14 / 2)
.center(10, 20)
.cylinder(8, 17 / 2)
)
magnet_holes_plane = (
Workplane("XZ")
.workplane(offset=-2)
.center(20, height - 100)
.cylinder(12, 2)
.center(0, -90)
.cylinder(12, 2)
)
cover_usb = Workplane("XZ").workplane(offset=-4.5).center(-4, height - 77).box(11, 5.3, 1.0)
result = cq.importers.importStep("/home/deck/Downloads/Backpanel_Part3.stp")
result = result.cut(holes_plane)
#result = result.union(magnet_holes_plane)
result = result.union(cover_usb)
# magnet distance should be 90 mm apart
test_piece = Workplane().workplane(offset=110).center(70, 0).box(80, 4, 60).cut(holes_plane)
cq.exporters.export(result, "/home/deck/model_files/modified_backpanel_part_3.step")
cq.exporters.export(test_piece, "/home/deck/model_files/modified_backpanel_test_piece.step")
try:
show_object(result)
except NameError:
pass

88
music_player_case.py

@ -0,0 +1,88 @@
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,
)
headphone_diameter = 6.0
headphone_radius = headphone_diameter / 2.0
usb_width = 15
usb_height = 6.8
cut_offset = 5.0
player_height = 14 + cut_offset
player_length = 57.8
player_width = 62 + cut_offset
headphone_dist_from_side = 12.2
usb_dist_from_side = 22
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
result = Workplane()
result = result.box(player_length, player_width, player_height)
result = result.workplane(offset=5).box(
player_length - cut_offset,
player_width - cut_offset,
player_height + cut_offset,
combine="cut",
)
result = (
result.workplane(offset=3)
.move(2.5, 0)
.box(
player_length,
player_width - cut_offset,
player_height - cut_offset,
combine="cut",
)
)
headphone_hole = (
Workplane("XZ")
.workplane(offset=30)
.move((player_width / 2) - cut_offset - headphone_dist_from_side - 2.2, 1.2)
.cylinder(10, headphone_radius)
)
usb_hole = (
Workplane("XZ")
.workplane(offset=30)
.move((player_width / 2) - cut_offset - usb_dist_from_side - 4, 0.5)
.box(usb_width, usb_height, 10)
)
result = result.cut(headphone_hole)
result = result.cut(usb_hole)
top_back_text = Workplane("YX").workplane(offset=9).center(0, 5).text("If you find this", 3, 4)
back_text = Workplane("YX").workplane(offset=9).text("Email wes@wesk.tech for a reward", 3, 4)
result = result.cut(top_back_text)
result = result.cut(back_text)
cq.exporters.export(result, "/home/deck/model_files/music_player_case.step")
try:
show_object(result)
except NameError:
pass

26
potentiometer_washer.py

@ -0,0 +1,26 @@
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 math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
result = Workplane()
result = result.cylinder(0.4, 13/2)
result = result.cylinder(2, 6.65/2, combine="cut")
cq.exporters.export(result, "/home/deck/model_files/potentiomer_washer.step")
try:
show_object(result)
except NameError:
pass

23
robot_wheel_axle.py

@ -53,6 +53,11 @@ second_outer_axle_length = 2.5 # length of the part after the part that sticks
inner_axle_length = 13.2
inner_axle_diameter = 1.8
servo_diameter = 4.75
servo_radius = servo_diameter / 2
servo_outer_diameter = 8
servo_outer_radius = servo_outer_diameter / 2
wheel_axle_outer = Workplane().workplane(invert=True).union(scaled_screw)
wheel_axle_outer = (
@ -118,11 +123,19 @@ main_axle = (
.vertices()
.translate((-((main_axle_length / 2) - 5), 49, 3))
.hole(7.5, 10)
# .faces(">Y[0]")
# .makePolygon(regularPolygon(nSides=3, radius=20, thetaStart=0, thetaEnd=360))
# .extrude(10)
)
servo_peg = (
Workplane("XZ")
.center(0, main_axle_length / 2)
.workplane(offset=13)
.cylinder(7, servo_outer_radius)
.workplane(offset=13)
.cylinder(30, servo_radius, combine="cut")
)
main_axle = main_axle.union(servo_peg)
cq.exporters.export(
wheel_axle_outer, "/home/deck/model_files/robot_wheel_axle_outer.step"
)
@ -134,8 +147,8 @@ cq.exporters.export(main_axle, "/home/deck/model_files/robot_wheel_axle_main.ste
try:
# show_object(inner_nut)
show_object(wheel_axle_outer)
# show_object(wheel_axle_outer)
# show_object(outer_screw_plane)
# show_object(main_axle)
show_object(main_axle)
except NameError:
pass

64
screwdriver_holder.py

@ -0,0 +1,64 @@
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 math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
shelf_width = 4
holder_width = 15
holder_thickness = 3
shelf_hold_height = 20
hook_distance = 110 # from left side of left hook to right side of right hook
hook_width = 2.8
hook_height = 5
hook_hole_diameter = 7.5
hook_hole_radius = hook_hole_diameter / 2
hook_cylinder_length = 8
holder_length = hook_distance + hook_hole_diameter + 5
result = Workplane()
result = result.box(holder_length, holder_width, holder_thickness)
result = (
result.center(-((holder_length / 2) - hook_hole_diameter * 1.3), 0)
.workplane(offset=holder_thickness+2)
.line(hook_distance - hook_hole_radius * 2, 0, forConstruction=True)
.vertices()
.cylinder(hook_cylinder_length, hook_hole_radius)
.workplane(offset=holder_thickness+3)
.move(0, 5)
.line(hook_distance - hook_hole_radius * 2, 0, forConstruction=True)
.vertices()
.box(hook_width, hook_height, hook_width)
.workplane(offset=-holder_thickness - 2)
.move(holder_width, holder_width/2)
.line(holder_width*5, 0, forConstruction=True)
.vertices()
.box(holder_width, shelf_hold_height, holder_thickness*4)
.workplane(offset=-holder_thickness + 1)
.move(holder_width/2, holder_width/2 - 2)
.line(holder_width*5, 0, forConstruction=True)
.vertices()
.box(holder_width*2, shelf_hold_height, shelf_width, combine="cut")
)
cq.exporters.export(result, "/home/deck/model_files/screwdriver_holder.step")
try:
show_object(result)
except NameError:
pass

40
stick.py

@ -0,0 +1,40 @@
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,
)
result = Workplane().cylinder(180, 15)
result = result.workplane(offset=85).sphere(19)
slot = Workplane("ZY").move(90, 0).cylinder(1, 15).cylinder(1, 13.5, combine="cut")
result = result.cut(slot)
result = result.workplane(offset=-(180 / 2)).move(-20, 0).sphere(20)
result = result.workplane(offset=-(180 / 2) + 13).move(20, 0).sphere(20)
result = result.workplane(offset=(-(180 / 2) + 15)).cylinder(30, 50, combine="cut")
cq.exporters.export(result, "/home/deck/model_files/stick.step")
try:
show_object(result)
except NameError:
pass

35
tongs_part.py

@ -0,0 +1,35 @@
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 math import ceil, floor
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
part_diameter = 3.54
part_radius = part_diameter / 2
part_height = 24
result = Workplane()
result = result.cylinder(part_height, part_radius)
result = result.workplane(offset=part_height/2).cylinder(2, part_radius + 1)
end_piece = Workplane()
end_piece = end_piece.cylinder(2, part_radius*4)
end_piece = end_piece.cylinder(6, part_radius-0.3, combine="cut")
cq.exporters.export(result, "/home/deck/model_files/tongs_part.step")
cq.exporters.export(end_piece, "/home/deck/model_files/tongs_part_end_piece.step")
try:
show_object(end_piece)
except NameError:
pass

61
vacuum_adapter.py

@ -0,0 +1,61 @@
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,
)
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
adapter_diameter = 30.3
adapter_radius = adapter_diameter / 2.0
adapter_height = 50
adapter_thickness = 3 # how thick the side is
end_part_height = 150 # how long the end part is
end_part_width = 10
side_cut = Workplane("ZX")
side_cut = (
side_cut.workplane(offset=-end_part_width)
.move(-(adapter_height + end_part_height - 50), 43)
.makePolygon(
regularPolygon(
nSides=3,
radius=60,
thetaStart=30,
thetaEnd=360 - 30,
)
)
.extrude(50)
)
result = Workplane()
result = result.cylinder(adapter_height, adapter_radius + adapter_thickness)
result = result.workplane(offset=5).cylinder(adapter_height, adapter_radius, combine="cut")
result = result.workplane(offset=-adapter_height*1.9).box(end_part_width, end_part_width, end_part_height)
result = result.workplane(offset=0).box(8, 8, 400, combine="cut")
result = result.cut(side_cut)
cq.exporters.export(result, "/home/deck/model_files/vacuum_adapter.step")
try:
show_object(result)
except NameError:
pass
Loading…
Cancel
Save