From 2c9b2548357bb251611bc8a7db699ee137bcf21f Mon Sep 17 00:00:00 2001 From: wes Date: Tue, 25 Mar 2025 07:58:25 -0400 Subject: [PATCH] adding carlson probe wip, microscope platform --- carlson_amp_enclosure.py | 110 +++++++++++++++++++++++++++++++++++++++ carlson_amp_probe.py | 85 ++++++++++++++++++++++++++++++ microscope_platform.py | 53 +++++++++++++++++++ vacuum_adapter.py | 2 +- 4 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 carlson_amp_enclosure.py create mode 100644 carlson_amp_probe.py create mode 100644 microscope_platform.py diff --git a/carlson_amp_enclosure.py b/carlson_amp_enclosure.py new file mode 100644 index 0000000..c139869 --- /dev/null +++ b/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 diff --git a/carlson_amp_probe.py b/carlson_amp_probe.py new file mode 100644 index 0000000..08dbe67 --- /dev/null +++ b/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 diff --git a/microscope_platform.py b/microscope_platform.py new file mode 100644 index 0000000..913176c --- /dev/null +++ b/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 diff --git a/vacuum_adapter.py b/vacuum_adapter.py index 1be8e86..8ab44d8 100644 --- a/vacuum_adapter.py +++ b/vacuum_adapter.py @@ -58,7 +58,7 @@ result = result.workplane(offset=-adapter_height * 1.9).box( 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") +cq.exporters.export(result, "/home/deck/model_files/vacuum_adapter.stl") try: show_object(result) except NameError: