File size: 2,238 Bytes
6de1b61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import cadquery as cq

base_width = 50
base_height = 80
base_thickness = 6
corner_radius = 4

hole_dia = 5.2
csk_dia = 10
csk_angle = 82
hole_inset_x = 10
hole_inset_y = 12

shaft_width = 14
shaft_depth = 12
shaft_length = 35
hook_inner_radius = 16
hook_outer_radius = hook_inner_radius + shaft_depth

gusset_thickness = 6
bottom_gusset_length = 25
bottom_gusset_height = 18
top_gusset_length = 15
top_gusset_height = 12

base = (
    cq.Workplane("XY")
    .box(base_width, base_height, base_thickness)
    .edges("|Z")
    .fillet(corner_radius)
)

hx = base_width / 2 - hole_inset_x
hy = base_height / 2 - hole_inset_y
pts = [(hx, hy), (-hx, hy), (hx, -hy), (-hx, -hy)]

base = (
    base.faces(">Z")
    .workplane()
    .pushPoints(pts)
    .cskHole(diameter=hole_dia, cskDiameter=csk_dia, cskAngle=csk_angle)
)

z_start = base_thickness / 2
z_arc_center = z_start + shaft_length
y_inner_start = shaft_depth / 2
y_outer_start = -shaft_depth / 2

hook = (
    cq.Workplane("YZ")
    .moveTo(y_outer_start, z_start)
    .lineTo(y_outer_start, z_arc_center)
    .threePointArc(
        (y_outer_start + hook_outer_radius, z_arc_center + hook_outer_radius),
        (y_outer_start + 2 * hook_outer_radius, z_arc_center),
    )
    .threePointArc(
        (y_outer_start + 2 * hook_outer_radius - shaft_depth / 2, z_arc_center - shaft_depth / 2),
        (y_outer_start + 2 * hook_outer_radius - shaft_depth, z_arc_center),
    )
    .threePointArc(
        (y_inner_start + hook_inner_radius, z_arc_center + hook_inner_radius),
        (y_inner_start, z_arc_center),
    )
    .lineTo(y_inner_start, z_start)
    .close()
    .extrude(shaft_width / 2, both=True)
)

bottom_gusset = (
    cq.Workplane("YZ")
    .moveTo(y_outer_start, z_start)
    .lineTo(y_outer_start - bottom_gusset_length, z_start)
    .lineTo(y_outer_start, z_start + bottom_gusset_height)
    .close()
    .extrude(gusset_thickness / 2, both=True)
)

top_gusset = (
    cq.Workplane("YZ")
    .moveTo(y_inner_start, z_start)
    .lineTo(y_inner_start + top_gusset_length, z_start)
    .lineTo(y_inner_start, z_start + top_gusset_height)
    .close()
    .extrude(gusset_thickness / 2, both=True)
)

fixture = base.union(hook).union(bottom_gusset).union(top_gusset)