Compare commits

...

40 Commits

Author SHA1 Message Date
wes 2c9b254835 adding carlson probe wip, microscope platform 2 months ago
wes b811fb3d56 finished barbie ps5 stand 3 months ago
wes 84cc329fb5 barbie ps5 3 months ago
wes 66940139f5 fix usb cover 4 months ago
wes e988233094 add spinner and changes to back panel 4 months ago
wes 909a059801 fix offsets 5 months ago
wes ec9221dc3e adding xmas tree spinner + lid for fan control 5 months ago
wes fab386064b adding lip plus gland holes 5 months ago
wes b53b7b7380 fix breadboard hole spacing 5 months ago
wes b6ead6c281 various improvements to enclosure 5 months ago
wes 2aa81b9691 fix offsets 5 months ago
wes 2a3f202c5f screws almost fitting 5 months ago
wes 68afbc7d6d refactoring fan control box 6 months ago
wes a056af8a55 working function for generating component holders 6 months ago
wes 5e464a0ab9 formatting 6 months ago
wes 3493f44b67 adding a bunch of stuff 6 months ago
wes e009f921b4 adding air quality sensor 6 months ago
wes dc0cf461f6 curtain holder, formatting 6 months ago
wes 13a802d056 adding a bunch of stuff 7 months ago
wes a2eed9fa96 add missing stuff to enclosure bottom 7 months ago
wes cdd4f0bde0 adjust offset 9 months ago
wes 48acd547fe formatting 9 months ago
wes 294e66e703 robot axle in progress 10 months ago
wes a5b8ab2832 add indentations on top cover 10 months ago
wes f6c96547cc fix screw dimensions 10 months ago
wes 6ceccd00db top piece wip 10 months ago
wes b80381d790 text / icon adjustments 10 months ago
wes 63c39d632e increase icon, add middle divider 10 months ago
wes fbb9c8fc6f formatting 10 months ago
wes 338f072543 make smaller, fix panel 10 months ago
wes 33b4c4c5f9 add slide in, make smaller 10 months ago
wes 536dbb7f5b formatting 10 months ago
wes 21582ddc62 back, chamfer 10 months ago
wes 1299bb6ab4 front panel 10 months ago
wes 27a9c56e7b add front panel 10 months ago
wes f660fd59ba simplify, leave out top, thicken sides 10 months ago
wes 8b783ac168 adjust sizing again 11 months ago
wes 31fa4767c4 add top 11 months ago
wes e79f9a9245 fix dimensions 11 months ago
wes 6d00e17627 beginning of amp case 11 months ago
  1. 98
      air_quality_sensor_enclosure.py
  2. 189
      amp_case.py
  3. 63
      barbie_ps5.py
  4. 71
      battery_cover.py
  5. 27
      book_stand.py
  6. 32
      brush_holder.py
  7. 110
      carlson_amp_enclosure.py
  8. 85
      carlson_amp_probe.py
  9. 57
      curtain_holder.py
  10. 33
      drain_catcher_screw.py
  11. 26
      enclosure.py
  12. 375
      fan_control_box.py
  13. 39
      ghibli_ticket.py
  14. 32
      hair_dryer_holder.py
  15. 52
      hakko_fr301_case_hooks.py
  16. 58
      hexdriver_holder.py
  17. 53
      microscope_platform.py
  18. 118
      modified_enclosure_back.py
  19. 92
      music_player_case.py
  20. 26
      potentiometer_washer.py
  21. 154
      robot_wheel_axle.py
  22. 64
      screwdriver_holder.py
  23. 43
      ssd_bracket.py
  24. 40
      stick.py
  25. 35
      tongs_part.py
  26. 65
      vacuum_adapter.py
  27. 10
      watch_stand.py
  28. 98
      xmas_spinner.py

98
air_quality_sensor_enclosure.py

@ -0,0 +1,98 @@
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
bottom = Workplane()
screw_length = 7
simple = False
screw = ButtonHeadScrew(
size="M3-0.5", fastener_type="iso7380_1", length=screw_length * MM, simple=simple
)
board_thickness = 1.64
wall_offset = 5
w = 26
h = 26
t = 2
screw_diameter = 3.3
screw_radius = screw_diameter / 2.0
hole_dist_from_side = 1.36
bottom = bottom.box(w, h, t)
bottom = bottom.box(w + wall_offset, h + wall_offset, screw_length + t + 3)
bottom = bottom.workplane(offset=t).box(
w + (wall_offset - 2), h + (wall_offset - 2), screw_length + 3, combine="cut"
)
bottom = (
bottom.workplane(offset=1.5)
.rect(
w - hole_dist_from_side - screw_diameter * 2 + 2,
h - hole_dist_from_side - screw_diameter * 2 + 2,
)
.vertices()
.cylinder(screw_length - 1, screw_radius + 1)
)
bottom = (
bottom.workplane(offset=4.5)
.rect(
w - hole_dist_from_side - screw_diameter * 2 + 2,
h - hole_dist_from_side - screw_diameter * 2 + 2,
)
.vertices()
.threadedHole(screw, screw_length - 1, simple=simple)
)
top = Workplane()
top = top.box(w + wall_offset, h + wall_offset, t)
top = (
top.workplane(offset=3.10)
.rect(
w / 4,
h / 2,
)
.vertices()
.cylinder(5.810 - board_thickness, 1.2) # 5.810 = 9 - 3.189
)
top = (
top.faces(">Z[1]")
.rect(
w - hole_dist_from_side - screw_diameter * 2 + 2,
h - hole_dist_from_side - screw_diameter * 2 + 2,
)
.vertices()
.hole(screw_diameter, 10)
)
top = top.workplane().move(0, 13).box(9.7, 3, 10, combine="cut")
top = top.workplane(offset=3).center(0, 0).cylinder(4.17, (4.13 / 2.0) + 0.5)
top = top.workplane(offset=0).center(0, 0).cylinder(15, (4.13 / 2.0), combine="cut")
cq.exporters.export(bottom, "/home/deck/model_files/air_quality_enclosure_bottom.step")
cq.exporters.export(top, "/home/deck/model_files/air_quality_enclosure_top.step")
try:
show_object(top)
except NameError:
pass

189
amp_case.py

@ -0,0 +1,189 @@
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
headphone_path, headphone_attribute = svg2paths(
"/home/deck/cad_files/svgs/headphones.svg"
)
side_width = 5
bottom_width = 5
middle_width = 2
panel_width = 1.5
amp_bottom_height = 19 + bottom_width + middle_width # how tall the pcb is
battery_width = 26
battery_height = 15
amp_width = 62
amp_length = 56
amp_height = battery_height + amp_bottom_height
top_width = 1.3
panel_component_diameter = 7.8
panel_distance = 10.5 + (
panel_component_diameter / 2
) # distance between each panel component
panel_dist_from_side = 2
panel_dist_from_bottom = 0 # how far the panel components are from the bottom
result = Workplane().box(amp_length, amp_width, middle_width)
result = (
result.workplane(offset=0)
.center(0, -(amp_width / 2))
.line(0, amp_width, forConstruction=True)
.vertices()
.box(amp_length, side_width, amp_height)
)
# Back slot for cable
result = (
result.workplane(offset=amp_height / 2)
.center(0, amp_width / 2)
.box(amp_length, amp_width + bottom_width, bottom_width)
.workplane(offset=-10)
.move(-(amp_width / 2), 0)
.box(20, 10, 10, combine="cut")
)
# Front panel
result = (
result.workplane(offset=-6.4)
.center((amp_width / 2) - (panel_width / 2) - 3, 0)
.box(panel_width, amp_width + 5, amp_height + 2.5)
)
in_text = (
Workplane("YZ")
.workplane(offset=(amp_width / 2) - 3.5)
.center(-15, -2)
.text("IN", 7, 2)
.rotateAboutCenter((1, 0, 0), 180)
)
out_text = (
Workplane("YZ")
.workplane(offset=(amp_width / 2) - 3.5)
.center(15, -2)
.text("OUT", 7, 2)
.rotateAboutCenter((1, 0, 0), 180)
)
icon = (
Workplane("YZ")
.workplane(offset=274.5)
.center(-50, -175)
.addSvgPath(headphone_path[0])
.extrude(5)
.val()
.scale(0.10)
)
result = result.cut(in_text)
result = result.cut(out_text)
result = result.cut(icon)
panel_holes = (
Workplane("ZY")
.workplane(offset=-(amp_length / 2))
.center(panel_component_diameter + panel_dist_from_bottom, 0)
.line(0, panel_distance, forConstruction=True)
.vertices()
.cylinder(side_width, panel_component_diameter / 2)
)
panel_holes_2 = (
Workplane("ZY")
.workplane(offset=-(amp_length / 2))
.center(panel_component_diameter + panel_dist_from_bottom, 0)
.line(0, -(panel_distance), forConstruction=True)
.vertices()
.cylinder(side_width, panel_component_diameter / 2)
)
result = result.cut(panel_holes)
result = result.cut(panel_holes_2)
# Back panel
back = (
result.workplane(offset=-6.3)
.center(-(amp_width) + 2, 0)
.box(panel_width * 2.5, amp_width + side_width, amp_height + 4)
)
back_screws = (
Workplane("ZY")
.workplane(offset=(amp_length / 2))
.center(2, 0.0)
.rect(37, amp_width, forConstruction=True)
.vertices()
.cylinder(20, 0.8)
)
back = back.cut(back_screws)
back = back.center(31.5, 0).box(amp_width, amp_width + 9, amp_width, combine="cut")
# Slide in slot for top
result = (
result.workplane(offset=-(amp_height / 2) - side_width - 1)
.center(-70, -(amp_width / 2))
.line(0, amp_width, forConstruction=True)
.vertices()
.box(amp_length * 2, 3.5, 1.0, combine="cut")
.workplane(offset=-(amp_height / 2) - side_width - 2)
.line(0, amp_width, forConstruction=True)
.vertices()
.box(amp_length * 2, 1.5, 1.5, combine="cut")
)
top = (
Workplane()
.box(amp_length, amp_width + side_width - 1, top_width)
.center(-7.3, -(amp_width / 2))
.workplane(offset=-1.0)
.line(0, amp_width, forConstruction=True)
.vertices()
.box(amp_length - side_width - 10, 1.4, 1.6)
.workplane(offset=-2.0)
.line(0, amp_width, forConstruction=True)
.vertices()
.box(amp_length - side_width - 10, 2.0, 0.5)
.workplane(offset=-1.5)
.center(5, amp_width - side_width * 3)
.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, 3.2)
)
result = result.cut(back_screws)
result = (
result.workplane(offset=-(amp_height / 2) + 3)
.center(amp_length - 10.5, amp_width / 2)
.box(amp_length - 9, 2, (amp_height / 2))
)
cq.exporters.export(result, "/home/deck/model_files/amp_case.step")
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(front_text)
# show_object(result)
show_object(top)
except NameError:
pass

63
barbie_ps5.py

@ -0,0 +1,63 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
from svg_path import addSvgPath
from svgpathtools import svg2paths
import cadquery as cq
import cqmore
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
barbie_dim = (30.059, 33.773)
barbie_dim = (barbie_dim[0] - 0.5, barbie_dim[1] - 0.5)
barbie_paths, barbie_attributes = svg2paths("/home/deck/cad_files/svgs/barbie_logo.svg")
cover_logo = Workplane("XZ").workplane(offset=32.1)
cover_logo_2 = Workplane("XZ").workplane(offset=31.1)
cut_logo = Workplane("XZ").workplane(offset=32.200001 - 0.1)
cover_logo = (
cover_logo.move(0, -18)
.box(barbie_dim[1], barbie_dim[0], 2.2)
.rotate((1, 0, 0), (0, 0, 0), 170)
)
cover_logo_2 = (
cover_logo_2.move(0, -18)
.box(barbie_dim[1], barbie_dim[0], 1.2)
.rotate((1, 0, 0), (0, 0, 0), 170)
)
cut_logo = (
cut_logo.move(0, -18)
.box(barbie_dim[1] + 1, barbie_dim[0] + 1, 0.195)
.rotate((1, 0, 0), (0, 0, 0), 170)
)
barbie_logo = (
Workplane("XZ")
.workplane(offset=-32.200001)
.center(-105, -166.5)
.addSvgPath(barbie_paths[0])
.extrude(0.5)
)
barbie_logo = barbie_logo.rotate((1, 0, 0), (0, 0, 0), 190).rotate(
(0, 0, 1), (0, 0, 0), 180
)
result = cq.importers.importStep("/home/deck/Downloads/ps5_stand.step")
result = result.cut(cover_logo)
result = result.union(cover_logo_2)
result = result.union(barbie_logo)
result = result.cut(cut_logo)
cq.exporters.export(result, "/home/deck/model_files/barbie_ps5_stand.stl")
try:
show_object(result)
except NameError:
pass

71
battery_cover.py

@ -0,0 +1,71 @@
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

32
brush_holder.py

@ -0,0 +1,32 @@
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(-40, -2.5).box(30, 5, 5)
result = result.workplane(offset=-height / 2 + 5).center(-12.5, 0).box(5, 5, 8.5)
cq.exporters.export(result, "/home/deck/model_files/brush_holder.stl")
try:
show_object(result)
except NameError:
pass

110
carlson_amp_enclosure.py

@ -0,0 +1,110 @@
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
screw_simple = False # Controls whether to not actually make the screw threads, saves time running it for testing
screw_length = 10
top_screw = ButtonHeadScrew(
size="M3-0.5",
fastener_type="iso7380_1",
length=screw_length * MM,
simple=screw_simple,
)
x_board_size = 36.07
y_board_size = 28.75
hole_dist_x = 22.76
hole_dist_y = 31.29
hole_diameter = 3.44
hole_radius = hole_diameter / 2.0
box_width = 65.0
box_height = 30.0
box_length = 100.0
wall_thickness = 2.0
battery_holder_width = 62.67
battery_holder_length = 57.36
battery_holder_height = 15.83
battery_holder_hole_dist = (
14.76 # distance between the centers of the countersunk holes
)
battery_holer_hole_dist_from_side = (
8.39 # distance from side to middle of the first hole
)
result = (
Workplane()
.box(box_length, box_width, box_height)
.box(
box_length - wall_thickness,
box_width - wall_thickness,
box_height - wall_thickness,
combine="cut",
)
)
top = result.workplane(offset=(box_height / 2) - 2).split(keepTop=True)
top = top.workplane(offset=-1.5).box(
box_length + wall_thickness, box_width + wall_thickness, 2, combine="cut"
)
top = top.workplane(offset=-0.8).box(
box_length - wall_thickness - 0.05, box_width - wall_thickness - 0.05, 1
)
top = (
top.faces(">Z[3]")
.rect(
box_length - 5.5,
box_width - 5.5,
forConstruction=True,
)
.vertices()
.cboreHole(2.0, 3.0, 1.1)
)
bottom = result.workplane(offset=(box_height / 2) - 2).split(keepBottom=True)
bottom = bottom.workplane(offset=box_height + 5).box(
box_length - 1, box_width - 1, box_height, combine="cut"
)
bottom = (
bottom.workplane(offset=(box_height / 2) - 10)
.rect(box_length - 5.5, box_width - 5.5)
.vertices()
.cylinder(box_height - wall_thickness * 1.5, 2.5)
)
bottom = (
bottom.workplane(offset=(box_height / 2) + 3.0)
.rect(box_length - 5.5, box_width - 5.5)
.vertices()
.threadedHole(top_screw, 10, simple=screw_simple, fit="Close", counterSunk=False)
)
cq.exporters.export(bottom, "/home/deck/model_files/carlon_probe_amp_enclosure_box.stl")
cq.exporters.export(top, "/home/deck/model_files/carlon_probe_amp_enclosure_lid.stl")
try:
show_object(bottom)
except NameError:
pass

85
carlson_amp_probe.py

@ -0,0 +1,85 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
from cq_warehouse.fastener import *
from cq_warehouse.thread import *
from svg_path import addSvgPath
from svgpathtools import svg2paths
from cqmore.polygon import regularPolygon
import cadquery as cq
import cqmore
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
probe_diameter = 22.15 # OD of the main probe housing
probe_radius = probe_diameter / 2.0
probe_length = 100.0 # length of the probe housing
coax_diameter = 7.5 # OD diameter of the coax with insulation
coax_radius = coax_diameter / 2.0
ground_cable_diameter = 3.0
ground_cable_radius = ground_cable_diameter / 2.0
wall_width = 2.0
gland_od = 22.0
gland_or = gland_od / 2.0
gland_id = 16
gland_ir = gland_id / 2.0
probe_middle = Workplane()
probe_middle = probe_middle.cylinder(probe_length, probe_radius + wall_width)
probe_middle = probe_middle.cylinder(probe_length - 2, probe_radius, combine="cut")
probe_middle = probe_middle.workplane(offset=probe_length / 2.0).cylinder(
2, coax_radius, combine="cut"
)
probe_middle = (
probe_middle.workplane(offset=probe_length / 2.0)
.move(3, 8)
.cylinder(2, ground_cable_radius, combine="cut")
)
probe_middle = probe_middle.workplane(offset=-(probe_length / 2.0) + 2).cylinder(
2, probe_radius
)
probe_middle = probe_middle.workplane(offset=-(probe_length / 2.0)).cylinder(
11, gland_ir, combine="cut"
)
cable_end_cap = probe_middle.workplane(offset=(-probe_length / 2.0) + 26).split(
keepBottom=True
)
cable_end_cap = (
cable_end_cap.workplane(offset=(-probe_length / 2.0) + 57)
.move(12, 0)
.sphere(2.5, combine="cut")
)
probe_middle = probe_middle.workplane(offset=(-probe_length / 2.0) + 15).split(
keepTop=True
)
probe_end_cap = probe_middle.workplane(offset=15).split(keepTop=True)
probe_middle = (
Workplane()
.makePolygon(
regularPolygon(
nSides=6,
radius=probe_radius * 1.3,
thetaStart=0,
thetaEnd=360,
)
)
.extrude(57.438)
) # Difference between probe length and end caps lengths
probe_middle = probe_middle.cylinder(probe_length, probe_radius + 0.12, combine="cut")
cq.exporters.export(probe_middle, "/home/deck/model_files/carlson_probe_middle.stl")
cq.exporters.export(
cable_end_cap, "/home/deck/model_files/carlson_probe_cable_end_cap.stl"
)
cq.exporters.export(
probe_end_cap, "/home/deck/model_files/carlson_probe_probe_end_cap.stl"
)
try:
show_object(probe_middle)
except NameError:
pass

57
curtain_holder.py

@ -0,0 +1,57 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
import cadquery as cq
result = Workplane()
length = 27
width = 10
height = 30
rod_diameter = 11.0
rod_height = 150
rod_radius = rod_diameter / 2.0
female_hole_height = rod_height / 3.0
rod_female = Workplane()
rod_female = rod_female.cylinder(rod_height, rod_radius)
rod_female = rod_female.workplane(
offset=(rod_height / 2.0) - female_hole_height / 2
).cylinder(female_hole_height, (rod_radius / 2.0) + 0.12, combine="cut")
rod_female = rod_female.workplane(
offset=-(rod_height / 2.0) - (female_hole_height / 2) + 20
).cylinder(female_hole_height - 10, rod_radius / 2.0)
rod_male = Workplane()
rod_male = rod_male.cylinder(rod_height, rod_radius)
rod_male = rod_male.workplane(
offset=(rod_height / 2.0) + (female_hole_height / 2) - 10
).cylinder(female_hole_height - 10, rod_radius / 2.0)
# l, w, h
result = result.box(length, width, height)
result = (
result.workplane(offset=-13)
.center(0, 0)
.box(length / 2, width, height + 13.61, 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/curtain_holder.step")
cq.exporters.export(rod_female, "/home/deck/model_files/curtain_rod_female.step")
cq.exporters.export(rod_male, "/home/deck/model_files/curtain_rod_male.step")
try:
show_object(result)
except NameError:
pass

33
drain_catcher_screw.py

@ -0,0 +1,33 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
from cq_warehouse.fastener import *
from cq_warehouse.thread import *
from cqmore.polygon import regularPolygon, star
import cadquery as cq
import cqmore
Workplane = cqmore.extend(Workplane)
simple = False
bottom_radius = 70
screw = ButtonHeadScrew(
size="M8-1.25", fastener_type="iso7380_1", length=15 * MM, simple=simple
)
scaled_screw = screw.scale(0.77)
screw_result = (
Workplane()
.makePolygon(star(outerRadius=bottom_radius / 4.5, innerRadius=13, n=8))
.extrude(8)
.union(scaled_screw)
)
try:
show_object(screw_result)
except NameError:
pass
cq.exporters.export(screw_result, "/home/deck/model_files/drain_catcher_screw.stl")

26
enclosure.py

@ -1,5 +1,8 @@
import cadquery as cq
usb_h = 10.5
usb_v = 5.2
socket_distance_x = 10.8
socket_distance_y = 36.55
socket_width = 28
@ -121,6 +124,21 @@ bottom = (
.cutBlind("next")
)
holes = (
cq.Workplane("XY")
.rect((p_outerWidth - 20.0 * p_thickness), (p_outerLength - 20.0 * p_thickness))
.vertices()
.cylinder(10, 3.1 / 2)
)
bottom = bottom.cut(holes)
bottom = (
bottom.faces(">Y[0]")
.workplane(offset=0)
.move(0, -(p_outerHeight / 2) - usb_v - 3.3)
.box(usb_h, usb_v, 10, combine="cut")
)
# lid = (lid.center(socket_width-8, socket_distance_y+(socket_width)-3)
# .rect(reset_height, reset_width)
@ -162,4 +180,10 @@ if p_flipLid:
# return the combined result
result = topOfLid.union(bottom)
cq.exporters.export(result, "/home/wes/model_files/enclosure.step")
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)
except NameError:
pass

375
fan_control_box.py

@ -0,0 +1,375 @@
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
screw_simple = False # Controls whether to not actually make the screw threads, saves time running it for testing
screw_length = 10 # FIXME need different ones for different holes
top_screw = ButtonHeadScrew(
size="M3-0.5",
fastener_type="iso7380_1",
length=screw_length * MM,
simple=screw_simple,
)
gland_diameter = 13.2
gland_radius = gland_diameter / 2.0
barrel_diameter = 11
barrel_radius = barrel_diameter / 2.0
# digikey perfboard
# It's the distance to the *middle* of the hole
breadboard_height = 68.68
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 = 29.83 # from center of hole to other hole
bc_width = 15.5 # from center of hole to other hole, but horizontally
# large buck converter
lbc_height = 63.18
lbc_width = 57.8
lbc_hole_dist_from_top = 4.5
lbc_hole_dist_from_side = 25.8
lbc_hole_diameter = 5.8
lbc_hole_radius = lbc_hole_diameter / 2.0
pwm_width = 13.45
pwm_height = 32
wall_thickness = 3
box_radius = 87 + wall_thickness
box_thickness = 42
pole_height = box_thickness - 3
inner_pole_height = 13
pole_dist = 3
lid = Workplane()
lower_box = Workplane()
lid = (
lid.workplane()
.makePolygon(
regularPolygon(
nSides=8,
radius=box_radius - (wall_thickness / 2.0),
thetaStart=0,
thetaEnd=360,
)
)
.extrude(5)
.faces(">Z[1]")
.makePolygon(
regularPolygon(
nSides=8,
radius=box_radius - wall_thickness - pole_dist,
thetaStart=0,
thetaEnd=360,
)
)
.vertices()
.cskHole(3, 5, pole_height)
)
def make_component_holder_octogon(
result,
pole_height,
pole_dist,
box_radius,
x_offset=0,
y_offset=0,
):
pole_height_pct = 0.2
return (
result.workplane(offset=(pole_height / 3) - wall_thickness)
.move(x_offset, y_offset)
.makePolygon(
regularPolygon(
nSides=8,
radius=box_radius
- wall_thickness
- pole_dist, # FIXME subtract wall_thickness on the input instead
thetaStart=0,
thetaEnd=360,
)
)
.vertices()
.cylinder(pole_height, 3)
.workplane(offset=(pole_height * (1 - pole_height_pct) - wall_thickness + 2.2))
.move(x_offset, y_offset)
.makePolygon(
regularPolygon(
nSides=8,
radius=box_radius - wall_thickness - pole_dist,
thetaStart=0,
thetaEnd=360,
)
)
.vertices()
.threadedHole(
top_screw, pole_height * pole_height_pct, simple=screw_simple, fit="Close"
)
)
def make_component_holder_line(
result,
pole_height=0,
pole_radius=3,
line_x_dist=0,
line_y_dist=0,
x_offset=0,
y_offset=0,
screw=top_screw,
):
return (
result.workplane(offset=-wall_thickness)
.move(x_offset, y_offset)
.line(
line_x_dist,
line_y_dist,
)
.vertices()
.cylinder(inner_pole_height, pole_radius)
.workplane(offset=(wall_thickness * 1.7))
.move(x_offset, y_offset)
.line(
line_x_dist,
line_y_dist,
)
.vertices()
.threadedHole(screw, inner_pole_height, simple=screw_simple, fit="Close")
)
def make_component_holder(
result,
pole_dist,
pole_height=inner_pole_height,
pole_radius=3,
box_width=None,
box_height=None,
x_offset=0,
y_offset=0,
screw=top_screw,
):
return (
result.workplane(offset=-wall_thickness)
.move(x_offset, y_offset)
.rect(
box_height,
box_width,
)
.vertices()
.cylinder(pole_height, pole_radius)
.workplane(offset=wall_thickness * 1.7)
.move(x_offset, y_offset)
.rect(
box_height,
box_width,
)
.vertices()
.threadedHole(screw, pole_height, simple=screw_simple, fit="Close")
)
def make_component_holder_self_tapping(
result,
pole_dist,
pole_height=inner_pole_height,
pole_radius=3,
box_width=None,
box_height=None,
x_offset=0,
y_offset=0,
thread_diameter=1.2,
):
thread_radius = thread_diameter / 2.0
return (
result.workplane(offset=-wall_thickness)
.move(x_offset, y_offset)
.rect(
box_height,
box_width,
)
.vertices()
.cylinder(pole_height, pole_radius)
.workplane(offset=(wall_thickness))
.move(x_offset, y_offset)
.rect(
box_height,
box_width,
)
.vertices()
.cylinder(pole_height * 0.7, thread_radius, combine="cut")
)
def add_gland_holes(result, side_index, gland_holes):
num_sides = 8
# Calculate the angle of the side's normal
angle_step = 360 / (num_sides * 2)
angle = angle_step * side_index + angle_step
holes = Workplane("YZ").workplane(offset=82)
for i, (x_offset, y_offset, cylinder_height, cylinder_radius) in enumerate(
gland_holes
):
if i < len(gland_holes) - 1:
holes = (
holes.move(x_offset, y_offset)
.cylinder(cylinder_height, cylinder_radius)
.workplane(offset=0)
)
else:
holes = holes.move(x_offset, y_offset).cylinder(
cylinder_height, cylinder_radius
)
holes = holes.rotate((0, 0, 0), (0, 0, 1), angle)
return result.cut(holes)
lower_box = (
lower_box.makePolygon(
regularPolygon(
nSides=8,
radius=box_radius,
thetaStart=0,
thetaEnd=360,
)
)
.extrude(box_thickness)
.workplane(offset=-((box_thickness / 2.0) - wall_thickness))
.makePolygon(
regularPolygon(
nSides=8,
radius=box_radius - wall_thickness,
thetaStart=0,
thetaEnd=360,
)
)
.extrude(box_thickness * 2, combine="cut")
.workplane(offset=(box_thickness / 2.0) + 8)
.makePolygon(
regularPolygon(
nSides=8,
radius=box_radius - wall_thickness + 2,
thetaStart=0,
thetaEnd=360,
)
)
.extrude(box_thickness * 2, combine="cut")
)
lower_box = make_component_holder_octogon(
lower_box, pole_height, pole_dist, box_radius, x_offset=0, y_offset=0
)
lower_box = make_component_holder(
lower_box,
pole_dist,
pole_height=inner_pole_height,
box_width=breadboard_width,
box_height=breadboard_height,
x_offset=0,
y_offset=40,
)
lower_box = make_component_holder_line(
lower_box,
pole_height=inner_pole_height,
line_x_dist=breadboard_height + 2.2,
line_y_dist=0,
x_offset=-(breadboard_height / 2.0) - 1.7,
y_offset=40,
)
bc_pole_radius = 4
lower_box = lower_box.workplane(offset=-4).move(0, -50).box(lbc_width - 5, 5, 13)
lower_box = (
lower_box.workplane(offset=-4).move(0, bc_pole_radius).box(lbc_width - 5, 5, 13)
)
lower_box = make_component_holder_line(
lower_box,
pole_height=6,
pole_radius=bc_pole_radius,
line_x_dist=0,
line_y_dist=lbc_height - lbc_hole_diameter - lbc_hole_radius,
x_offset=0,
y_offset=-(lbc_width - lbc_hole_diameter - lbc_hole_radius + 1.1),
)
# small buck converter
lower_box = make_component_holder(
lower_box,
pole_dist,
pole_height=inner_pole_height,
box_width=bc_height,
box_height=bc_width, # yes they're reversed on purpose
x_offset=50,
y_offset=-30,
)
# mosfets
lower_box = make_component_holder_self_tapping(
lower_box,
pole_dist,
pole_height=inner_pole_height,
box_width=pwm_height,
box_height=pwm_width, # yes they're reversed on purpose
x_offset=-55,
y_offset=15,
)
# cable gland holes
lower_box = add_gland_holes(
lower_box,
10,
[
(-15, gland_radius * 3.0, 5, gland_radius),
(15, gland_radius * 3.0, 5, gland_radius),
],
)
lower_box = add_gland_holes(
lower_box,
8,
[
(-15, barrel_radius * 3.6, 5, barrel_radius),
(15, gland_radius * 3.0, 5, gland_radius),
],
)
cq.exporters.export(lower_box, "/home/deck/model_files/fan_control_box_lower.stl")
cq.exporters.export(lid, "/home/deck/model_files/fan_control_box_lid.stl")
try:
show_object(lid)
except NameError:
pass

39
ghibli_ticket.py

@ -0,0 +1,39 @@
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
ticket_width = 40
ticket_height = 95
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
result = Workplane()
result = result.box(ticket_width + 5, ticket_height + 5, 30)
result = (
result.workplane(offset=11)
.move(0, 0)
.box(ticket_width - 2, ticket_height, 50, combine="cut")
)
result = (
result.workplane(offset=(ticket_width / 2.0) - 5)
.move(0, 1)
.box(ticket_width, ticket_height + 5, 1.5, combine="cut")
)
cq.exporters.export(result, "/home/deck/model_files/ghibli_ticket_holder.stl")
try:
show_object(result)
except NameError:
pass

32
hair_dryer_holder.py

@ -0,0 +1,32 @@
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

52
hakko_fr301_case_hooks.py

@ -0,0 +1,52 @@
from cadquery import exporters
from cq_warehouse.extensions import Workplane
import cadquery as cq
result = Workplane()
hole_diameter = 7.1
hole_radius = hole_diameter / 2.0
hole_dist_from_side = 12
holder_thickness = 12
bar_width = 51
bar_thickness = 55
case_thickness = 40
result = result.box(
bar_width + holder_thickness * 3,
bar_thickness + holder_thickness,
holder_thickness * 3,
)
result = (
result.workplane(offset=0)
.center(5, -6)
.box(bar_width, bar_thickness, holder_thickness * 3, combine="cut")
)
result = (
result.workplane()
.move(bar_width + bar_thickness - 24, 6)
.box(
bar_width + holder_thickness * 3,
bar_thickness + holder_thickness,
holder_thickness * 3,
)
)
result = (
result.workplane()
.move(bar_width + bar_thickness - 24, 12)
.box(case_thickness, bar_thickness, holder_thickness * 3, combine="cut")
)
try:
show_object(result)
except NameError:
pass
cq.exporters.export(result, "/home/deck/model_files/hakko_hooks.step")

58
hexdriver_holder.py

@ -0,0 +1,58 @@
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

53
microscope_platform.py

@ -0,0 +1,53 @@
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
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
simple = False
width = 120
length = 120
height = 30
screw = ButtonHeadScrew(
size="M16-2", fastener_type="iso7380_1", length=(height - 2) * MM, simple=simple
)
stand_base = Workplane().box(width, length, height)
stand_base = stand_base.workplane(offset=23.8).threadedHole(
screw, height - 2, simple=simple, fit="Loose"
)
stand_base = (
stand_base.workplane(offset=-(height / 2.0))
.rect(width - 15, length - 15, forConstruction=True)
.vertices()
.cylinder(0.6, 6 / 2.0, combine="cut")
)
stand_top = Workplane().union(screw).workplane(offset=11).cylinder(10.0, 60.0)
stand_top = (
stand_top.workplane(offset=3.2389)
.rect(width - 30, length - 30, forConstruction=True)
.vertices()
.cylinder(5.0, 10.0)
)
cq.exporters.export(stand_base, "/home/deck/model_files/microscope_platform_base.stl")
cq.exporters.export(stand_top, "/home/deck/model_files/microscope_platform_top.stl")
try:
show_object(stand_top)
except NameError:
pass

118
modified_enclosure_back.py

@ -0,0 +1,118 @@
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
screw_simple = False # Controls whether to not actually make the screw threads, saves time running it for testing
cable_diameter = 5.6
cable_radius = cable_diameter / 2.0
screw_length = 10
power_cable_screw = ButtonHeadScrew(
size="M3-0.5",
fastener_type="iso7380_1",
length=screw_length * MM,
simple=screw_simple,
)
width = 154
height = 130
poop_chute_dist_from_side = 59
cable_gripper = (
Workplane("XY").cylinder(3, 11.2 / 2.0).cylinder(4, cable_radius, combine="cut")
)
cable_gripper_split = (
cable_gripper.workplane().move(-(11.2 / 2.0), 0).box(11.2, 11.2, 4, combine="cut")
)
holes_plane = (
Workplane("XZ")
.workplane(offset=-2)
.center(20, height - 75)
.cylinder(8, 17 / 2)
.workplane(offset=-7)
.center(0, height - 165)
.circle(11.5 / 2.0)
.extrude(20)
)
hole_extruded_plane = (
Workplane("XZ")
.workplane(offset=-2)
.center(0, height - 110)
.move(20, 0)
.circle(11.5 / 1.4)
.extrude(-5)
)
cover_usb = (
Workplane("XZ").workplane(offset=-4.5).center(-4, height - 25).box(11, 5.3, 1.0)
)
result = cq.importers.importStep("/home/deck/Downloads/Backpanel_Part3.stp")
result = result.union(hole_extruded_plane)
result = result.cut(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.stl")
cq.exporters.export(
test_piece, "/home/deck/model_files/modified_backpanel_test_piece.stl"
)
result_part1 = cq.importers.importStep("/home/deck/Downloads/Backpanel_Part1.stp")
magnet_diameter = 6.1
magnet_radius = magnet_diameter / 2.0
poop_chute_dist_from_bottom = (
14.8 # how far the poop chute is from the bottom of its piece
)
magnet_holes_plane = (
Workplane("XZ")
.center(
poop_chute_dist_from_side + 8,
-(poop_chute_dist_from_bottom) - (24 * 3 - (magnet_radius * 3)),
)
.rect(24, 24, forConstruction=True)
.vertices()
.cylinder(5, magnet_radius)
.center(0, 24)
.rect(24, 24, forConstruction=True)
.vertices()
.cylinder(5, magnet_radius)
)
result_part1 = result_part1.cut(magnet_holes_plane)
cq.exporters.export(
result_part1, "/home/deck/model_files/modified_backpanel_part_1.stl"
)
cq.exporters.export(cable_gripper_split, "/home/deck/model_files/cable_gripper.stl")
try:
show_object(cable_gripper_split)
except NameError:
pass

92
music_player_case.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 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

154
robot_wheel_axle.py

@ -0,0 +1,154 @@
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 = 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 = (
wheel_axle_outer.workplane(offset=4, 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=-14.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 = 26
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(12, 60, 6) # ends up being about 45 mm
.workplane()
.line(main_axle_length - 10, 0, forConstruction=True)
.rotateAboutCenter((0, main_axle_length - 10, 0), 90)
.vertices()
.translate((-((main_axle_length / 2) - 5), 49, 3))
.hole(7.5, 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"
)
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

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

43
ssd_bracket.py

@ -0,0 +1,43 @@
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
hole_diameter = 3.66
hole_radius = hole_diameter / 2.0
screw_dist = 76
bracket_height = 5
result = Workplane()
result = result.box(60, bracket_height, 7)
result = result.workplane(offset=-bracket_height + 4).box(60, 1.2, 7, combine="cut")
result = result.workplane(offset=-bracket_height + 2.38).move(0, 4).box(100, 5, 2)
result = result.workplane(offset=(bracket_height / 2) - 1).move(0, 5.5).box(100, 2, 6)
holes = (
Workplane("XZ")
.workplane(offset=-6)
.move(-37, 1)
.line(screw_dist, 0, forConstruction=True)
.vertices()
.cylinder(4, hole_radius)
)
result = result.cut(holes)
cq.exporters.export(result, "/home/deck/model_files/ssd_bracket.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

65
vacuum_adapter.py

@ -0,0 +1,65 @@
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.stl")
try:
show_object(result)
except NameError:
pass

10
watch_stand.py

@ -25,7 +25,7 @@ band_width = 21
band_diameter = 55
band_radius = band_diameter / 2
first_circle_height = 175 # how tall the horizontal circle part will be
first_circle_height = 175 # how tall the horizontal circle part will be
Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath
@ -54,14 +54,14 @@ stand_base = (
.threadedHole(screw, 34, simple=simple, fit="Loose")
)
stand_base = stand_base.faces(">X[0]").sphere(base_radius*1.5)
stand_base = stand_base.workplane(offset=base_radius*2).box(
stand_base = stand_base.faces(">X[0]").sphere(base_radius * 1.5)
stand_base = stand_base.workplane(offset=base_radius * 2).box(
base_diameter * 2, base_radius * 3, base_radius * 3, combine="cut"
)
stand_base = (
stand_base.workplane(offset=base_radius - 5)
.rect(base_radius*1.5, base_radius*1.5, forConstruction=True)
.rect(base_radius * 1.5, base_radius * 1.5, forConstruction=True)
.vertices()
.cylinder(9, 6, combine="cut")
)
@ -115,6 +115,6 @@ cq.exporters.export(holder_part, "/home/deck/model_files/watch_stand_holder.step
try:
show_object(stand_base)
# show_object(cut_polygon)
#show_object(holder_part)
# show_object(holder_part)
except NameError:
pass

98
xmas_spinner.py

@ -0,0 +1,98 @@
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)
bearing_od = 22.0
bearing_or = bearing_od / 2.0
bearing_diameter = 8.0
bearing_diameter_rest = 8.8
bearing_radius = bearing_diameter / 2.0
bearing_radius_rest = bearing_diameter_rest / 2.0
bearing_thickness = 6.93
x_offset = 37.5
y_offset = 18.9
spinner_base = (
Workplane()
.cylinder(10, 20)
.workplane(offset=-bearing_thickness + 2)
.cylinder(1.5, bearing_radius_rest)
.workplane(offset=-bearing_thickness)
.cylinder(10, bearing_radius + 0.08)
.workplane(offset=3.224)
.rect(35, 35, forConstruction=True)
.vertices()
.cylinder(4, 10)
)
spinner = (
Workplane()
.workplane(offset=0)
.move(-x_offset, 19)
.cylinder(5, 15)
.workplane(offset=-2)
.move(x_offset, y_offset)
.cylinder(10, bearing_radius)
)
tree = cq.importers.importStep("/home/deck/Downloads/xmas_tree.step")
spinner = tree.union(spinner)
spinner_split_top = (
tree.workplane(5)
.split(keepTop=True)
.workplane(offset=-10)
.move(-x_offset + 0.1, y_offset)
.cylinder(10, bearing_radius + 0.025)
.workplane(offset=-2.9)
.move(-x_offset + 0.1, y_offset)
.cylinder(10, bearing_radius + 3)
)
spinner_split_bottom = (
tree.workplane(5)
.split(keepBottom=True)
.workplane(offset=7.8)
.move(-x_offset, y_offset)
.cylinder(bearing_thickness, bearing_or, combine="cut")
.workplane(offset=6.8)
.move(-x_offset, y_offset)
.cylinder(20, bearing_radius, combine="cut")
.workplane(offset=-3.0)
.move(-x_offset, y_offset)
.cylinder(13.3, 15)
.workplane(offset=-7.12)
.move(-x_offset, y_offset)
.cylinder(bearing_thickness + 3.3, bearing_or, combine="cut")
.workplane(offset=-7.12)
.move(-x_offset, y_offset)
.cylinder(15, bearing_radius, combine="cut")
)
cq.exporters.export(spinner, "/home/deck/model_files/xmas_spinner.stl")
cq.exporters.export(spinner_split_top, "/home/deck/model_files/xmas_spinner_top.stl")
cq.exporters.export(
spinner_split_bottom, "/home/deck/model_files/xmas_spinner_bottom.stl"
)
cq.exporters.export(spinner_base, "/home/deck/model_files/xmas_spinner_base.stl")
try:
show_object(spinner_base)
# show_object(spinner_split_top)
# show_object(spinner_split_bottom)
except NameError:
pass
Loading…
Cancel
Save