forked from nophead/NopSCADlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ring_terminal.scad
146 lines (130 loc) · 5.38 KB
/
ring_terminal.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
//
// 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/>.
//
//
//! Ring terminals and earth assemblies for DiBond panels.
//
include <../utils/core/core.scad>
use <screw.scad>
use <nut.scad>
use <washer.scad>
use <../utils/tube.scad>
function ringterm_od(type) = type[1]; //! Outside diameter
function ringterm_id(type) = type[2]; //! Inside diameter
function ringterm_length(type) = type[3]; //! Length of the tail including the ring
function ringterm_width(type) = type[4]; //! Width of the tail
function ringterm_hole(type) = type[5]; //! Wire hole diameter
function ringterm_thickness(type) = type[6]; //! Metal thickness
function ringterm_screw(type) = type[7]; //! Screw type
function ringterm_crimp_length(type) = type[8]; //! If non-zero the length of the crimp tube
function ringterm_extent(type) = ringterm_length(type) / sqrt(2); //! Space to leave
module ring_terminal(type) { //! Draw specifeid ring terminal
screw = ringterm_screw(type);
d = 2 * screw_radius(screw);
crimp = ringterm_crimp_length(type);
vitamin(str("ring_terminal(", type[0], "): Ring terminal ", crimp ? "crimp " : "", d, "mm"));
t = ringterm_thickness(type);
w = ringterm_width(type);
od = ringterm_od(type);
id = ringterm_id(type);
l = ringterm_length(type);
angle = crimp ? 0 : 45;
transition = 1;
bend = crimp ? l - od / 2 - crimp - transition : washer_radius(screw_washer(screw)) + t * tan(angle / 2);
hole_d = ringterm_hole(type);
module hull_if_crimp()
if(crimp)
hull()
children();
else
children();
color("silver") union() {
linear_extrude(height = t)
difference() {
hull_if_crimp() {
circle(d = od);
translate([-w / 2, -bend, 0])
square([w, bend - id / 2]);
}
circle(d = id);
}
if(crimp) {
translate([0, -bend, w / 2])
rotate([90, 0, 0]) {
render() difference() {
union() {
translate_z(transition)
cylinder(d = w, h = crimp);
hull() {
translate_z(transition)
cylinder(d = w, h = eps);
translate([-w / 2, -w / 2])
cube([w, t, eps]);
}
}
hull() {
translate_z(-eps)
cylinder(d = w - 2 * t, h = crimp + transition + 2 * eps);
translate([-w / 2 + t, -w / 2 + t])
cube([w - 2 * t, w / 2 - t, eps]);
}
translate([0, w / 2])
cube([0.1, w, 100], center = true);
}
}
}
else
translate([0, -bend])
rotate([-angle, 0, 0])
linear_extrude(height = t)
difference() {
length = l - od / 2 - bend;
hull() {
translate([-w / 2, -eps])
square([w, eps]);
translate([0, -length + w / 2])
circle(d = w);
}
if(hole_d)
translate([0, -length + w / 2])
circle(d = hole_d);
}
}
translate_z(ringterm_thickness(type))
children();
}
module ring_terminal_hole(type, h = 0) //! Drill hole for the screw
drill(screw_clearance_radius(ringterm_screw(type)), h);
module ring_terminal_assembly(type, thickness, top = false) { //! Earthing assembly for DiBond twin skins
screw = ringterm_screw(type);
washer = screw_washer(screw);
nut = screw_nut(screw);
screw_length = screw_longer_than(thickness + 2 * washer_thickness(washer) + nut_thickness(nut, true) + ringterm_thickness(type));
explode(10, true) star_washer(washer)
if(top)
ring_terminal(type) screw(screw, screw_length);
else
screw(screw, screw_length);
vflip()
translate_z(thickness)
explode(10, true) star_washer(washer)
if(!top)
explode(10,true) ring_terminal(type) nut(nut, true);
else
nut(nut, true);
}