forked from nophead/NopSCADlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuseholder.scad
148 lines (132 loc) · 4.72 KB
/
fuseholder.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
//
// NopSCADlib Copyright Chris Palmer 2018
// nop.head@gmail.com
// hydraraptor.blogspot.com
//
// This file is part of NopSCADlib.
//
// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with NopSCADlib.
// If not, see <https://www.gnu.org/licenses/>.
//
//
//! 20mm panel mount fuse holder.
//
include <../utils/core/core.scad>
include <spades.scad>
use <../utils/tube.scad>
use <../utils/thread.scad>
module fuseholder_hole(h = 100) //! Hole with flats for fuseholder
extrude_if(h)
intersection() {
circle(d = 12);
square([100, 11], center = true);
}
function fuseholder_diameter() = 18.8; //! Outside diameter of flange
module fuseholder(thickness) { //! Fuseholder with nut in place for specified panel thickness
vitamin(str("fuseholder(6): Fuse holder 20mm"));
flange_d = fuseholder_diameter();
flange_t = 2;
height = 33.2;
thread_d = 12;
thread_p = 1;
thread = 15;
bot_d = 10.4;
top_d = 8.7;
flat = 10.8;
nut_d = 18.8;
nut_t = 6;
nut_flange_t = 1.5;
spade = 5.4;
contact_slot_z = 20;
contact_slot_w = 3.2;
contact_slot_d = 7;
contact_w = 2.8;
contact_t = 0.3;
contact_l1 = 11;
contact_l2 = 6;
//
// Nut
//
colour = grey40;
vflip()
translate_z(thickness)
explode(height) {
color(colour) {
tube(or = nut_d / 2, ir = thread_d / 2, h = nut_flange_t, center = false);
linear_extrude(height = nut_t)
difference() {
circle(d = nut_d, $fn = 6);
circle(d = thread_d);
}
}
if(show_threads)
female_metric_thread(thread_d, thread_p, nut_t, false, colour = colour);
}
//
// Body
//
explode(height + 5, offset = -height - 4) {
color(colour) {
tube(or = flange_d / 2, ir = 5.2, h = flange_t, center = false);
cylinder(r = 5, h = flange_t - 1);
linear_extrude(height = flange_t)
difference() {
circle(r = 5);
square([8, 1.5], center = true);
}
vflip() {
if(!show_threads)
linear_extrude(height = thread)
intersection() {
circle(d = thread_d - 0.3);
square([100, 10.8], center = true);
}
render() difference() {
translate_z(thread)
cylinder(d1 = bot_d, d2 = top_d, h = height - flange_t - thread);
for(side = [-1, 1])
translate([side * (contact_slot_d / 2 + 1) - 1, -contact_slot_w / 2, contact_slot_z])
cube([2, contact_slot_w, 100]);
}
}
if(show_threads)
vflip()
render() intersection() {
male_metric_thread(thread_d, thread_p, thread, false, colour = colour);
translate_z(thread / 2)
cube([100, 10.8, thread + 1], center = true);
}
}
//
// Side contacts
//
color(silver) vflip()
for(side = [-1, 1])
translate([side * contact_slot_d / 2, 0, contact_slot_z])
rotate([0, -70, 90 - side * 90])
linear_extrude(height = contact_t, center = true) difference() {
hull() {
square([eps, contact_w], center = true);
translate([(side > 0 ? contact_l1 : contact_l2) - contact_w / 2, 0])
circle(d = contact_w);
}
translate([(side > 0 ? contact_l1 : contact_l2) - contact_w / 2, 0])
circle(d = 1);
}
//
// Bottom contact
//
translate_z(-height + flange_t)
vflip()
rotate(45)
spade(spade3, spade);
}
}