From cc84a5a53616a11de974760492448ea6f91861e8 Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Thu, 30 Jan 2020 06:53:20 +0000 Subject: [PATCH 1/2] Added comments and ability to set colour to green terminals. --- vitamins/green_terminal.scad | 5 ++--- vitamins/green_terminals.scad | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/vitamins/green_terminal.scad b/vitamins/green_terminal.scad index 133cbd3..d77e8c1 100644 --- a/vitamins/green_terminal.scad +++ b/vitamins/green_terminal.scad @@ -39,9 +39,8 @@ function gt_y_offset(type) = type[13]; //! Offset of the pins from centre o function gt_y_offset2(type) = type[14]; //! Offset of the pins screws from the screws function gt_tube_h(type) = type[15]; //! Height of optional tubes around the screws -module green_terminal(type, ways, skip = []) { //! Draw green terminal blocks, skip can be used to remove pins. +module green_terminal(type, ways, skip = [], colour = "lime") { //! Draw green terminal blocks, skip can be used to remove pins. pitch = gt_pitch(type); - imperial = str(pitch / inch(1)); vitamin(str("green_terminal(", type[0], ", ", ways, "): Terminal block ", ways, " way ", len(imperial) < 5 ? str(pitch / inch(1), "\"") : str(pitch, "mm"))); width = ways * pitch; @@ -79,7 +78,7 @@ module green_terminal(type, ways, skip = []) { //! Draw green terminal blocks, s } } - color("lime") { + color(colour) { rotate([90, 0, 0]) linear_extrude(height = pitch, center = true, convexity = 5) polygon(points = [ // Vertical section diff --git a/vitamins/green_terminals.scad b/vitamins/green_terminals.scad index bfe3f70..e3dee3b 100644 --- a/vitamins/green_terminals.scad +++ b/vitamins/green_terminals.scad @@ -18,6 +18,14 @@ // // Green terminal blocks // + +// f b y y +// h h f h b s f o o +// p d e e d e d c r f f t +// i e i i e i e r o b b f f u +// t p g t g p g p e n o o s s b +// c t h o h t h t w t x x e t e +// h h t p t h t h r t w h t 2 h gt_2p54 = ["gt_2p54", 2.54, 6.6, 10, 3, 6, 0.4, 6.4, 1, 1, 0.2, 2, 2, 0, 0, 0]; gt_3p5 = ["gt_3p5", 3.5, 7.3, 8.5, 4, 5, 0.4, 4, 0, 1.35, 0.4, 1.8, 2, 0, 0, 0]; gt_6p35 = ["gt_6p35", 6.35, 12.6, 17.4, 6.8, 12, 0.4, 11, 2, 2.7, 0.8, 3.4, 4.2, 1.8, 1.1, 21.4]; From 0b8141844c5a2e4c6323cd990695900d2164fef5 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Sun, 23 Feb 2020 19:52:18 +0000 Subject: [PATCH 2/2] Updated readme. --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 1dcf0fa..a9e3221 100644 --- a/readme.md +++ b/readme.md @@ -823,7 +823,7 @@ Parametric green terminal blocks ### Modules | Module | Description | |:--- |:--- | -| ```green_terminal(type, ways, skip = [])``` | Draw green terminal blocks, skip can be used to remove pins. | +| ```green_terminal(type, ways, skip = [], colour = "lime")``` | Draw green terminal blocks, skip can be used to remove pins. | | ```terminal_254(ways, skip = [])``` | Draw 0.1" terminal block | ![green_terminals](tests/png/green_terminals.png)