From 4ff6c7d0a84ed40c08a36a55f4fe19f3ce712914 Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Mon, 24 Feb 2020 17:40:39 +0000 Subject: [PATCH 1/2] Unified tnuts and hammer nuts. --- tests/nuts.scad | 4 ++-- vitamins/nut.scad | 18 +++--------------- vitamins/nuts.scad | 12 ++++++------ vitamins/sk_bracket.scad | 6 +++--- 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/tests/nuts.scad b/tests/nuts.scad index 9b3be3e..1fe8504 100644 --- a/tests/nuts.scad +++ b/tests/nuts.scad @@ -58,10 +58,10 @@ module nuts() { translate([0, 80]) { if(n == M3_nut) - hammer_nut(M3_hammer_nut); + sliding_t_nut(M3_hammer_nut); if(n == M4_nut) - hammer_nut(M4_hammer_nut); + sliding_t_nut(M4_hammer_nut); } } } diff --git a/vitamins/nut.scad b/vitamins/nut.scad index e78f74e..aad17b8 100644 --- a/vitamins/nut.scad +++ b/vitamins/nut.scad @@ -132,7 +132,8 @@ module wingnut(type) { //! Draw a wingnut } module sliding_t_nut(type) { - vitamin(str("sliding_t_nut(", type[0], "): Nut M", nut_size(type), " sliding T")); + hammerNut = type[10]; + vitamin(str("sliding_t_nut(", type[0], "): Nut M", nut_size(type), hammerNut ? " hammer" : " sliding T")); size = [type[7], type[2], nut_thickness(type, true)]; tabSizeY1 = type[8]; @@ -141,20 +142,7 @@ module sliding_t_nut(type) { holeRadius = nut_size(type) / 2; 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, true)]; - tabSizeY1 = type[8]; - tabSizeY2 = type[9]; - tabSizeZ = nut_thickness(type); - holeRadius = nut_size(type) / 2; - - color(grey80) - extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, 0, hammerNut = true); + extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, 0, hammerNut); } module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, holeOffset = 0, hammerNut = false) { diff --git a/vitamins/nuts.scad b/vitamins/nuts.scad index 46c917c..34ba11f 100644 --- a/vitamins/nuts.scad +++ b/vitamins/nuts.scad @@ -51,12 +51,12 @@ 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]; -// sx ty1 ty2 -M3_sliding_t_nut = ["M3_sliding_t_nut", 3, 6, 3.0, 4.0, false, 0, 10, 10, 6]; -M4_sliding_t_nut = ["M4_sliding_t_nut", 4, 6, 3.25,4.5, false, 0, 11, 10, 6]; -M5_sliding_t_nut = ["M5_sliding_t_nut", 5, 6, 3.25,4.5, false, 0, 11, 10, 7]; -M3_hammer_nut = ["M3_hammer_nut", 3, 6, 2.75,4.0, false, 0, 5.5, 10, 6]; -M4_hammer_nut = ["M4_hammer_nut", 4, 6, 3.25,4.5, false, 0, 5.5, 10, 6]; +// 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]; +M5_sliding_t_nut = ["M5_sliding_t_nut", 5, 6, 3.25,4.5, false, 0, 11, 10, 7, false]; +M3_hammer_nut = ["M3_hammer_nut", 3, 6, 2.75,4.0, false, 0, 5.5, 10, 6, true]; +M4_hammer_nut = ["M4_hammer_nut", 4, 6, 3.25,4.5, false, 0, 5.5, 10, 6, true]; nuts = [M2_nut, M2p5_nut, M3_nut, M4_nut, M5_nut, M6_nut, M8_nut]; diff --git a/vitamins/sk_bracket.scad b/vitamins/sk_bracket.scad index 853cb3e..43d7c80 100644 --- a/vitamins/sk_bracket.scad +++ b/vitamins/sk_bracket.scad @@ -117,9 +117,9 @@ module sk_bracket_assembly(type, part_thickness = 2, screw_type = M5_cap_screw, screw_and_washer(screw_type, screw_length); translate_z(-nut_offset) vflip() - if(!nut_washer_type) - sliding_t_nut(nut_type); - else + if(nut_washer_type) nut_and_washer(nut_type); + else + sliding_t_nut(nut_type); } } From f46f35e909167d1e957009b2f666d0cadb37e5da Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Mon, 24 Feb 2020 18:37:25 +0000 Subject: [PATCH 2/2] Updated readme --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index e62a146..642d017 100644 --- a/readme.md +++ b/readme.md @@ -1623,12 +1623,12 @@ 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, nyloc = true)``` | Nut M2.5 x 2.2mm nyloc | | 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_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, brass = true)``` | Nut M3 x 2.4mm brass | | 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_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 |