mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-09-04 04:35:29 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
fd8712d6bf | ||
|
b6a32b6b41 | ||
|
0738893510 | ||
|
849bc479cc |
BIN
libtest.png
BIN
libtest.png
Binary file not shown.
Before Width: | Height: | Size: 783 KiB After Width: | Height: | Size: 786 KiB |
@@ -151,13 +151,13 @@ translate([890, 730])
|
||||
printed_boxes();
|
||||
|
||||
|
||||
translate([850, 1260])
|
||||
translate([850, 1300])
|
||||
bbox_test();
|
||||
|
||||
|
||||
inserts_y = 0;
|
||||
nuts_y = inserts_y + 20;
|
||||
washers_y = nuts_y + 100;
|
||||
washers_y = nuts_y + 120;
|
||||
screws_y = washers_y + 120;
|
||||
o_rings_y = screws_y + 130;
|
||||
springs_y = o_rings_y + 20;
|
||||
|
@@ -1689,6 +1689,9 @@ If a nut is given a child then it gets placed on its top surface.
|
||||
|:--- |:--- |
|
||||
| ```nut_radius(type)``` | Radius across the corners |
|
||||
| ```nut_size(type)``` | Diameter of the corresponding screw |
|
||||
| ```nut_square_size(type)``` | Diameter of the corresponding screw |
|
||||
| ```nut_square_thickness(type)``` | Thickness of the square nut |
|
||||
| ```nut_square_width(type)``` | Width of the square nut |
|
||||
| ```nut_trap_depth(type)``` | Depth of nut trap |
|
||||
| ```nut_washer(type)``` | Corresponding washer |
|
||||
|
||||
@@ -1705,6 +1708,7 @@ If a nut is given a child then it gets placed on its top surface.
|
||||
|:--- |:--- |
|
||||
| ```nut(type, nyloc = false, brass = false, nylon = false)``` | Draw specified nut |
|
||||
| ```nut_and_washer(type, nyloc)``` | Draw nut with corresponding washer |
|
||||
| ```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 |
|
||||
| ```wingnut(type)``` | Draw a wingnut |
|
||||
|
||||
@@ -1723,18 +1727,23 @@ If a nut is given a child then it gets placed on its top surface.
|
||||
| 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, nyloc = true)``` | Nut M3 x 2.4mm nyloc |
|
||||
| 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_sliding_t_nut)``` | Nut M4 sliding T |
|
||||
| 1 | ```nut(M4_nut)``` | Nut M4 x 3.2mm |
|
||||
| 1 | ```nut(M4_nut, nyloc = true)``` | Nut M4 x 3.2mm nyloc |
|
||||
| 1 | ```nut(M4nS_thin_nut)``` | Nut M4nS 7 x 2.2mm |
|
||||
| 1 | ```sliding_t_nut(M5_sliding_t_nut)``` | Nut M5 sliding T |
|
||||
| 1 | ```nut(M5_nut)``` | Nut M5 x 4mm |
|
||||
| 1 | ```nut(M5_nut, nyloc = true)``` | Nut M5 x 4mm nyloc |
|
||||
| 1 | ```nut(M5nS_thin_nut)``` | Nut M5nS 8 x 2.7mm |
|
||||
| 1 | ```nut(M6_half_nut)``` | Nut M6 x 3mm |
|
||||
| 1 | ```nut(M6_nut)``` | Nut M6 x 5mm |
|
||||
| 1 | ```nut(M6_nut, nyloc = true)``` | Nut M6 x 5mm nyloc |
|
||||
| 1 | ```nut(M6nS_thin_nut)``` | Nut M6nS 10 x 3.2mm |
|
||||
| 1 | ```nut(M8_nut)``` | Nut M8 x 6.5mm |
|
||||
| 1 | ```nut(M8_nut, nyloc = true)``` | Nut M8 x 6.5mm nyloc |
|
||||
| 1 | ```nut(M8nS_thin_nut)``` | Nut M8nS 13 x 4mm |
|
||||
| 1 | ```washer(M6_washer)``` | Washer M6 x 12.5mm x 1.5mm |
|
||||
| 1 | ```wingnut(M4_wingnut)``` | Wingnut M4 |
|
||||
|
||||
|
@@ -61,6 +61,19 @@ module nuts() {
|
||||
if(n == M4_nut)
|
||||
sliding_t_nut(M4_hammer_nut);
|
||||
}
|
||||
|
||||
translate([0, 100]) {
|
||||
if(n == M3_nut)
|
||||
nut_square(M3nS_thin_nut);
|
||||
if(n == M4_nut)
|
||||
nut_square(M4nS_thin_nut);
|
||||
if(n == M5_nut)
|
||||
nut_square(M5nS_thin_nut);
|
||||
if(n == M6_nut)
|
||||
nut_square(M6nS_thin_nut);
|
||||
if(n == M8_nut)
|
||||
nut_square(M8nS_thin_nut);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 111 KiB |
@@ -39,6 +39,10 @@ function nut_trap_depth(type) = type[6]; //! Depth of nut trap
|
||||
|
||||
function nut_flat_radius(type) = nut_radius(type) * cos(30); //! Radius across the flats
|
||||
|
||||
function nut_square_size(type) = type[1]; //! Diameter of the corresponding screw
|
||||
function nut_square_width(type) = type[2]; //! Width 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
|
||||
thread_d = nut_size(type);
|
||||
hole_rad = thread_d / 2;
|
||||
@@ -189,6 +193,31 @@ module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, hol
|
||||
}
|
||||
}
|
||||
|
||||
module nut_square(type, brass = false, nylon = false) { //! Draw specified square nut
|
||||
thread_d = nut_size(type);
|
||||
hole_rad = thread_d / 2;
|
||||
width = nut_square_width(type);
|
||||
thickness = nut_square_thickness(type);
|
||||
desc = brass ? "brass" : nylon ? "nylon" : "";
|
||||
vitamin(str("nut(", type[0], arg(brass, false, "brass"), arg(nylon, false, "nylon"),
|
||||
"): Nut M", nut_size(type), "nS ", width, " x ", thickness, "mm ", desc));
|
||||
|
||||
colour = brass ? brass_colour : nylon ? grey30 : grey70;
|
||||
color(colour)
|
||||
difference() {
|
||||
linear_extrude(height = thickness) {
|
||||
difference() {
|
||||
square([width, width], center = true);
|
||||
|
||||
circle(hole_rad);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(show_threads)
|
||||
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), thickness, center = false, colour = colour);
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
@@ -51,6 +51,20 @@ 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];
|
||||
|
||||
// DIN 562 (thin) square nuts
|
||||
// s w h
|
||||
// c i e
|
||||
// r d i
|
||||
// e t g
|
||||
// w h h
|
||||
// t
|
||||
//
|
||||
M3nS_thin_nut = ["M3nS_thin_nut", 3, 5.5, 1.8];
|
||||
M4nS_thin_nut = ["M4nS_thin_nut", 4, 7, 2.2];
|
||||
M5nS_thin_nut = ["M5nS_thin_nut", 5, 8, 2.7];
|
||||
M6nS_thin_nut = ["M6nS_thin_nut", 6, 10, 3.2];
|
||||
M8nS_thin_nut = ["M8nS_thin_nut", 8, 13, 4];
|
||||
|
||||
// sx ty1 ty2 hammer
|
||||
M3_sliding_t_nut = ["M3_sliding_t_nut", 3, 6, 3.0, 4.0, false, 0, 10, 10, 6, false];
|
||||
M4_sliding_t_nut = ["M4_sliding_t_nut", 4, 6, 3.25,4.5, false, 0, 11, 10, 6, false];
|
||||
|
Reference in New Issue
Block a user