Commit | Line | Data |
---|---|---|
b8ad78c0 H |
1 | /* |
2 | * TODO | |
3 | ** make more parametric | |
4 | ** add parameter to specify number of wires/pins | |
5 | */ | |
6 | ||
7 | $fn=10; //Minimum nuber of circle segments | |
8 | ||
9 | module conn_male(size=23, thickness=1.5, full=false) { | |
10 | difference() { | |
11 | union() { | |
12 | translate([0,size*0.3,0]) cube([size-(thickness*2),(size-(thickness*2))*2,size-(thickness*2)], center=true); | |
13 | translate([size/3,(size/3)-thickness]) rotate([0,0,145]) cube([size*0.2,size/4,size-(thickness*2)], center=true); | |
14 | } | |
15 | if(!full) { | |
16 | translate([0,size/2,0]) cube([size-(thickness*4),size*1.5,size+1], center=true); | |
17 | rotate([0,90,0]) | |
18 | for(i = [(size/3)-thickness,-(size/3)+thickness]) | |
19 | translate([i,0,0]) | |
20 | rotate([90,0,0]) | |
21 | cylinder(size*2, size/10, size/10); | |
22 | } | |
23 | } | |
24 | } | |
25 | ||
26 | module conn_female(size=23, thickness=1.5) { | |
27 | difference() { | |
28 | cube(size, center=true); | |
29 | conn_male(size, thickness=thickness, full=true); | |
30 | for(i = [size/4,-size/4]) | |
31 | translate([i,0,0]) | |
32 | rotate([90,0,0]) cylinder(size*2, size/10, size/10); | |
33 | } | |
34 | } | |
35 | ||
36 | module connector(size=10, thickness=1.5, gap=0.6, design=false) { | |
37 | if(!design) { | |
38 | ||
39 | translate([0,size*1.5,-(thickness+gap/2)]) conn_male(size-gap,thickness); | |
40 | conn_female(size,thickness); | |
41 | } else { | |
42 | //Design | |
43 | conn_male(size-gap,thickness); | |
44 | % conn_female(size,thickness); | |
45 | } | |
46 | } | |
47 | ||
48 | //connector(design=true); | |
49 | connector(); |