summaryrefslogtreecommitdiff
path: root/prototype/mech_pcbs/flange_holder_v2.scad
blob: b963db3ea5ebd81d00bbebbc2b219ee29f69cad7 (plain)
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
/* Linear units are mm */

ext_dia = 30.0;
int_dia = 6.2;
h = 8;

mnth_dia = 3.2;
mnth_ins_dia = 5.0;
mnth_ins_h = 5.0;
mnth_center_r = 8.0;
mnth_num = 4;

seth_dia = 3.2;
//seth_ins_dia = mnth_ins_dia;
//seth_ins_h = mnth_ins_h;
seth_ins_dia = 6.2;
seth_ins_h = 2.0;
seth_num = 2;

nut_w = 5.35 + 0.2;
nut_h = 6.05 + 0.2;
nut_d = 2.5;
nut_offr = 8.0;

$fn = 64;

difference() {
    cylinder(d=ext_dia, h=h);
    cylinder(d=int_dia, h=h);
    
    for (alpha = [0 : 360/mnth_num : 359.9999]) {
        rotate(alpha, [0, 0, 1])
        translate([-mnth_center_r, 0, 0])
        union() {
            cylinder(d=mnth_dia, h=h);
            translate([0, 0, h-mnth_ins_h]) cylinder(d=mnth_ins_dia, h=mnth_ins_h);
        }
    }
    
    for (alpha = [ 0 : 360/max(seth_num, 4) : 359.9999 * seth_num/max(seth_num, 4)]) {
        translate([0, 0, h/2])
        rotate(alpha + 360/mnth_num/2, [0, 0, 1])
        union() {
            translate([-nut_offr, 0, 0]) {
                cube([nut_d, nut_w, nut_h], center=true);
                translate([0, 0, h/2])
                cube([nut_d, nut_w, h/2], center=true);
            }
            
            rotate(-90, [0, 1, 0])
            union() {
                cylinder(d=seth_dia, h=ext_dia/2);
                translate([0, 0, ext_dia/2-seth_ins_h]) cylinder(d=seth_ins_dia, h=seth_ins_h);
            }
        }
    }
}