You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.5 KiB

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