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.
76 lines
1.9 KiB
76 lines
1.9 KiB
import cadquery as cq
|
|
from cqmore import Workplane
|
|
from cqmore.curve import archimedeanSpiral, circle
|
|
from cqmore.polygon import regularPolygon, star
|
|
from random import randint, choice
|
|
import functools as fnc
|
|
import itertools as it
|
|
|
|
|
|
inner_len = 100
|
|
inner_width = 68.8
|
|
inner_height = 49.7
|
|
|
|
outer_len = 131.9
|
|
outer_thickness = 5.26
|
|
outer_width = inner_width
|
|
|
|
hole_diameter = 6
|
|
|
|
hole_dist_from_long = 10.2
|
|
hole_dist_from_short = 5.37
|
|
|
|
recess_height = 61.9
|
|
recess_width = 11.9
|
|
|
|
clip_thickness = 15
|
|
clip_length = 65
|
|
clip_width = 60
|
|
|
|
clip_distance_from_sensor = 90 # how far it is from the enclosure
|
|
|
|
result = (
|
|
Workplane().box(outer_len, outer_width, outer_thickness).edges("|Z").fillet(0.9)
|
|
)
|
|
|
|
|
|
result = (
|
|
result.moveTo(outer_width - recess_width, 0)
|
|
.rect(recess_width, recess_height)
|
|
.extrude(5)
|
|
)
|
|
result = (
|
|
result.moveTo(-outer_width + recess_width, 0)
|
|
.rect(recess_width, recess_height)
|
|
.extrude(5)
|
|
)
|
|
result = (
|
|
result.workplane(offset=-(outer_thickness / 2) - 0.33)
|
|
.moveTo(-outer_len / 2, 0)
|
|
.rect(clip_length / 2, clip_width)
|
|
.extrude(outer_thickness)
|
|
)
|
|
result = (
|
|
result.workplane(offset=-0.33)
|
|
.moveTo(inner_height + (clip_length / 2.0) - 1, 0)
|
|
.box(clip_width / 1.8, clip_width / 2.5, outer_thickness)
|
|
.moveTo(outer_len / 2 + 26, 0)
|
|
.cylinder(10, 5 / 2, combine="cut")
|
|
)
|
|
result = result.moveTo(outer_len / 2.4 + 30, 0).cylinder(10, 12 / 2, combine="cut")
|
|
result = result.faces(">Z[0]").moveTo(-70, 0).rect(10, clip_width).extrude(clip_length)
|
|
|
|
result = (
|
|
result.faces(">Z[1]")
|
|
.moveTo(0, 0)
|
|
.rect(
|
|
outer_len - hole_dist_from_short - hole_diameter * 2,
|
|
outer_width - hole_dist_from_long - hole_diameter * 3,
|
|
forConstruction=True,
|
|
)
|
|
.vertices()
|
|
.cylinder(outer_thickness * 3, hole_diameter / 2, combine="cut")
|
|
)
|
|
|
|
|
|
cq.exporters.export(result, "/home/deck/model_files/light_holder.step")
|
|
|