mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-22 05:01:30 +02:00
Merge branch 'martinbudden-tnuts'
This commit is contained in:
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 763 KiB After Width: | Height: | Size: 758 KiB |
@@ -136,13 +136,13 @@ translate([x5, cable_grommets_y + 250])
|
|||||||
translate([900, 600])
|
translate([900, 600])
|
||||||
box_test();
|
box_test();
|
||||||
|
|
||||||
translate([850, 1220])
|
translate([850, 1260])
|
||||||
bbox_test();
|
bbox_test();
|
||||||
|
|
||||||
x0 = 0;
|
x0 = 0;
|
||||||
inserts_y = 0;
|
inserts_y = 0;
|
||||||
nuts_y = inserts_y + 20;
|
nuts_y = inserts_y + 20;
|
||||||
washers_y = nuts_y + 60;
|
washers_y = nuts_y + 100;
|
||||||
screws_y = washers_y + 120;
|
screws_y = washers_y + 120;
|
||||||
o_rings_y = screws_y + 130;
|
o_rings_y = screws_y + 130;
|
||||||
springs_y = o_rings_y + 20;
|
springs_y = o_rings_y + 20;
|
||||||
|
@@ -1623,11 +1623,16 @@ If a nut is given a child then it gets placed on its top surface.
|
|||||||
| 1 | ```nut(M2p5_nut)``` | Nut M2.5 x 2.2mm |
|
| 1 | ```nut(M2p5_nut)``` | Nut M2.5 x 2.2mm |
|
||||||
| 1 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
|
| 1 | ```nut(M2p5_nut, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc |
|
||||||
| 1 | ```nut(M2p5_nut, nylon = true)``` | Nut M2.5 x 2.2mm nylon |
|
| 1 | ```nut(M2p5_nut, nylon = true)``` | Nut M2.5 x 2.2mm nylon |
|
||||||
|
| 1 | ```hammer_nut(M3_hammer_nut)``` | Nut M3 hammer |
|
||||||
|
| 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, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
| 1 | ```nut(M3_nut, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||||
|
| 1 | ```hammer_nut(M4_hammer_nut)``` | Nut M4 hammer |
|
||||||
|
| 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, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
|
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
|
||||||
|
| 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, nyloc = true)``` | Nut M5 x 4mm nyloc |
|
| 1 | ```nut(M5_nut, nyloc = true)``` | Nut M5 x 4mm nyloc |
|
||||||
| 1 | ```nut(M6_half_nut)``` | Nut M6 x 3mm |
|
| 1 | ```nut(M6_half_nut)``` | Nut M6 x 3mm |
|
||||||
|
@@ -22,13 +22,12 @@ use <../utils/layout.scad>
|
|||||||
include <../vitamins/screws.scad>
|
include <../vitamins/screws.scad>
|
||||||
|
|
||||||
module nuts() {
|
module nuts() {
|
||||||
for(nyloc = [false, true])
|
layout([for(n = nuts) 2 * nut_radius(n)], 5) let(n = nuts[$i]) {
|
||||||
translate([0, nyloc ? 20 : 0])
|
for(nyloc = [false, true])
|
||||||
layout([for(n = nuts) 2 * nut_radius(n)], 5)
|
translate([0, nyloc ? 20 : 0])
|
||||||
nut(nuts[$i], nyloc);
|
nut(n, nyloc);
|
||||||
|
|
||||||
translate([0, 40])
|
translate([0, 40]) {
|
||||||
layout([for(n = nuts) 2 * nut_radius(n)], 5) let(n = nuts[$i]) {
|
|
||||||
if(n == M3_nut)
|
if(n == M3_nut)
|
||||||
nut(n, brass = true);
|
nut(n, brass = true);
|
||||||
|
|
||||||
@@ -45,6 +44,26 @@ module nuts() {
|
|||||||
if(n == M8_nut)
|
if(n == M8_nut)
|
||||||
#nut_trap(M8_cap_screw, n, h = 30);
|
#nut_trap(M8_cap_screw, n, h = 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
translate([0, 60]) {
|
||||||
|
if(n == M3_nut)
|
||||||
|
sliding_t_nut(M3_sliding_t_nut);
|
||||||
|
|
||||||
|
if(n == M4_nut)
|
||||||
|
sliding_t_nut(M4_sliding_t_nut);
|
||||||
|
|
||||||
|
if(n == M5_nut)
|
||||||
|
sliding_t_nut(M5_sliding_t_nut);
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0, 80]) {
|
||||||
|
if(n == M3_nut)
|
||||||
|
hammer_nut(M3_hammer_nut);
|
||||||
|
|
||||||
|
if(n == M4_nut)
|
||||||
|
hammer_nut(M4_hammer_nut);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($preview)
|
if($preview)
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 107 KiB |
@@ -25,6 +25,7 @@
|
|||||||
include <../core.scad>
|
include <../core.scad>
|
||||||
use <washer.scad>
|
use <washer.scad>
|
||||||
use <screw.scad>
|
use <screw.scad>
|
||||||
|
use <../utils/fillet.scad>
|
||||||
use <../utils/rounded_cylinder.scad>
|
use <../utils/rounded_cylinder.scad>
|
||||||
use <../utils/thread.scad>
|
use <../utils/thread.scad>
|
||||||
use <../utils/tube.scad>
|
use <../utils/tube.scad>
|
||||||
@@ -129,6 +130,80 @@ module wingnut(type) { //! Draw a wingnut
|
|||||||
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), thickness, center = false, colour = colour);
|
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), thickness, center = false, colour = colour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module sliding_t_nut(type) {
|
||||||
|
vitamin(str("sliding_t_nut(", type[0], "): Nut M", nut_size(type), " sliding T"));
|
||||||
|
|
||||||
|
size = [type[7], type[2], nut_thickness(type)];
|
||||||
|
tabSizeY1 = type[8];
|
||||||
|
tabSizeY2 = type[9];
|
||||||
|
tabSizeZ = type[10];
|
||||||
|
holeRadius = nut_size(type) / 2;
|
||||||
|
|
||||||
|
if($preview)
|
||||||
|
color(grey80)
|
||||||
|
extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module hammer_nut(type) {
|
||||||
|
vitamin(str("hammer_nut(", type[0], "): Nut M", nut_size(type), " hammer"));
|
||||||
|
|
||||||
|
size = [type[7], type[2], nut_thickness(type)];
|
||||||
|
tabSizeY1 = type[8];
|
||||||
|
tabSizeY2 = type[9];
|
||||||
|
tabSizeZ = type[10];
|
||||||
|
holeRadius = nut_size(type) / 2;
|
||||||
|
|
||||||
|
if($preview)
|
||||||
|
color(grey80)
|
||||||
|
extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, 0, hammerNut = true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, holeOffset = 0, hammerNut = false) {
|
||||||
|
// center section
|
||||||
|
linear_extrude(size[2] - tabSizeZ)
|
||||||
|
difference() {
|
||||||
|
square([size[0], size[1]], center = true);
|
||||||
|
if(hammerNut) {
|
||||||
|
translate([size[0] / 2, size[1] / 2])
|
||||||
|
rotate(180)
|
||||||
|
fillet(1);
|
||||||
|
translate([-size[0] / 2, -size[1] / 2])
|
||||||
|
fillet(1);
|
||||||
|
}
|
||||||
|
if(holeRadius)
|
||||||
|
translate([holeOffset, 0])
|
||||||
|
circle(holeRadius);
|
||||||
|
}
|
||||||
|
translate_z(size[2] - tabSizeZ)
|
||||||
|
linear_extrude(tabSizeZ)
|
||||||
|
difference() {
|
||||||
|
square([size[0], tabSizeY2], center = true);
|
||||||
|
if(holeRadius)
|
||||||
|
translate([holeOffset, 0])
|
||||||
|
circle(holeRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
thread_d = 2 * holeRadius;
|
||||||
|
if(show_threads)
|
||||||
|
translate([holeOffset, 0])
|
||||||
|
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), size[2], center = false);
|
||||||
|
|
||||||
|
// add the side tabs
|
||||||
|
for(m = [0, 1])
|
||||||
|
mirror([0, m, 0])
|
||||||
|
translate([0, tabSizeY2 / 2, size[2] - tabSizeZ]) {
|
||||||
|
cubeZ = 1;
|
||||||
|
translate([-size[0] / 2, 0, 0])
|
||||||
|
cube([size[0], (tabSizeY1 - tabSizeY2) / 2, cubeZ]);
|
||||||
|
translate_z(cubeZ)
|
||||||
|
rotate([0, -90, 0])
|
||||||
|
right_triangle(tabSizeZ - cubeZ, (tabSizeY1 - tabSizeY2) / 2, size[0], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function nut_trap_radius(nut, horizontal = false) = nut_radius(nut) + (horizontal ? layer_height / 4 : 0); //! Radius across the corners of a nut trap
|
function nut_trap_radius(nut, horizontal = false) = nut_radius(nut) + (horizontal ? layer_height / 4 : 0); //! Radius across the corners of a nut trap
|
||||||
function nut_trap_flat_radius(nut, horizontal = false) = nut_trap_radius(nut, horizontal) * cos(30); //! Radius across the flats of a nut trap
|
function nut_trap_flat_radius(nut, horizontal = false) = nut_trap_radius(nut, horizontal) * cos(30); //! Radius across the flats of a nut trap
|
||||||
|
|
||||||
|
@@ -51,6 +51,13 @@ toggle_nut = ["toggle_nut", 6.1, 9.2, 1.5, 1.5, M6_washer, 1.5];
|
|||||||
|
|
||||||
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];
|
||||||
|
|
||||||
|
// sx ty1 ty2 tz
|
||||||
|
M3_sliding_t_nut = ["M3_sliding_t_nut", 3, 6, 4.0, 0, M3_washer, 0, 10, 10, 6, 3];
|
||||||
|
M4_sliding_t_nut = ["M4_sliding_t_nut", 4, 6, 4.5, 0, M4_washer, 0, 11, 10, 6, 3.25];
|
||||||
|
M5_sliding_t_nut = ["M5_sliding_t_nut", 5, 6, 4.5, 0, M5_washer, 0, 11, 10, 7, 3.25];
|
||||||
|
M3_hammer_nut = ["M3_hammer_nut", 3, 6, 4.0, 0, M3_washer, 0, 5.5, 10, 6, 2.75];
|
||||||
|
M4_hammer_nut = ["M4_hammer_nut", 4, 6, 4.5, 0, M4_washer, 0, 5.5, 10, 6, 3.25];
|
||||||
|
|
||||||
nuts = [M2_nut, M2p5_nut, M3_nut, M4_nut, M5_nut, M6_nut, M8_nut];
|
nuts = [M2_nut, M2p5_nut, M3_nut, M4_nut, M5_nut, M6_nut, M8_nut];
|
||||||
|
|
||||||
use <nut.scad>
|
use <nut.scad>
|
||||||
|
Reference in New Issue
Block a user