-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcombadge.scad
106 lines (90 loc) · 2.76 KB
/
combadge.scad
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
$wallThickness = 1;
$wiggleRoom = 0.5;
$chamberDepth = 10;
$pcbMajorAxis = 45;
$pcbMinorAxis = 31;
$chevronHeight = 13;
$chamberLength = $pcbMajorAxis + 2*$wiggleRoom;
$chamberWidth = $pcbMinorAxis + 2*$wiggleRoom;
$baseLength = $chamberLength + 2*$wallThickness;
$baseWidth = $chamberWidth + 2*$wallThickness;
$clipWidth = 4;
$clipHeight = 2;
$fn=128;
module scale_width() {
translate([$baseLength/2, $baseWidth/2, 0])
scale([$baseLength/$baseWidth, 1, 1])
children();
}
module chevron() {
difference() {
linear_extrude($chevronHeight) import("chevron.svg");
translate([10, 40, 0]) cube([30, 30, 8]);
}
}
module annulus(outer_radius, width, height) {
linear_extrude(height) difference() {
circle(outer_radius);
circle(outer_radius - width);
}
}
module base_top() {
scale([1, 1, 5.5/$baseWidth])
rotate_extrude()
intersection() {
circle($baseWidth/2);
square([$baseWidth, $baseWidth], center=false);
}
annulus($baseWidth/2, 1, 1.75);
}
module base() {
scale_width()
union() {
cylinder($chamberDepth, d = $baseWidth);
translate([0, 0, $chamberDepth]) base_top();
}
}
module cavity_with_holes() {
scale_width() cylinder($chamberDepth, d = $chamberWidth);
translate([$baseLength/2, $baseWidth/2, $chamberDepth/2]) {
translate([0, $baseWidth/2, 1]) cube([5, 5, 3], center=true);
translate([$baseLength/2, 0, 0]) cube([5, 7, 3], center=true);
}
translate([$baseLength/2, 0, 0.5+$clipHeight/2]) {
cube([$clipWidth, 5, 1], center=true);
translate([0, $baseWidth, 0]) cube([$clipWidth, 5, 1], center=true);
}
}
module combadge() {
difference() {
union() {
color("#c0c0c0") translate([6, -2, 0]) scale([0.85, 0.85, 1]) chevron();
color("#ffb700") base();
}
cavity_with_holes();
}
}
module triangularPrism(side, depth, center=false) {
linear_extrude(depth) polygon([[0, 0], [side, 0], [side/2, sqrt(3)*side/2]]);
}
module snapClip(height, width, center) {
translate(center==true ? [-1, -width/2, 0] : [0, 0, 0])
union() {
translate([0, 0, height]) rotate([-90, 0, 0])
linear_extrude(width)
polygon([[0, 0], [1 ,0], [2, 1], [1, 1], [1, height], [0, height]]);
}
}
module back() {
translate([$baseLength/2, 0, $wallThickness]) union() {
translate([0, 0.5+$wallThickness, 0]) rotate([0, 0, -90])
snapClip($clipHeight, $clipWidth, true);
translate([0, $baseWidth-(0.5+$wallThickness), 0]) rotate([0, 0, 90])
snapClip($clipHeight, $clipWidth, true);
}
scale_width() color("#ffb700")
cylinder($wallThickness, d=$baseWidth, center=false);
}
combadge();
translate([60, 0, 0])
back();