1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-01-16 13:08:15 +01:00

Added fastons.

This commit is contained in:
Chris 2023-03-10 21:09:28 +00:00
parent 62372a049b
commit 584542f87a
7 changed files with 347 additions and 9 deletions

View File

@ -37,6 +37,7 @@ include <vitamins/components.scad>
include <vitamins/displays.scad>
include <vitamins/extrusions.scad>
include <vitamins/extrusion_brackets.scad>
include <vitamins/fastons.scad>
include <vitamins/geared_steppers.scad>
include <vitamins/hot_ends.scad>
include <vitamins/inserts.scad>

View File

@ -63,6 +63,7 @@ use <tests/drag_chain.scad>
use <tests/extrusions.scad>
use <tests/extrusion_brackets.scad>
use <tests/fans.scad>
use <tests/fastons.scad>
use <tests/fuseholder.scad>
use <tests/geared_steppers.scad>
use <tests/hot_ends.scad>
@ -336,9 +337,10 @@ leds_y = 0;
carriers_y = leds_y + 40;
magnets_y = carriers_y + 40;
spades_y = magnets_y + 20;
buttons_y = spades_y + 20;
jacks_y = buttons_y + 40;
microswitches_y = jacks_y + 40;
fastons_y = spades_y + 20;
buttons_y = fastons_y + 20;
jacks_y = buttons_y + 30;
microswitches_y = jacks_y + 30;
rockers_y = microswitches_y + 40;
toggles_y = rockers_y + 60;
components_y = toggles_y + 40;
@ -364,6 +366,9 @@ translate([x2 + 70, leds_y])
translate([x2, spades_y])
spades();
translate([x2, fastons_y])
fastons();
translate([x2, buttons_y])
buttons();

View File

@ -42,12 +42,12 @@ A list of changes classified as breaking, additions or fixes is maintained in [C
<tr><td> <a href = "#Extrusion_brackets">Extrusion_brackets</a> </td><td> <a href = "#PCBs">PCBs</a> </td><td> <a href = "#Terminals">Terminals</a> </td><td> <a href = "#PSU_shroud">PSU_shroud</a> </td><td> <a href = "#Sweep">Sweep</a> </td><td></td></tr>
<tr><td> <a href = "#Extrusions">Extrusions</a> </td><td> <a href = "#PSUs">PSUs</a> </td><td> <a href = "#Toggles">Toggles</a> </td><td> <a href = "#Pocket_handle">Pocket_handle</a> </td><td> <a href = "#Thread">Thread</a> </td><td></td></tr>
<tr><td> <a href = "#Fans">Fans</a> </td><td> <a href = "#Panel_meters">Panel_meters</a> </td><td> <a href = "#Transformers">Transformers</a> </td><td> <a href = "#Press_fit">Press_fit</a> </td><td> <a href = "#Tube">Tube</a> </td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td></td><td></td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Fastons">Fastons</a> </td><td> <a href = "#Pillars">Pillars</a> </td><td> <a href = "#Tubings">Tubings</a> </td><td> <a href = "#Printed_box">Printed_box</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Fuseholder">Fuseholder</a> </td><td> <a href = "#Pillow_blocks">Pillow_blocks</a> </td><td> <a href = "#Variacs">Variacs</a> </td><td> <a href = "#Printed_pulleys">Printed_pulleys</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Geared_steppers">Geared_steppers</a> </td><td> <a href = "#Pin_headers">Pin_headers</a> </td><td> <a href = "#Veroboard">Veroboard</a> </td><td> <a href = "#Ribbon_clamp">Ribbon_clamp</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Green_terminals">Green_terminals</a> </td><td> <a href = "#Potentiometers">Potentiometers</a> </td><td> <a href = "#Washers">Washers</a> </td><td> <a href = "#SSR_shroud">SSR_shroud</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hot_ends">Hot_ends</a> </td><td> <a href = "#Pulleys">Pulleys</a> </td><td> <a href = "#Wire">Wire</a> </td><td> <a href = "#Screw_knob">Screw_knob</a> </td><td></td><td></td></tr>
<tr><td> <a href = "#Hygrometer">Hygrometer</a> </td><td></td><td> <a href = "#Zipties">Zipties</a> </td><td> <a href = "#Socket_box">Socket_box</a> </td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td> <a href = "#Strap_handle">Strap_handle</a> </td><td></td><td></td></tr>
</table>
@ -1195,6 +1195,56 @@ Can draw three styles: solid, open frame and open frame with screw bosses.
| 32 | `washer(M4_washer)` | Washer M4 x 9mm x 0.8mm |
<a href="#top">Top</a>
---
<a name="Fastons"></a>
## Fastons
Faston receptacles to mate with spade connectors
[vitamins/fastons.scad](vitamins/fastons.scad) Object definitions.
[vitamins/faston.scad](vitamins/faston.scad) Implementation.
[tests/fastons.scad](tests/fastons.scad) Code for this example.
### Properties
| Function | Description |
|:--- |:--- |
| `faston_d_bot(type)` | Radius of bottom corners |
| `faston_d_top(type)` | Radius of the clips |
| `faston_fillet_d(type)` | Fillets at the transition |
| `faston_insul_crimp_d(type)` | Outside diameter of the insulation crimp |
| `faston_insul_crimp_l(type)` | Length of the insulation crimp |
| `faston_insul_crimp_o(type)` | Offset of insulation crimp |
| `faston_insul_crimp_p(type)` | Position of the tip of the insulation crimp |
| `faston_size(type)` | Size of the receptical part |
| `faston_t(type)` | Thickness |
| `faston_wall_h(type)` | Height of transition web wall |
| `faston_width(type)` | Width of matching spade |
| `faston_wire_crimp_d(type)` | Outside diameter of the wire crimp |
| `faston_wire_crimp_l(type)` | Length of the wire crimp |
| `faston_wire_crimp_p(type)` | Position of the tip of the wire crimp |
### Functions
| Function | Description |
|:--- |:--- |
| `faston_insul_stop(type)` | Position where insulation stops |
| `faston_length(type)` | Total length of crimp |
### Modules
| Module | Description |
|:--- |:--- |
| `faston(type, closed = false)` | Draw specified faston |
![fastons](tests/png/fastons.png)
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 4 | `faston(5_160430_7)` | Faston part no 5_160430_7 to fit 4.75mm spade |
<a href="#top">Top</a>
---

35
tests/fastons.scad Normal file
View File

@ -0,0 +1,35 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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/>.
//
include <../utils/core/core.scad>
include <../vitamins/fastons.scad>
module fastons()
for(i = [0, len(fastons) - 1])
translate([i * 20, 0])
let(f = fastons[i]) {
rotate(180)
faston(f);
translate([10, 0])
rotate(180)
faston(f, true);
}
fastons();

BIN
tests/png/fastons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

219
vitamins/faston.scad Normal file
View File

@ -0,0 +1,219 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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/>.
//
//
//! Faston receptacles to mate with spade connectors
//
include <../utils/core/core.scad>
include <../utils/sector.scad>
function faston_width(type) = type[1]; //! Width of matching spade
function faston_size(type) = type[2]; //! Size of the receptical part
function faston_d_top(type) = type[3]; //! Radius of the clips
function faston_d_bot(type) = type[4]; //! Radius of bottom corners
function faston_t(type) = type[5]; //! Thickness
function faston_wire_crimp_l(type) = type[6]; //! Length of the wire crimp
function faston_wire_crimp_d(type) = type[7]; //! Outside diameter of the wire crimp
function faston_wire_crimp_p(type) = type[8]; //! Position of the tip of the wire crimp
function faston_fillet_d(type) = type[9]; //! Fillets at the transition
function faston_wall_h(type) = type[10]; //! Height of transition web wall
function faston_insul_crimp_l(type) = type[11]; //! Length of the insulation crimp
function faston_insul_crimp_d(type) = type[12]; //! Outside diameter of the insulation crimp
function faston_insul_crimp_p(type) = type[13]; //! Position of the tip of the insulation crimp
function faston_insul_crimp_o(type) = type[14]; //! Offset of insulation crimp
function faston_length(type) = //! Total length of crimp
faston_insul_crimp_p(type).z + faston_insul_crimp_l(type);
function faston_insul_stop(type) = //! Position where insulation stops
faston_wire_crimp_p(type).z + faston_wire_crimp_l(type);
module faston(type, closed = false) { //! Draw specified faston
vitamin(str("faston(", type[0], "): Faston part no ", type[0], " to fit ", faston_width(type), "mm spade"));
s = faston_size(type);
r_top = faston_d_top(type) / 2;
r_bot = faston_d_bot(type) / 2;
t = faston_t(type);
wc_l = faston_wire_crimp_l(type);
wc_r = faston_wire_crimp_d(type) / 2;
wc_p = faston_wire_crimp_p(type);
fillet_r = faston_fillet_d(type) / 2;
wall_h = faston_wall_h(type);
ic_l = faston_insul_crimp_l(type);
ic_r = faston_insul_crimp_d(type) / 2;
ic_p = faston_insul_crimp_p(type);
ic_o = faston_insul_crimp_o(type);
$fn = 64;
// Receptical
module reciptical_shape()
for(side = [-1, 1]) mirror([side < 0 ? 1 : 0, 0]) {
translate([s.x / 2 - r_top, s.y - r_top])
difference() {
sector(r_top, 0, 180);
sector(r_top - t, 0, 180);
}
translate([s.x / 2 - r_bot, r_bot])
difference() {
sector(r_bot, -90, 0);
sector(r_bot - t, -90, 0);
}
translate([s.x / 2 - t, r_bot])
square([t, s.y - r_top - r_bot]);
square([s.x / 2 - r_bot, t]);
}
module crimp_shape(p, r, offset = 0) {
hpot = norm([p.x, p.y] - [0, r + offset]);
opp = sqrt(sqr(hpot) - sqr(r));
angle = atan((p.y - (r + offset)) / p.x) - acos(r / hpot);
r_crimp = r / 2 - eps;
lift = -0.1;
z = (opp - r * 2 * PI / -angle / 360 - PI * r_crimp) / 2 + lift / 2;
for(side = [-1, 1]) mirror([side < 0 ? 1 : 0, 0])
translate([0, r + offset]) {
difference() {
sector(r, 270, 360 + (closed ? 0 : angle));
circle(r - t);
}
if(!closed)
rotate(angle)
translate([r - t, -eps])
square([t, opp]);
else {
translate([r - r_crimp, z])
difference() {
sector(r_crimp, 0, 180);
circle(r_crimp - t);
}
translate([r - t, 0])
square([t, z]);
translate([r - 2 * r_crimp, lift])
square([t, z - lift]);
}
}
}
// Wire crimp
module wire_crimp_shape() crimp_shape(wc_p, wc_r);
// Insulation crimp
module insul_crimp_shape() crimp_shape(ic_p, ic_r, ic_o);
module crop(z = 0)
intersection() {
children();
square([s.x, 2 * (wall_h + fillet_r + z)], center = true);
}
color(silver) translate([0, -t]) {
// Transition from reciptical to wire crimp
render() difference() {
hull() {
translate_z(s.z)
linear_extrude(eps)
crop()
reciptical_shape();
translate_z(wc_p.z - eps)
linear_extrude(eps)
crop()
wire_crimp_shape();
}
translate([0, s.y, (s.z + wc_p.z) / 2])
rotate([0, 90, 0])
rounded_rectangle([wc_p.z - s.z, 2 * (s.y - wall_h), s.x + 1], fillet_r, center = true);
hull() {
translate_z(s.z - eps)
linear_extrude(eps)
offset(-t)
crop(t)
hull()
reciptical_shape();
translate_z(wc_p.z + eps / 8)
linear_extrude(eps / 8)
offset(-t)
crop(t)
hull()
wire_crimp_shape();
}
}
// Transition from wire crimp to insulation crimp
render() difference() {
hull() {
translate_z(wc_p.z + wc_l)
linear_extrude(eps)
wire_crimp_shape();
translate_z(ic_p.z - eps)
linear_extrude(eps)
insul_crimp_shape();
}
gap = ic_p.z - wc_p.z - wc_l;
d = gap * 2 / 3;
translate([0, wall_h + fillet_r - gap / 2, ic_p.z - d / 2])
hull() {
rotate([0, 90, 0])
cylinder(d = d, h = 10, center = true);
translate([-5, d / 2, d / 2 - gap])
cube([10, 10, gap]);
}
hull() {
translate_z(wc_p.z + wc_l - eps)
linear_extrude(eps)
offset(-t)
hull()
wire_crimp_shape();
translate_z(ic_p.z + eps / 8)
linear_extrude(eps / 8)
offset(-t)
hull()
insul_crimp_shape();
}
}
linear_extrude(s.z)
reciptical_shape();
translate_z(wc_p.z)
linear_extrude(wc_l)
wire_crimp_shape();
translate_z(ic_p.z)
linear_extrude(ic_l)
insul_crimp_shape();
}
}

28
vitamins/fastons.scad Normal file
View File

@ -0,0 +1,28 @@
//
// NopSCADlib Copyright Chris Palmer 2023
// 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/>.
//
//
//! Faston receptacles to mate with spade connectors
//
5_160430_7 = ["5_160430_7", 4.75, [5.6, 2.56, 6.3], 2.25, 1.13, 0.32, 3.2, 1.64, [1.64, 3.09, 9], 0.5, 0.96, 1.7, 3.53, [2.08, 4.47, 13.3], -0.4];
fastons = [5_160430_7];
use <faston.scad>