Browse Source

resize threads

master
wes 1 month ago
parent
commit
19342ddaa2
  1. 43
      carlson_amp_enclosure.py

43
carlson_amp_enclosure.py

@ -14,7 +14,7 @@ from math import ceil, floor
Workplane = cqmore.extend(Workplane) Workplane = cqmore.extend(Workplane)
Workplane.addSvgPath = addSvgPath Workplane.addSvgPath = addSvgPath
screw_simple = True # Controls whether to not actually make the screw threads, saves time running it for testing screw_simple = False # Controls whether to not actually make the screw threads, saves time running it for testing
pot_diameter = 6.9 pot_diameter = 6.9
pot_radius = pot_diameter / 2.0 pot_radius = pot_diameter / 2.0
@ -33,6 +33,13 @@ top_screw = CounterSunkScrew(
simple=screw_simple, simple=screw_simple,
) )
battery_screw = CounterSunkScrew(
size="M3.5-0.6",
fastener_type="iso7046",
length=screw_length * MM,
simple=screw_simple,
)
x_board_size = 36.07 x_board_size = 36.07
y_board_size = 28.75 y_board_size = 28.75
@ -161,47 +168,51 @@ bottom = (
battery_holder_offset_factor = 6.5 battery_holder_offset_factor = 6.5
bottom = ( bottom = (
bottom.workplane(offset=-(box_height / 2.0) + 8.9) bottom.workplane(offset=-(box_height / 2.0) + 9.8)
.move(box_length / 2.0 - wall_thickness * battery_holder_offset_factor, 0) .move(box_length / 2.0 - wall_thickness * battery_holder_offset_factor, 0)
.box(battery_holder_slot_width, battery_holder_slot_length, 4.0) .box(battery_holder_slot_width, battery_holder_slot_length, 6.0)
) )
bottom = ( bottom = (
bottom.workplane(offset=-(box_height / 2.0) + 9.0) bottom.workplane(offset=-(box_height / 2.0) + 10.0)
.move( .move(
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0, (box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 25.5,
-(battery_holder_slot_length / 6.5), -(battery_holder_slot_length / 6.5),
) )
.vLine(battery_holder_hole_dist) .vLine(battery_holder_hole_dist)
.vertices() .vertices()
.cylinder(4, battery_holder_screw_radius) .cylinder(6, battery_holder_screw_radius)
.workplane(offset=-(box_height / 2.0) + 11.10) .workplane(offset=-(box_height / 2.0) + 13.10)
.move( .move(
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0, (box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 25.5,
-(battery_holder_slot_length / 6.5), -(battery_holder_slot_length / 6.5),
) )
.vLine(battery_holder_hole_dist) .vLine(battery_holder_hole_dist)
.vertices() .vertices()
.threadedHole(top_screw, 2.0, simple=screw_simple, fit="Close", counterSunk=False) .threadedHole(
battery_screw, 4.0, simple=screw_simple, fit="Loose", counterSunk=False
)
) )
bottom = ( bottom = (
bottom.workplane(offset=-(box_height / 2.0) + 9.0) bottom.workplane(offset=-(box_height / 2.0) + 10.0)
.move( .move(
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0, (box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 25.5,
(battery_holder_hole_dist * 2) - 8, (battery_holder_hole_dist * 2) - 8,
) )
.vLine(-(battery_holder_hole_dist * 3)) .vLine(-(battery_holder_hole_dist * 3))
.vertices() .vertices()
.cylinder(4, battery_holder_screw_radius) .cylinder(6, battery_holder_screw_radius)
.workplane(offset=-(box_height / 2.0) + 11.10) .workplane(offset=-(box_height / 2.0) + 13.10)
.move( .move(
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0, (box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 25.5,
(battery_holder_hole_dist * 2) - 8, (battery_holder_hole_dist * 2) - 8,
) )
.vLine(-(battery_holder_hole_dist * 3)) .vLine(-(battery_holder_hole_dist * 3))
.vertices() .vertices()
.threadedHole(top_screw, 2.0, simple=screw_simple, fit="Close", counterSunk=False) .threadedHole(
battery_screw, 4.0, simple=screw_simple, fit="Loose", counterSunk=False
)
) )
bottom = ( bottom = (
@ -258,6 +269,6 @@ cq.exporters.export(bottom, "/home/deck/model_files/carlon_probe_amp_enclosure_b
cq.exporters.export(top, "/home/deck/model_files/carlon_probe_amp_enclosure_lid.stl") cq.exporters.export(top, "/home/deck/model_files/carlon_probe_amp_enclosure_lid.stl")
try: try:
show_object(top) show_object(bottom)
except NameError: except NameError:
pass pass

Loading…
Cancel
Save