Browse Source

curtain holder, formatting

master
wes 5 months ago
parent
commit
dc0cf461f6
  1. 22
      battery_cover.py
  2. 57
      curtain_holder.py
  3. 3
      fan_control_box.py
  4. 12
      hair_dryer_holder.py
  5. 5
      hexdriver_holder.py
  6. 15
      modified_enclosure_back.py
  7. 8
      music_player_case.py
  8. 8
      vacuum_adapter.py

22
battery_cover.py

@ -41,12 +41,24 @@ result = (
)
result = (
result
.workplane(offset=(height/2))
.box(side_thickness, width + side_notch_distance*2 + side_notch_width*2, side_notch_distance)
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)
.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)
)

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.15, 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 + 7.73, 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

3
fan_control_box.py

@ -69,8 +69,7 @@ lower_box = (
)
lower_box = (
lower_box
.workplane(offset=(pole_height/4))
lower_box.workplane(offset=(pole_height / 4))
.rect(
box_height - wall_thickness - pole_dist, box_width - wall_thickness - pole_dist
)

12
hair_dryer_holder.py

@ -11,8 +11,16 @@ 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=-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)

5
hexdriver_holder.py

@ -40,9 +40,8 @@ result = (
.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.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)

15
modified_enclosure_back.py

@ -38,9 +38,12 @@ magnet_holes_plane = (
.cylinder(12, 2)
)
cover_usb = Workplane("XZ").workplane(offset=-4.5).center(-4, height - 77).box(11, 5.3, 1.0)
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_part1 = cq.importers.importStep("/home/deck/Downloads/Backpanel_Part1.stp")
result = result.cut(holes_plane)
@ -48,12 +51,16 @@ 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)
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")
cq.exporters.export(
test_piece, "/home/deck/model_files/modified_backpanel_test_piece.step"
)
try:
show_object(result)
show_object(result_part1)
except NameError:
pass

8
music_player_case.py

@ -74,8 +74,12 @@ usb_hole = (
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)
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)

8
vacuum_adapter.py

@ -48,9 +48,13 @@ side_cut = (
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=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=-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)

Loading…
Cancel
Save