forked from evil-mad/axidraw
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathsmpsbox.py
42 lines (34 loc) · 863 Bytes
/
smpsbox.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import cadquery as cq
import math
# shell thickness
th = 1.5
# shell fillet radius
fillet_r = 1.5
centerXY = (True, True, False)
width = 30
height = 20
length = 90
# make shell
result = (cq.Workplane("XY")
.box(length, width, height)
.faces(">Z")
.shell(-th)
.edges("<Z or |Z").fillet(fillet_r)
)
result.faces("<X").workplane(centerOption="CenterOfMass",
invert=True).tag("end1")
result.faces(">X").workplane(centerOption="CenterOfMass",
invert=True).tag("end2")
# DC socket hole
result = (result
.workplaneFromTagged("end1")
.circle(4)
.cutBlind(10)
)
# wire hole
result = (result
.workplaneFromTagged("end2")
.slot2D(4.5, 2.5)
.cutBlind(10)
)
show_object(result)