NopSCADlib/vitamins/fuseholder.scad

149 lines
4.7 KiB
OpenSCAD
Raw Normal View History

2019-06-08 17:10:47 -04:00
//
// 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>
2019-06-08 17:10:47 -04:00
include <spades.scad>
use <../utils/tube.scad>
2020-03-05 05:15:42 -05:00
use <../utils/thread.scad>
2019-06-08 17:10:47 -04:00
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;
2020-03-05 05:15:42 -05:00
thread_d = 12;
thread_p = 1;
2019-06-08 17:10:47 -04:00
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 = grey(40);
2019-06-08 17:10:47 -04:00
vflip()
translate_z(thickness)
2020-03-05 05:15:42 -05:00
explode(height) {
color(colour) {
tube(or = nut_d / 2, ir = thread_d / 2, h = nut_flange_t, center = false);
2019-06-08 17:10:47 -04:00
linear_extrude(nut_t)
2019-06-08 17:10:47 -04:00
difference() {
circle(d = nut_d, $fn = 6);
2020-03-05 05:15:42 -05:00
circle(d = thread_d);
2019-06-08 17:10:47 -04:00
}
}
2020-03-05 05:15:42 -05:00
if(show_threads)
female_metric_thread(thread_d, thread_p, nut_t, false, colour = colour);
}
2019-06-08 17:10:47 -04:00
//
// Body
//
explode(height + 5, offset = -height - 4) {
2020-03-05 05:15:42 -05:00
color(colour) {
2019-06-08 17:10:47 -04:00
tube(or = flange_d / 2, ir = 5.2, h = flange_t, center = false);
cylinder(r = 5, h = flange_t - 1);
linear_extrude(flange_t)
2019-06-08 17:10:47 -04:00
difference() {
circle(r = 5);
square([8, 1.5], center = true);
}
vflip() {
2020-03-05 05:15:42 -05:00
if(!show_threads)
linear_extrude(thread)
2020-03-05 05:15:42 -05:00
intersection() {
circle(d = thread_d - 0.3);
2019-06-08 17:10:47 -04:00
2020-03-05 05:15:42 -05:00
square([100, 10.8], center = true);
}
render() difference() {
translate_z(thread)
cylinder(d1 = bot_d, d2 = top_d, h = height - flange_t - thread);
2019-06-08 17:10:47 -04:00
2020-03-05 05:15:42 -05:00
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]);
}
2019-06-08 17:10:47 -04:00
}
2020-03-05 05:15:42 -05:00
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);
}
2019-06-08 17:10:47 -04:00
}
//
// Side contacts
//
2020-03-05 05:15:42 -05:00
color(silver) vflip()
2019-06-08 17:10:47 -04:00
for(side = [-1, 1])
translate([side * contact_slot_d / 2, 0, contact_slot_z])
rotate([0, -70, 90 - side * 90])
linear_extrude(contact_t, center = true) difference() {
2019-06-08 17:10:47 -04:00
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);
}
}