Dome option added to nut to draw acorn nuts.
Chamfers added to nuts and hex head screws when manifold is used.
BIN
libtest.png
Before Width: | Height: | Size: 976 KiB After Width: | Height: | Size: 977 KiB |
@@ -226,7 +226,7 @@ translate([950, 1525])
|
|||||||
|
|
||||||
inserts_y = 0;
|
inserts_y = 0;
|
||||||
nuts_y = inserts_y + 20;
|
nuts_y = inserts_y + 20;
|
||||||
washers_y = nuts_y + 120;
|
washers_y = nuts_y + 140;
|
||||||
screws_y = washers_y + 120;
|
screws_y = washers_y + 120;
|
||||||
circlips_y = screws_y + 180;
|
circlips_y = screws_y + 180;
|
||||||
springs_y = circlips_y + 20;
|
springs_y = circlips_y + 20;
|
||||||
|
10
readme.md
@@ -2348,6 +2348,7 @@ If a nut is given a child then it gets placed on its top surface.
|
|||||||
### Properties
|
### Properties
|
||||||
| Function | Description |
|
| Function | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
|
| `nut_dome(type)` | Dome height and max thread depth if a domed acorn nut |
|
||||||
| `nut_pitch(type)` | Pitch if not standard metric course thread |
|
| `nut_pitch(type)` | Pitch if not standard metric course thread |
|
||||||
| `nut_radius(type)` | Radius across the corners |
|
| `nut_radius(type)` | Radius across the corners |
|
||||||
| `nut_size(type)` | Diameter of the corresponding screw |
|
| `nut_size(type)` | Diameter of the corresponding screw |
|
||||||
@@ -2360,8 +2361,10 @@ If a nut is given a child then it gets placed on its top surface.
|
|||||||
### Functions
|
### Functions
|
||||||
| Function | Description |
|
| Function | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
|
| `nut_dome_height(type)` | Height of the domed version |
|
||||||
| `nut_flat_radius(type)` | Radius across the flats |
|
| `nut_flat_radius(type)` | Radius across the flats |
|
||||||
| `nut_thickness(type, nyloc = false)` | Thickness of plain or nyloc version |
|
| `nut_thickness(type, nyloc = false)` | Thickness of plain or nyloc version |
|
||||||
|
| `nut_thread_depth(type)` | Max thread depth in domed version |
|
||||||
| `nut_trap_flat_radius(nut, horizontal = false)` | Radius across the flats of a nut trap |
|
| `nut_trap_flat_radius(nut, horizontal = false)` | Radius across the flats of a nut trap |
|
||||||
| `nut_trap_radius(nut, horizontal = false)` | Radius across the corners of a nut trap |
|
| `nut_trap_radius(nut, horizontal = false)` | Radius across the corners of a nut trap |
|
||||||
| `t_nut_tab(type)` | Sliding t-nut T dimensions |
|
| `t_nut_tab(type)` | Sliding t-nut T dimensions |
|
||||||
@@ -2369,7 +2372,7 @@ If a nut is given a child then it gets placed on its top surface.
|
|||||||
### Modules
|
### Modules
|
||||||
| Module | Description |
|
| Module | Description |
|
||||||
|:--- |:--- |
|
|:--- |:--- |
|
||||||
| `nut(type, nyloc = false, brass = false, nylon = false)` | Draw specified nut |
|
| `nut(type, nyloc = false, brass = false, nylon = false, dome = false)` | Draw specified nut |
|
||||||
| `nut_and_washer(type, nyloc)` | Draw nut with corresponding washer |
|
| `nut_and_washer(type, nyloc)` | Draw nut with corresponding washer |
|
||||||
| `nut_square(type, brass = false, nylon = false)` | Draw specified square nut |
|
| `nut_square(type, brass = false, nylon = false)` | Draw specified square nut |
|
||||||
| `nut_trap(screw, nut, depth = 0, horizontal = false, supported = false, h = 200)` | Make a nut trap |
|
| `nut_trap(screw, nut, depth = 0, horizontal = false, supported = false, h = 200)` | Make a nut trap |
|
||||||
@@ -2390,24 +2393,29 @@ If a nut is given a child then it gets placed on its top surface.
|
|||||||
| 1 | `sliding_t_nut(M3_sliding_t_nut)` | Nut M3 sliding T |
|
| 1 | `sliding_t_nut(M3_sliding_t_nut)` | Nut M3 sliding T |
|
||||||
| 1 | `nut(M3_nut)` | Nut M3 x 2.4mm |
|
| 1 | `nut(M3_nut)` | Nut M3 x 2.4mm |
|
||||||
| 1 | `nut(M3_nut, brass = true)` | Nut M3 x 2.4mm brass |
|
| 1 | `nut(M3_nut, brass = true)` | Nut M3 x 2.4mm brass |
|
||||||
|
| 1 | `nut(M3_nut, dome = true)` | Nut M3 x 2.4mm domed |
|
||||||
| 1 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
|
| 1 | `nut(M3_nut, nyloc = true)` | Nut M3 x 2.4mm nyloc |
|
||||||
| 1 | `nut(M3nS_thin_nut)` | Nut M3nS 5.5 x 1.8mm |
|
| 1 | `nut(M3nS_thin_nut)` | Nut M3nS 5.5 x 1.8mm |
|
||||||
| 1 | `sliding_t_nut(M4_hammer_nut)` | Nut M4 hammer |
|
| 1 | `sliding_t_nut(M4_hammer_nut)` | Nut M4 hammer |
|
||||||
| 1 | `sliding_t_nut(M4_sliding_t_nut)` | Nut M4 sliding T |
|
| 1 | `sliding_t_nut(M4_sliding_t_nut)` | Nut M4 sliding T |
|
||||||
| 1 | `nut(M4_nut)` | Nut M4 x 3.2mm |
|
| 1 | `nut(M4_nut)` | Nut M4 x 3.2mm |
|
||||||
|
| 1 | `nut(M4_nut, dome = true)` | Nut M4 x 3.2mm domed |
|
||||||
| 1 | `nut(M4_nut, nyloc = true)` | Nut M4 x 3.2mm nyloc |
|
| 1 | `nut(M4_nut, nyloc = true)` | Nut M4 x 3.2mm nyloc |
|
||||||
| 1 | `nut(M4nS_thin_nut)` | Nut M4nS 7 x 2.2mm |
|
| 1 | `nut(M4nS_thin_nut)` | Nut M4nS 7 x 2.2mm |
|
||||||
| 1 | `sliding_t_nut(M5_sliding_t_nut)` | Nut M5 sliding T |
|
| 1 | `sliding_t_nut(M5_sliding_t_nut)` | Nut M5 sliding T |
|
||||||
| 1 | `nut(M5_nut)` | Nut M5 x 4mm |
|
| 1 | `nut(M5_nut)` | Nut M5 x 4mm |
|
||||||
|
| 1 | `nut(M5_nut, dome = true)` | Nut M5 x 4mm domed |
|
||||||
| 1 | `nut(M5_nut, nyloc = true)` | Nut M5 x 4mm nyloc |
|
| 1 | `nut(M5_nut, nyloc = true)` | Nut M5 x 4mm nyloc |
|
||||||
| 1 | `nut(M5nS_thin_nut)` | Nut M5nS 8 x 2.7mm |
|
| 1 | `nut(M5nS_thin_nut)` | Nut M5nS 8 x 2.7mm |
|
||||||
| 1 | `sliding_t_nut(M6_sliding_t_nut)` | Nut M6 hammer |
|
| 1 | `sliding_t_nut(M6_sliding_t_nut)` | Nut M6 hammer |
|
||||||
| 1 | `nut(M6_half_nut)` | Nut M6 x 3mm |
|
| 1 | `nut(M6_half_nut)` | Nut M6 x 3mm |
|
||||||
| 1 | `nut(M6_nut)` | Nut M6 x 5mm |
|
| 1 | `nut(M6_nut)` | Nut M6 x 5mm |
|
||||||
|
| 1 | `nut(M6_nut, dome = true)` | Nut M6 x 5mm domed |
|
||||||
| 1 | `nut(M6_nut, nyloc = true)` | Nut M6 x 5mm nyloc |
|
| 1 | `nut(M6_nut, nyloc = true)` | Nut M6 x 5mm nyloc |
|
||||||
| 1 | `nut(M6nS_thin_nut)` | Nut M6nS 10 x 3.2mm |
|
| 1 | `nut(M6nS_thin_nut)` | Nut M6nS 10 x 3.2mm |
|
||||||
| 1 | `sliding_t_nut(M8_sliding_ball_t_nut)` | Nut M8 sliding T with spring loaded ball |
|
| 1 | `sliding_t_nut(M8_sliding_ball_t_nut)` | Nut M8 sliding T with spring loaded ball |
|
||||||
| 1 | `nut(M8_nut)` | Nut M8 x 6.5mm |
|
| 1 | `nut(M8_nut)` | Nut M8 x 6.5mm |
|
||||||
|
| 1 | `nut(M8_nut, dome = true)` | Nut M8 x 6.5mm domed |
|
||||||
| 1 | `nut(M8_nut, nyloc = true)` | Nut M8 x 6.5mm nyloc |
|
| 1 | `nut(M8_nut, nyloc = true)` | Nut M8 x 6.5mm nyloc |
|
||||||
| 1 | `nut(M8nS_thin_nut)` | Nut M8nS 13 x 4mm |
|
| 1 | `nut(M8nS_thin_nut)` | Nut M8nS 13 x 4mm |
|
||||||
| 1 | `washer(M6_washer)` | Washer M6 x 12.5mm x 1.5mm |
|
| 1 | `washer(M6_washer)` | Washer M6 x 12.5mm x 1.5mm |
|
||||||
|
@@ -20,8 +20,10 @@ include <../utils/core/core.scad>
|
|||||||
|
|
||||||
use <../vitamins/fuseholder.scad>
|
use <../vitamins/fuseholder.scad>
|
||||||
|
|
||||||
|
thickness = 6;
|
||||||
|
|
||||||
module fuseholders()
|
module fuseholders()
|
||||||
fuseholder(6);
|
fuseholder(thickness);
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
let($show_threads = 1)
|
let($show_threads = 1)
|
||||||
|
@@ -25,7 +25,11 @@ module nuts() {
|
|||||||
translate([0, nyloc ? 20 : 0])
|
translate([0, nyloc ? 20 : 0])
|
||||||
nut(n, nyloc);
|
nut(n, nyloc);
|
||||||
|
|
||||||
translate([0, 40]) {
|
translate([0, 40])
|
||||||
|
if(nut_dome(n))
|
||||||
|
nut(n, dome = true);
|
||||||
|
|
||||||
|
translate([0, 60]) {
|
||||||
if(n == M3_nut)
|
if(n == M3_nut)
|
||||||
nut(n, brass = true);
|
nut(n, brass = true);
|
||||||
|
|
||||||
@@ -43,7 +47,7 @@ module nuts() {
|
|||||||
#nut_trap(M8_cap_screw, n, h = 30);
|
#nut_trap(M8_cap_screw, n, h = 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
translate([0, 60]) {
|
translate([0, 80]) {
|
||||||
if(n == M3_nut)
|
if(n == M3_nut)
|
||||||
sliding_t_nut(M3_sliding_t_nut);
|
sliding_t_nut(M3_sliding_t_nut);
|
||||||
|
|
||||||
@@ -61,7 +65,7 @@ module nuts() {
|
|||||||
sliding_t_nut(M8_sliding_ball_t_nut);
|
sliding_t_nut(M8_sliding_ball_t_nut);
|
||||||
}
|
}
|
||||||
|
|
||||||
translate([0, 80]) {
|
translate([0, 100]) {
|
||||||
if(n == M3_nut)
|
if(n == M3_nut)
|
||||||
sliding_t_nut(M3_hammer_nut);
|
sliding_t_nut(M3_hammer_nut);
|
||||||
|
|
||||||
@@ -69,7 +73,7 @@ module nuts() {
|
|||||||
sliding_t_nut(M4_hammer_nut);
|
sliding_t_nut(M4_hammer_nut);
|
||||||
}
|
}
|
||||||
|
|
||||||
translate([0, 100]) {
|
translate([0, 120]) {
|
||||||
if(n == M3_nut)
|
if(n == M3_nut)
|
||||||
nut_square(M3nS_thin_nut);
|
nut_square(M3nS_thin_nut);
|
||||||
if(n == M4_nut)
|
if(n == M4_nut)
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 274 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 244 KiB After Width: | Height: | Size: 244 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 133 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 164 KiB |
Before Width: | Height: | Size: 191 KiB After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
@@ -20,7 +20,7 @@
|
|||||||
//
|
//
|
||||||
//! 20mm panel mount fuse holder.
|
//! 20mm panel mount fuse holder.
|
||||||
//
|
//
|
||||||
include <../utils/core/core.scad>
|
include <../core.scad>
|
||||||
include <spades.scad>
|
include <spades.scad>
|
||||||
use <../utils/tube.scad>
|
use <../utils/tube.scad>
|
||||||
use <../utils/thread.scad>
|
use <../utils/thread.scad>
|
||||||
@@ -69,18 +69,10 @@ module fuseholder(thickness) { //! Fuseholder with nut in place for specified pa
|
|||||||
vflip()
|
vflip()
|
||||||
translate_z(thickness)
|
translate_z(thickness)
|
||||||
explode(height, explode_children = true) {
|
explode(height, explode_children = true) {
|
||||||
color(colour) {
|
color(colour)
|
||||||
tube(or = nut_d / 2, ir = thread_d / 2, h = nut_flange_t, center = false);
|
tube(or = nut_d / 2, ir = thread_d / 2, h = nut_flange_t, center = false);
|
||||||
|
|
||||||
linear_extrude(nut_t)
|
draw_nut(nut_d, thread_d, nut_t, thread_p, colour, show_threads && exploded() || thickness > thread);
|
||||||
difference() {
|
|
||||||
circle(d = nut_d, $fn = 6);
|
|
||||||
|
|
||||||
circle(d = thread_d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(show_threads && exploded())
|
|
||||||
female_metric_thread(thread_d, thread_p, nut_t, false, colour = colour);
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// Body
|
// Body
|
||||||
|
@@ -149,18 +149,8 @@ module jack_4mm_plastic(colour, thickness, display_colour = false) { //! Draw a
|
|||||||
}
|
}
|
||||||
translate_z(-thickness)
|
translate_z(-thickness)
|
||||||
explode(-length)
|
explode(-length)
|
||||||
vflip() {
|
vflip()
|
||||||
color(silver)
|
draw_nut(nut_d, thread_d, nut_t, thread_p, silver, show_threads);
|
||||||
linear_extrude(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 = silver);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function jack_4mm_shielded_hole_radius() = 12 / 2; //! Panel hole radius for 4mm shielded jack
|
function jack_4mm_shielded_hole_radius() = 12 / 2; //! Panel hole radius for 4mm shielded jack
|
||||||
@@ -282,14 +272,7 @@ module post_4mm(colour, thickness, display_colour = false) { //! Draw a 4mm bind
|
|||||||
module nut() {
|
module nut() {
|
||||||
nut_t = 2.3;
|
nut_t = 2.3;
|
||||||
|
|
||||||
color(silver)
|
draw_nut(6.3 / cos(30), thread_d, nut_t, thread_p, silver, show_threads);
|
||||||
linear_extrude(nut_t) difference() {
|
|
||||||
circle(d = 6.3 / cos(30), $fn = 6);
|
|
||||||
|
|
||||||
circle(d = thread_d);
|
|
||||||
}
|
|
||||||
if(show_threads)
|
|
||||||
female_metric_thread(thread_d, thread_p, nut_t, false, colour = silver);
|
|
||||||
|
|
||||||
translate_z(nut_t)
|
translate_z(nut_t)
|
||||||
children();
|
children();
|
||||||
@@ -498,16 +481,6 @@ module power_jack(thickness) { //! Draw a power jack socket with nut positioned
|
|||||||
// Nut
|
// Nut
|
||||||
translate_z(-thickness)
|
translate_z(-thickness)
|
||||||
explode(-length)
|
explode(-length)
|
||||||
vflip() {
|
vflip()
|
||||||
color(silver)
|
draw_nut(nut_d, thread_d, nut_t, thread_p, silver, show_threads);
|
||||||
linear_extrude(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 = silver);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -37,6 +37,7 @@ function nut_thickness(type, nyloc = false) = nyloc ? type[4] : type[3]; //! Thi
|
|||||||
function nut_washer(type) = type[5]; //! Corresponding washer
|
function nut_washer(type) = type[5]; //! Corresponding washer
|
||||||
function nut_trap_depth(type) = type[6]; //! Depth of nut trap
|
function nut_trap_depth(type) = type[6]; //! Depth of nut trap
|
||||||
function nut_pitch(type) = type[7]; //! Pitch if not standard metric course thread
|
function nut_pitch(type) = type[7]; //! Pitch if not standard metric course thread
|
||||||
|
function nut_dome(type) = type[8]; //! Dome height and max thread depth if a domed acorn nut
|
||||||
|
|
||||||
function nut_flat_radius(type) = nut_radius(type) * cos(30); //! Radius across the flats
|
function nut_flat_radius(type) = nut_radius(type) * cos(30); //! Radius across the flats
|
||||||
|
|
||||||
@@ -44,36 +45,84 @@ function nut_square_size(type) = type[1]; //! Diameter of the corresponding
|
|||||||
function nut_square_width(type) = type[2]; //! Width of the square nut
|
function nut_square_width(type) = type[2]; //! Width of the square nut
|
||||||
function nut_square_thickness(type) = type[3]; //! Thickness of the square nut
|
function nut_square_thickness(type) = type[3]; //! Thickness of the square nut
|
||||||
|
|
||||||
module nut(type, nyloc = false, brass = false, nylon = false) { //! Draw specified nut
|
function nut_dome_height(type) = let(d = nut_dome(type)) d ? d[0] : nut_thickness(type); //! Height of the domed version
|
||||||
|
function nut_thread_depth(type) = let(d = nut_dome(type)) d ? d[1] : nut_thickness(type); //! Max thread depth in domed version
|
||||||
|
|
||||||
|
module draw_nut(od, id, t, pitch, colour, show_thread, thread_h = undef ) {
|
||||||
|
th = is_undef(thread_h) ? t : thread_h;
|
||||||
|
|
||||||
|
color(colour) {
|
||||||
|
or = od / 2;
|
||||||
|
fr = or * cos(30);
|
||||||
|
|
||||||
|
render_if(manifold) intersection() {
|
||||||
|
linear_extrude(t, convexity = 5)
|
||||||
|
difference() {
|
||||||
|
circle(or, $fn = 6);
|
||||||
|
|
||||||
|
if(id)
|
||||||
|
circle(d = id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(manifold)
|
||||||
|
rotate_extrude()
|
||||||
|
hull() {
|
||||||
|
h = (or - fr) * tan(30);
|
||||||
|
|
||||||
|
translate([0, -eps])
|
||||||
|
square([fr, t + eps]);
|
||||||
|
|
||||||
|
translate([or, h])
|
||||||
|
square([eps, t - 2 * h]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(show_thread && id)
|
||||||
|
female_metric_thread(id, pitch,
|
||||||
|
th,
|
||||||
|
top = th > t ? 0 : manifold ? 1 : -1,
|
||||||
|
bot = manifold ? 1 : -1,
|
||||||
|
center = false, colour = colour);
|
||||||
|
}
|
||||||
|
|
||||||
|
module nut(type, nyloc = false, brass = false, nylon = false, dome = false) { //! Draw specified nut
|
||||||
thread_d = nut_size(type);
|
thread_d = nut_size(type);
|
||||||
thread_p = nut_pitch(type) ? nut_pitch(type) : metric_coarse_pitch(thread_d);
|
thread_p = nut_pitch(type) ? nut_pitch(type) : metric_coarse_pitch(thread_d);
|
||||||
hole_rad = thread_d / 2;
|
hole_rad = thread_d / 2;
|
||||||
outer_rad = nut_radius(type);
|
outer_rad = nut_radius(type);
|
||||||
thickness = nut_thickness(type);
|
thickness = nut_thickness(type);
|
||||||
nyloc_thickness = nut_thickness(type, true);
|
nyloc_thickness = nut_thickness(type, true);
|
||||||
desc = nyloc ? "nyloc" : brass ? "brass" : nylon ? "nylon" : "";
|
desc = nyloc ? "nyloc" : brass ? "brass" : nylon ? "nylon" : dome ? "domed" : "";
|
||||||
vitamin(str("nut(", type[0], arg(nyloc, false, "nyloc"), arg(brass, false, "brass"), arg(nylon, false, "nylon"),
|
vitamin(str("nut(", type[0],
|
||||||
|
arg(nyloc, false, "nyloc"),
|
||||||
|
arg(brass, false, "brass"),
|
||||||
|
arg(nylon, false, "nylon"),
|
||||||
|
arg(dome, false, "dome"),
|
||||||
"): Nut M", nut_size(type), " x ", thickness, "mm ", desc));
|
"): Nut M", nut_size(type), " x ", thickness, "mm ", desc));
|
||||||
|
|
||||||
$fs = fs; $fa = fa;
|
$fs = fs; $fa = fa;
|
||||||
|
|
||||||
colour = brass ? brass_colour : nylon ? grey(30): grey(70);
|
colour = brass ? brass_colour : nylon ? grey(30): grey(70);
|
||||||
explode(nyloc ? 10 : 0) {
|
explode(nyloc ? 10 : 0) {
|
||||||
|
draw_nut(outer_rad * 2, thread_d, thickness, thread_p, colour, show_threads, dome ? nut_thread_depth(type) : thickness);
|
||||||
|
|
||||||
|
fr = nut_flat_radius(type);
|
||||||
color(colour) {
|
color(colour) {
|
||||||
linear_extrude(thickness)
|
|
||||||
difference() {
|
|
||||||
circle(outer_rad, $fn = 6);
|
|
||||||
|
|
||||||
circle(hole_rad);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(nyloc)
|
if(nyloc)
|
||||||
translate_z(-eps)
|
translate_z(eps)
|
||||||
rounded_cylinder(r = outer_rad * cos(30) , h = nyloc_thickness, r2 = (nyloc_thickness - thickness) / 2, ir = hole_rad);
|
rounded_cylinder(r = outer_rad * cos(30), h = nyloc_thickness - eps, r2 = (nyloc_thickness - thickness) / 2, ir = hole_rad);
|
||||||
}
|
|
||||||
|
|
||||||
if(show_threads)
|
if(dome)
|
||||||
female_metric_thread(thread_d, thread_p, thickness, center = false, colour = colour);
|
translate_z(thickness)
|
||||||
|
rotate_extrude()
|
||||||
|
difference() {
|
||||||
|
h = nut_dome_height(type) - thickness;
|
||||||
|
r = fr - eps;
|
||||||
|
rounded_corner(r, h, r);
|
||||||
|
|
||||||
|
square([thread_d / 2, nut_thread_depth(type) - thickness]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(nyloc)
|
if(nyloc)
|
||||||
translate_z(thickness)
|
translate_z(thickness)
|
||||||
|
@@ -28,25 +28,25 @@ M5_nut_depth = 4;
|
|||||||
M6_nut_depth = 5;
|
M6_nut_depth = 5;
|
||||||
M8_nut_depth = 6.5;
|
M8_nut_depth = 6.5;
|
||||||
|
|
||||||
// s d t n w t t
|
// s d t n w t t d d
|
||||||
// c i h y a r h
|
// c i h y a r h o o
|
||||||
// r a i l s a r
|
// r a i l s a r m m
|
||||||
// e m c o h p e
|
// e m c o h p e e e
|
||||||
// w e k c e d
|
// w e k c e d
|
||||||
// t n r d
|
// t n r d h t
|
||||||
// e e t e p
|
// e e t e p e h
|
||||||
// r s h p i
|
// r s h p i i r
|
||||||
// s k t t
|
// s k t t g e
|
||||||
// h c
|
// h c h a
|
||||||
// h
|
// h t d
|
||||||
M2_nut = ["M2_nut", 2, 4.9, 1.6, 2.4, M2_washer, M2_nut_trap_depth, 0];
|
M2_nut = ["M2_nut", 2, 4.9, 1.6, 2.4, M2_washer, M2_nut_trap_depth, 0];
|
||||||
M2p5_nut = ["M2p5_nut", 2.5, 5.8, 2.2, 3.8, M2p5_washer, M2p5_nut_trap_depth, 0];
|
M2p5_nut = ["M2p5_nut", 2.5, 5.8, 2.2, 3.8, M2p5_washer, M2p5_nut_trap_depth, 0];
|
||||||
M3_nut = ["M3_nut", 3, 6.4, 2.4, 4, M3_washer, M3_nut_trap_depth, 0];
|
M3_nut = ["M3_nut", 3, 6.4, 2.4, 4, M3_washer, M3_nut_trap_depth, 0, [6, 5.40]];
|
||||||
M4_nut = ["M4_nut", 4, 8.1, 3.2, 5, M4_washer, M4_nut_trap_depth, 0];
|
M4_nut = ["M4_nut", 4, 8.1, 3.2, 5, M4_washer, M4_nut_trap_depth, 0, [8, 5.74]];
|
||||||
M5_nut = ["M5_nut", 5, 9.2, 4, 6.25, M5_washer, M5_nut_depth, 0];
|
M5_nut = ["M5_nut", 5, 9.2, 4, 6.25, M5_washer, M5_nut_depth, 0, [10, 7.79]];
|
||||||
M6_nut = ["M6_nut", 6, 11.5, 5, 8, M6_washer, M6_nut_depth, 0];
|
M6_nut = ["M6_nut", 6, 11.5, 5, 8, M6_washer, M6_nut_depth, 0, [12, 8.29]];
|
||||||
M6_half_nut = ["M6_half_nut", 6, 11.5, 3, 8, M6_washer, 3, 0];
|
M6_half_nut = ["M6_half_nut", 6, 11.5, 3, 8, M6_washer, 3, 0];
|
||||||
M8_nut = ["M8_nut", 8, 15, 6.5, 8, M8_washer, M8_nut_depth, 0];
|
M8_nut = ["M8_nut", 8, 15, 6.5, 8, M8_washer, M8_nut_depth, 0, [15, 11.35]];
|
||||||
toggle_nut = ["toggle_nut", 6.1, 9.2, 1.5, 1.5, M6_washer, 1.5, inch(1/40)];
|
toggle_nut = ["toggle_nut", 6.1, 9.2, 1.5, 1.5, M6_washer, 1.5, inch(1/40)];
|
||||||
|
|
||||||
M4_wingnut = ["M4_wingnut", 4, 10, 3.75,8, M4_washer, 0, 22, 10, 6, 3];
|
M4_wingnut = ["M4_wingnut", 4, 10, 3.75,8, M4_washer, 0, 22, 10, 6, 3];
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
// If not, see <https://www.gnu.org/licenses/>.
|
// If not, see <https://www.gnu.org/licenses/>.
|
||||||
//
|
//
|
||||||
//! Potentiometers and rotary encoders
|
//! Potentiometers and rotary encoders
|
||||||
include <../utils/core/core.scad>
|
include <../core.scad>
|
||||||
use <../utils/rounded_cylinder.scad>
|
use <../utils/rounded_cylinder.scad>
|
||||||
use <../utils/round.scad>
|
use <../utils/round.scad>
|
||||||
use <../utils/thread.scad>
|
use <../utils/thread.scad>
|
||||||
@@ -71,18 +71,8 @@ module pot_nut(type, washer = true) { //! Draw the nut for a potentiometer and p
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(nut)
|
if(nut)
|
||||||
color(nut[2])
|
translate_z(nut_z + exploded() * 10)
|
||||||
translate_z(nut_z + exploded() * 10) {
|
draw_nut(nut.x / cos(30), thread_d, nut[1], pot_thread_p(type), nut[2], show_threads && exploded());
|
||||||
linear_extrude(nut[1])
|
|
||||||
difference() {
|
|
||||||
circle(d = nut.x / cos(30), $fn = 6);
|
|
||||||
|
|
||||||
circle(d = thread_d);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(show_threads && exploded())
|
|
||||||
female_metric_thread(thread_d, pot_thread_p(type), nut[1], center = false, colour = nut[2]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -205,8 +205,7 @@ module screw(type, length, hob_point = 0, nylon = false) { //! Draw specified sc
|
|||||||
cylinder(h=2 * eps, r=socket_rad, $fn = 6);
|
cylinder(h=2 * eps, r=socket_rad, $fn = 6);
|
||||||
}
|
}
|
||||||
if(head_type == hs_hex) {
|
if(head_type == hs_hex) {
|
||||||
color(colour)
|
draw_nut(head_rad * 2, 0, head_height, 0, colour, false);
|
||||||
cylinder(r = head_rad, h = head_height, $fn = 6);
|
|
||||||
|
|
||||||
shaft();
|
shaft();
|
||||||
}
|
}
|
||||||
|