|
|
@ -16,6 +16,15 @@ Workplane.addSvgPath = addSvgPath |
|
|
|
|
|
|
|
screw_simple = True # Controls whether to not actually make the screw threads, saves time running it for testing |
|
|
|
|
|
|
|
pot_diameter = 6.9 |
|
|
|
pot_radius = pot_diameter / 2.0 |
|
|
|
|
|
|
|
switch_diameter = 6.2 |
|
|
|
switch_radius = switch_diameter / 2.0 |
|
|
|
|
|
|
|
gland_diameter = 16.0 |
|
|
|
gland_radius = gland_diameter / 2.0 |
|
|
|
|
|
|
|
screw_length = 10 |
|
|
|
top_screw = CounterSunkScrew( |
|
|
|
size="M2.5-0.45", |
|
|
@ -35,7 +44,7 @@ hole_dist_y = ( |
|
|
|
hole_diameter = 3.44 |
|
|
|
hole_radius = hole_diameter / 2.0 |
|
|
|
|
|
|
|
box_width = 65.0 |
|
|
|
box_width = 72.0 |
|
|
|
box_height = 30.0 |
|
|
|
box_length = 120.0 |
|
|
|
wall_thickness = 2.0 |
|
|
@ -137,26 +146,28 @@ bottom = ( |
|
|
|
bottom.workplane(offset=(box_height / 2) - 9) |
|
|
|
.rect(box_length - 6.5, box_width - 6.5) |
|
|
|
.vertices() |
|
|
|
.cylinder(box_height - wall_thickness * 1.5, 2.5) |
|
|
|
.cylinder(box_height - wall_thickness * 2, 2.5) |
|
|
|
) |
|
|
|
|
|
|
|
bottom = ( |
|
|
|
bottom.workplane(offset=(box_height / 2) + 4.0) |
|
|
|
bottom.workplane(offset=(box_height / 2) + 3.5) |
|
|
|
.rect(box_length - 6.5, box_width - 6.5) |
|
|
|
.vertices() |
|
|
|
.threadedHole(top_screw, 10, simple=screw_simple, fit="Close", counterSunk=False) |
|
|
|
) |
|
|
|
|
|
|
|
battery_holder_offset_factor = 6.5 |
|
|
|
|
|
|
|
bottom = ( |
|
|
|
bottom.workplane(offset=-(box_height / 2.0) + 8.9) |
|
|
|
.move(box_length / 2.0 - wall_thickness * 4, 0) |
|
|
|
.move(box_length / 2.0 - wall_thickness * battery_holder_offset_factor, 0) |
|
|
|
.box(battery_holder_slot_width, battery_holder_slot_length, 4.0) |
|
|
|
) |
|
|
|
|
|
|
|
bottom = ( |
|
|
|
bottom.workplane(offset=-(box_height / 2.0) + 9.0) |
|
|
|
.move( |
|
|
|
(box_length / 2.0 - wall_thickness * 4) - 24.0, |
|
|
|
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0, |
|
|
|
-(battery_holder_slot_length / 6.5), |
|
|
|
) |
|
|
|
.vLine(battery_holder_hole_dist) |
|
|
@ -164,7 +175,7 @@ bottom = ( |
|
|
|
.cylinder(4, battery_holder_screw_radius) |
|
|
|
.workplane(offset=-(box_height / 2.0) + 11.10) |
|
|
|
.move( |
|
|
|
(box_length / 2.0 - wall_thickness * 4) - 24.0, |
|
|
|
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0, |
|
|
|
-(battery_holder_slot_length / 6.5), |
|
|
|
) |
|
|
|
.vLine(battery_holder_hole_dist) |
|
|
@ -175,7 +186,7 @@ bottom = ( |
|
|
|
bottom = ( |
|
|
|
bottom.workplane(offset=-(box_height / 2.0) + 9.0) |
|
|
|
.move( |
|
|
|
(box_length / 2.0 - wall_thickness * 4) - 24.0, |
|
|
|
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0, |
|
|
|
(battery_holder_hole_dist * 2) - 8, |
|
|
|
) |
|
|
|
.vLine(-(battery_holder_hole_dist * 3)) |
|
|
@ -183,7 +194,7 @@ bottom = ( |
|
|
|
.cylinder(4, battery_holder_screw_radius) |
|
|
|
.workplane(offset=-(box_height / 2.0) + 11.10) |
|
|
|
.move( |
|
|
|
(box_length / 2.0 - wall_thickness * 4) - 24.0, |
|
|
|
(box_length / 2.0 - wall_thickness * battery_holder_offset_factor) - 24.0, |
|
|
|
(battery_holder_hole_dist * 2) - 8, |
|
|
|
) |
|
|
|
.vLine(-(battery_holder_hole_dist * 3)) |
|
|
@ -210,11 +221,41 @@ bottom = ( |
|
|
|
.threadedHole(top_screw, 2.0, simple=screw_simple, fit="Close", counterSunk=False) |
|
|
|
) |
|
|
|
|
|
|
|
pot_holes = ( |
|
|
|
Workplane("YZ") |
|
|
|
.workplane(offset=-(box_length / 2.0)) |
|
|
|
.move(12, 0) |
|
|
|
.cylinder(wall_thickness * 2, pot_radius) |
|
|
|
.workplane() |
|
|
|
.move(-12, 0) |
|
|
|
.cylinder(wall_thickness * 2, pot_radius) |
|
|
|
) |
|
|
|
|
|
|
|
bottom = bottom.cut(pot_holes) |
|
|
|
|
|
|
|
|
|
|
|
switch_hole = ( |
|
|
|
Workplane("XZ") |
|
|
|
.workplane(offset=-(box_width / 2.0)) |
|
|
|
.move(-(box_length / 2.0) + 30, 0) |
|
|
|
.cylinder(wall_thickness * 2, switch_radius) |
|
|
|
) |
|
|
|
|
|
|
|
bottom = bottom.cut(switch_hole) |
|
|
|
|
|
|
|
gland_hole = ( |
|
|
|
Workplane("XZ") |
|
|
|
.workplane(offset=(box_width / 2.0)) |
|
|
|
.move(-(box_length / 2.0) + 30, 0) |
|
|
|
.cylinder(wall_thickness * 2, gland_radius) |
|
|
|
) |
|
|
|
|
|
|
|
bottom = bottom.cut(gland_hole) |
|
|
|
|
|
|
|
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(top) |
|
|
|
show_object(bottom) |
|
|
|
except NameError: |
|
|
|
pass |
|
|
|