diff --git a/lib.scad b/lib.scad index fc28023..bdf287d 100644 --- a/lib.scad +++ b/lib.scad @@ -106,3 +106,4 @@ use use use use +use diff --git a/readme.md b/readme.md index 9f76dad..fa58111 100644 --- a/readme.md +++ b/readme.md @@ -48,9 +48,9 @@ A list of changes classified as breaking, additions or fixes is maintained in [C Gear_motors Pin_headers Tubings SSR_shroud Geared_steppers Potentiometers Variacs Screw_knob Green_terminals Pulleys Veroboard Socket_box - Hot_ends Washers Strap_handle - Hygrometer Wire - Zipties + HT_pipes Washers Strap_handle + Hot_ends Wire + Hygrometer Zipties --- @@ -1591,6 +1591,99 @@ Needs updating as mostly obsolete versions. | 4 | `ziptie(small_ziptie)` | Ziptie 2.5mm x 100mm min length | +Top + +--- + +## HT_pipes +Parametric PVC HT water pipes commonly found in hardware stores around germany. Great for building weather proof cases for IoT things. + +[vitamins/ht_pipes.scad](vitamins/ht_pipes.scad) Object definitions. + +[vitamins/ht_pipe.scad](vitamins/ht_pipe.scad) Implementation. + +[tests/HT_pipes.scad](tests/HT_pipes.scad) Code for this example. + +### Properties +| Function | Description | +|:--- |:--- | +| `pipe_length(type)` | Pipe length | +| `pipe_od(type)` | Outside diameter | +| `pipe_td(type)` | T-Pipe diameter | +| `pipe_wall(type)` | Wall thickness | + +### Modules +| Module | Description | +|:--- |:--- | +| `ht_cap(type)` | Draw specified cap | +| `ht_pipe(type)` | Draw specified pipe | +| `ht_tpipe(type)` | Draw specified T-pipe | + +![ht_pipes](tests/png/ht_pipes.png) + +### Vitamins +| Qty | Module call | BOM entry | +| ---:|:--- |:---| +| 1 | `ht_cap(HT_110_cap)` | PVC Waterpipe - HT 110 cap | +| 1 | `ht_pipe(HT_110_pipe_1000)` | PVC Waterpipe - HT 110 pipe 1000 mm | +| 1 | `ht_pipe(HT_110_pipe_150)` | PVC Waterpipe - HT 110 pipe 150 mm | +| 1 | `ht_pipe(HT_110_pipe_1500)` | PVC Waterpipe - HT 110 pipe 1500 mm | +| 1 | `ht_pipe(HT_110_pipe_2000)` | PVC Waterpipe - HT 110 pipe 2000 mm | +| 1 | `ht_pipe(HT_110_pipe_250)` | PVC Waterpipe - HT 110 pipe 250 mm | +| 1 | `ht_pipe(HT_110_pipe_500)` | PVC Waterpipe - HT 110 pipe 500 mm | +| 1 | `ht_cap(HT_125_cap)` | PVC Waterpipe - HT 125 cap | +| 1 | `ht_pipe(HT_125_pipe_1000)` | PVC Waterpipe - HT 125 pipe 1000 mm | +| 1 | `ht_pipe(HT_125_pipe_150)` | PVC Waterpipe - HT 125 pipe 150 mm | +| 1 | `ht_pipe(HT_125_pipe_1500)` | PVC Waterpipe - HT 125 pipe 1500 mm | +| 1 | `ht_pipe(HT_125_pipe_2000)` | PVC Waterpipe - HT 125 pipe 2000 mm | +| 1 | `ht_pipe(HT_125_pipe_250)` | PVC Waterpipe - HT 125 pipe 250 mm | +| 1 | `ht_pipe(HT_125_pipe_500)` | PVC Waterpipe - HT 125 pipe 500 mm | +| 1 | `ht_cap(HT_160_cap)` | PVC Waterpipe - HT 160 cap | +| 1 | `ht_pipe(HT_160_pipe_1000)` | PVC Waterpipe - HT 160 pipe 1000 mm | +| 1 | `ht_pipe(HT_160_pipe_150)` | PVC Waterpipe - HT 160 pipe 150 mm | +| 1 | `ht_pipe(HT_160_pipe_1500)` | PVC Waterpipe - HT 160 pipe 1500 mm | +| 1 | `ht_pipe(HT_160_pipe_2000)` | PVC Waterpipe - HT 160 pipe 2000 mm | +| 1 | `ht_pipe(HT_160_pipe_250)` | PVC Waterpipe - HT 160 pipe 250 mm | +| 1 | `ht_pipe(HT_160_pipe_500)` | PVC Waterpipe - HT 160 pipe 500 mm | +| 1 | `ht_cap(HT_32_cap)` | PVC Waterpipe - HT 32 cap | +| 1 | `ht_pipe(HT_32_pipe_1000)` | PVC Waterpipe - HT 32 pipe 1000 mm | +| 1 | `ht_pipe(HT_32_pipe_150)` | PVC Waterpipe - HT 32 pipe 150 mm | +| 1 | `ht_pipe(HT_32_pipe_1500)` | PVC Waterpipe - HT 32 pipe 1500 mm | +| 1 | `ht_pipe(HT_32_pipe_2000)` | PVC Waterpipe - HT 32 pipe 2000 mm | +| 1 | `ht_pipe(HT_32_pipe_250)` | PVC Waterpipe - HT 32 pipe 250 mm | +| 1 | `ht_pipe(HT_32_pipe_500)` | PVC Waterpipe - HT 32 pipe 500 mm | +| 1 | `ht_cap(HT_40_cap)` | PVC Waterpipe - HT 40 cap | +| 1 | `ht_pipe(HT_40_pipe_1000)` | PVC Waterpipe - HT 40 pipe 1000 mm | +| 1 | `ht_pipe(HT_40_pipe_150)` | PVC Waterpipe - HT 40 pipe 150 mm | +| 1 | `ht_pipe(HT_40_pipe_1500)` | PVC Waterpipe - HT 40 pipe 1500 mm | +| 1 | `ht_pipe(HT_40_pipe_2000)` | PVC Waterpipe - HT 40 pipe 2000 mm | +| 1 | `ht_pipe(HT_40_pipe_250)` | PVC Waterpipe - HT 40 pipe 250 mm | +| 1 | `ht_pipe(HT_40_pipe_500)` | PVC Waterpipe - HT 40 pipe 500 mm | +| 1 | `ht_tpipe(HT_50_tpipe)` | PVC Waterpipe - HT 50 T pipe | +| 1 | `ht_cap(HT_50_cap)` | PVC Waterpipe - HT 50 cap | +| 1 | `ht_pipe(HT_50_pipe_1000)` | PVC Waterpipe - HT 50 pipe 1000 mm | +| 1 | `ht_pipe(HT_50_pipe_150)` | PVC Waterpipe - HT 50 pipe 150 mm | +| 1 | `ht_pipe(HT_50_pipe_1500)` | PVC Waterpipe - HT 50 pipe 1500 mm | +| 1 | `ht_pipe(HT_50_pipe_2000)` | PVC Waterpipe - HT 50 pipe 2000 mm | +| 1 | `ht_pipe(HT_50_pipe_250)` | PVC Waterpipe - HT 50 pipe 250 mm | +| 1 | `ht_pipe(HT_50_pipe_500)` | PVC Waterpipe - HT 50 pipe 500 mm | +| 1 | `ht_tpipe(HT_50_40_tpipe)` | PVC Waterpipe - HT 50/40 T pipe | +| 1 | `ht_cap(HT_75_cap)` | PVC Waterpipe - HT 75 cap | +| 1 | `ht_pipe(HT_75_pipe_1000)` | PVC Waterpipe - HT 75 pipe 1000 mm | +| 1 | `ht_pipe(HT_75_pipe_150)` | PVC Waterpipe - HT 75 pipe 150 mm | +| 1 | `ht_pipe(HT_75_pipe_1500)` | PVC Waterpipe - HT 75 pipe 1500 mm | +| 1 | `ht_pipe(HT_75_pipe_2000)` | PVC Waterpipe - HT 75 pipe 2000 mm | +| 1 | `ht_pipe(HT_75_pipe_250)` | PVC Waterpipe - HT 75 pipe 250 mm | +| 1 | `ht_pipe(HT_75_pipe_500)` | PVC Waterpipe - HT 75 pipe 500 mm | +| 1 | `ht_cap(HT_90_cap)` | PVC Waterpipe - HT 90 cap | +| 1 | `ht_pipe(HT_90_pipe_1000)` | PVC Waterpipe - HT 90 pipe 1000 mm | +| 1 | `ht_pipe(HT_90_pipe_150)` | PVC Waterpipe - HT 90 pipe 150 mm | +| 1 | `ht_pipe(HT_90_pipe_1500)` | PVC Waterpipe - HT 90 pipe 1500 mm | +| 1 | `ht_pipe(HT_90_pipe_2000)` | PVC Waterpipe - HT 90 pipe 2000 mm | +| 1 | `ht_pipe(HT_90_pipe_250)` | PVC Waterpipe - HT 90 pipe 250 mm | +| 1 | `ht_pipe(HT_90_pipe_500)` | PVC Waterpipe - HT 90 pipe 500 mm | + + Top --- diff --git a/tests/HT_pipes.scad b/tests/HT_pipes.scad new file mode 100644 index 0000000..52c897d --- /dev/null +++ b/tests/HT_pipes.scad @@ -0,0 +1,37 @@ +// +// NopSCADlib Copyright Jan Giebels 2024 +// +// This file is part of NopSCADlib. +// +// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the +// GNU General Public License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with NopSCADlib. +// If not, see . +// +include <../utils/core/core.scad> +use <../utils/layout.scad> + +include <../vitamins/ht_pipes.scad> + +module ht_pipes() + color("grey") + layout([for(p = ht_pipes) 40 + pipe_od(p)]) let(p = ht_pipes[$i], len = pipe_length(p)) { + if(len <= 34) + translate_z(len) + ht_cap(p); + + if(len >= 101) + ht_pipe(p); + + if(len == 100) + ht_tpipe(p); + } + +if($preview) + ht_pipes(); diff --git a/tests/png/ht_pipes.png b/tests/png/ht_pipes.png new file mode 100644 index 0000000..951c216 Binary files /dev/null and b/tests/png/ht_pipes.png differ diff --git a/vitamins/ht_pipe.scad b/vitamins/ht_pipe.scad new file mode 100644 index 0000000..f3ee3af --- /dev/null +++ b/vitamins/ht_pipe.scad @@ -0,0 +1,105 @@ +// +// NopSCADlib Copyright Jan Giebels 2024 +// info@ecosensors.cloud +// ecosensors.cloud +// +// This file is part of NopSCADlib. +// +// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the +// GNU General Public License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with NopSCADlib. +// If not, see . +// + +// +//! Parametric PVC HT water pipes commonly found in hardware stores around germany. Great for building weather proof cases for IoT things. +// + +include <../utils/core/core.scad> +use <../utils/tube.scad> + +function pipe_od(type) = type[2]; //! Outside diameter +function pipe_wall(type) = type[3]; //! Wall thickness +function pipe_length(type) = type[4]; //! Pipe length +function pipe_td(type) = type[5]; //! T-Pipe diameter + +module ht_cap(type) { //! Draw specified cap + vitamin(str("ht_cap(", type[0], "): PVC Waterpipe - ", type[1])); + tube_id = pipe_od(type) - pipe_wall(type) * 2; + + cylinder(pipe_wall(type), r = tube_id/2 + pipe_wall(type) + 2.6); + + translate_z(-pipe_length(type) - 5) + tube(or = tube_id/2 + pipe_wall(type), ir = tube_id/2, h = pipe_length(type) + 5, center = false); +} + +module ht_pipe(type) { //! Draw specified pipe + vitamin(str("ht_pipe(", type[0], "): PVC Waterpipe - ", type[1])); + tube_id = pipe_od(type) - pipe_wall(type) * 2; + + tube(h = pipe_length(type), or = tube_id/2 + pipe_wall(type), ir = tube_id/2, tube_id/2); + + translate_z(pipe_length(type)) + HTpipeFitting(pipe_od(type), tube_id); +} + +module ht_tpipe(type) { //! Draw specified T-pipe + vitamin(str("ht_tpipe(", type[0], "): PVC Waterpipe - ", type[1])); + tube_id = pipe_od(type) - pipe_wall(type) * 2; + tube_t_id = pipe_td(type) - pipe_wall(type) * 2; + + translate_z(pipe_length(type)) + HTpipeFitting(pipe_od(type), tube_id); + + render(convexity = 5) + difference() { + tube(h = pipe_length(type), or = tube_id/2 + pipe_wall(type), ir = tube_id/2, center = false); + + translate([0, -25, pipe_length(type) - 25]) // Cut the exit hole + rotate([90, 0, 0]) + cylinder(h = 50, d = tube_t_id, center = true); + } + + or = pipe_od(type) / 2; + translate([0, -or, pipe_length(type) - or]) + rotate ([90, 0, 0]) { + HTpipeFitting(pipe_td(type), tube_t_id); + + translate_z(-or) + render(convexity = 5) + difference() { // Notch the T tube to meet the internal bore + tube(h = or, or = pipe_td(type) / 2, ir = tube_t_id / 2, center = false); + + rotate([-90, 0, 0]) + cylinder(h = pipe_td(type), d = tube_id, center = true); + } + } +} + +module HTpipeFitting(tube_od, tube_id) { + fitting_height = min(55, tube_od * 0.8); + + tube_ir = tube_id / 2; + fit_ir = tube_od / 2; + fit_or = fit_ir + (fit_ir - tube_ir); + + rotate_extrude() + polygon([ + [tube_ir, 0], + [fit_ir, 10], + [fit_ir, fitting_height + 12 + 3.7], + [fit_or, fitting_height + 12 + 3.7], + [fit_or, fitting_height + 12], + [fit_ir + 6.5, fitting_height + 12], + [fit_ir + 6.5, fitting_height], + [fit_or, fitting_height], + [fit_or, 10], + [fit_ir, 0] + ]); +} diff --git a/vitamins/ht_pipes.scad b/vitamins/ht_pipes.scad new file mode 100644 index 0000000..f6d2d59 --- /dev/null +++ b/vitamins/ht_pipes.scad @@ -0,0 +1,101 @@ +// +// NopSCADlib Copyright Jan Giebels 2024 +// info@ecosensors.cloud +// ecosensors.cloud +// +// This file is part of NopSCADlib. +// +// NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the +// GNU General Public License as published by the Free Software Foundation, either version 3 of +// the License, or (at your option) any later version. +// +// NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with NopSCADlib. +// If not, see . +// + +// definition name diameter wall length t-diameter + +HT_32_cap = ["HT_32_cap", "HT 32 cap", 32, 2.1, 34]; +HT_32_pipe_150 = ["HT_32_pipe_150", "HT 32 pipe 150 mm", 32, 2.1, 150]; +HT_32_pipe_250 = ["HT_32_pipe_250", "HT 32 pipe 250 mm", 32, 2.1, 250]; +HT_32_pipe_500 = ["HT_32_pipe_500", "HT 32 pipe 500 mm", 32, 2.1, 500]; +HT_32_pipe_1000 = ["HT_32_pipe_1000", "HT 32 pipe 1000 mm", 32, 2.1, 1000]; +HT_32_pipe_1500 = ["HT_32_pipe_1500", "HT 32 pipe 1500 mm", 32, 2.1, 1500]; +HT_32_pipe_2000 = ["HT_32_pipe_2000", "HT 32 pipe 2000 mm", 32, 2.1, 2000]; + +HT_40_cap = ["HT_40_cap", "HT 40 cap", 40, 2.1, 34]; +HT_40_pipe_150 = ["HT_40_pipe_150", "HT 40 pipe 150 mm", 40, 2.1, 150]; +HT_40_pipe_250 = ["HT_40_pipe_250", "HT 40 pipe 250 mm", 40, 2.1, 250]; +HT_40_pipe_500 = ["HT_40_pipe_500", "HT 40 pipe 500 mm", 40, 2.1, 500]; +HT_40_pipe_1000 = ["HT_40_pipe_1000", "HT 40 pipe 1000 mm", 40, 2.1, 1000]; +HT_40_pipe_1500 = ["HT_40_pipe_1500", "HT 40 pipe 1500 mm", 40, 2.1, 1500]; +HT_40_pipe_2000 = ["HT_40_pipe_2000", "HT 40 pipe 2000 mm", 40, 2.1, 2000]; + +HT_50_cap = ["HT_50_cap", "HT 50 cap", 50, 2.1, 34]; +HT_50_pipe_150 = ["HT_50_pipe_150", "HT 50 pipe 150 mm", 50, 2.1, 150]; +HT_50_pipe_250 = ["HT_50_pipe_250", "HT 50 pipe 250 mm", 50, 2.1, 250]; +HT_50_pipe_500 = ["HT_50_pipe_500", "HT 50 pipe 500 mm", 50, 2.1, 500]; +HT_50_pipe_1000 = ["HT_50_pipe_1000", "HT 50 pipe 1000 mm", 50, 2.1, 1000]; +HT_50_pipe_1500 = ["HT_50_pipe_1500", "HT 50 pipe 1500 mm", 50, 2.1, 1500]; +HT_50_pipe_2000 = ["HT_50_pipe_2000", "HT 50 pipe 2000 mm", 50, 2.1, 2000]; + +HT_50_tpipe = ["HT_50_tpipe", "HT 50 T pipe", 50, 2.1, 100, 50]; +HT_50_40_tpipe = ["HT_50_40_tpipe", "HT 50/40 T pipe", 50, 2.1, 100, 40]; + +HT_75_cap = ["HT_75_cap", "HT 75 cap", 75, 2.1, 34]; +HT_75_pipe_150 = ["HT_75_pipe_150", "HT 75 pipe 150 mm", 75, 2.1, 150]; +HT_75_pipe_250 = ["HT_75_pipe_250", "HT 75 pipe 250 mm", 75, 2.1, 250]; +HT_75_pipe_500 = ["HT_75_pipe_500", "HT 75 pipe 500 mm", 75, 2.1, 500]; +HT_75_pipe_1000 = ["HT_75_pipe_1000", "HT 75 pipe 1000 mm", 75, 2.1, 1000]; +HT_75_pipe_1500 = ["HT_75_pipe_1500", "HT 75 pipe 1500 mm", 75, 2.1, 1500]; +HT_75_pipe_2000 = ["HT_75_pipe_2000", "HT 75 pipe 2000 mm", 75, 2.1, 2000]; + +HT_90_cap = ["HT_90_cap", "HT 90 cap", 90, 2.1, 34]; +HT_90_pipe_150 = ["HT_90_pipe_150", "HT 90 pipe 150 mm", 90, 2.1, 150]; +HT_90_pipe_250 = ["HT_90_pipe_250", "HT 90 pipe 250 mm", 90, 2.1, 250]; +HT_90_pipe_500 = ["HT_90_pipe_500", "HT 90 pipe 500 mm", 90, 2.1, 500]; +HT_90_pipe_1000 = ["HT_90_pipe_1000", "HT 90 pipe 1000 mm", 90, 2.1, 1000]; +HT_90_pipe_1500 = ["HT_90_pipe_1500", "HT 90 pipe 1500 mm", 90, 2.1, 1500]; +HT_90_pipe_2000 = ["HT_90_pipe_2000", "HT 90 pipe 2000 mm", 90, 2.1, 2000]; + +HT_110_cap = ["HT_110_cap", "HT 110 cap", 110, 2.1, 34]; +HT_110_pipe_150 = ["HT_110_pipe_150", "HT 110 pipe 150 mm", 110, 2.1, 150]; +HT_110_pipe_250 = ["HT_110_pipe_250", "HT 110 pipe 250 mm", 110, 2.1, 250]; +HT_110_pipe_500 = ["HT_110_pipe_500", "HT 110 pipe 500 mm", 110, 2.1, 500]; +HT_110_pipe_1000 = ["HT_110_pipe_1000", "HT 110 pipe 1000 mm", 110, 2.1, 1000]; +HT_110_pipe_1500 = ["HT_110_pipe_1500", "HT 110 pipe 1500 mm", 110, 2.1, 1500]; +HT_110_pipe_2000 = ["HT_110_pipe_2000", "HT 110 pipe 2000 mm", 110, 2.1, 2000]; + +HT_125_cap = ["HT_125_cap", "HT 125 cap", 125, 2.1, 34]; +HT_125_pipe_150 = ["HT_125_pipe_150", "HT 125 pipe 150 mm", 125, 2.1, 150]; +HT_125_pipe_250 = ["HT_125_pipe_250", "HT 125 pipe 250 mm", 125, 2.1, 250]; +HT_125_pipe_500 = ["HT_125_pipe_500", "HT 125 pipe 500 mm", 125, 2.1, 500]; +HT_125_pipe_1000 = ["HT_125_pipe_1000", "HT 125 pipe 1000 mm", 125, 2.1, 1000]; +HT_125_pipe_1500 = ["HT_125_pipe_1500", "HT 125 pipe 1500 mm", 125, 2.1, 1500]; +HT_125_pipe_2000 = ["HT_125_pipe_2000", "HT 125 pipe 2000 mm", 125, 2.1, 2000]; + +HT_160_cap = ["HT_160_cap", "HT 160 cap", 160, 2.1, 34]; +HT_160_pipe_150 = ["HT_160_pipe_150", "HT 160 pipe 150 mm", 160, 2.1, 150]; +HT_160_pipe_250 = ["HT_160_pipe_250", "HT 160 pipe 250 mm", 160, 2.1, 250]; +HT_160_pipe_500 = ["HT_160_pipe_500", "HT 160 pipe 500 mm", 160, 2.1, 500]; +HT_160_pipe_1000 = ["HT_160_pipe_1000", "HT 160 pipe 1000 mm", 160, 2.1, 1000]; +HT_160_pipe_1500 = ["HT_160_pipe_1500", "HT 160 pipe 1500 mm", 160, 2.1, 1500]; +HT_160_pipe_2000 = ["HT_160_pipe_2000", "HT 160 pipe 2000 mm", 160, 2.1, 2000]; + +ht_pipes = [ + HT_32_cap, HT_32_pipe_150, HT_32_pipe_250, HT_32_pipe_500, HT_32_pipe_1000, HT_32_pipe_1500, HT_32_pipe_2000, + HT_40_cap, HT_40_pipe_150, HT_40_pipe_250, HT_40_pipe_500, HT_40_pipe_1000, HT_40_pipe_1500, HT_40_pipe_2000, + HT_50_cap, HT_50_pipe_150, HT_50_pipe_250, HT_50_pipe_500, HT_50_pipe_1000, HT_50_pipe_1500, HT_50_pipe_2000, + HT_50_tpipe, HT_50_40_tpipe, + HT_75_cap, HT_75_pipe_150, HT_75_pipe_250, HT_75_pipe_500, HT_75_pipe_1000, HT_75_pipe_1500, HT_75_pipe_2000, + HT_90_cap, HT_90_pipe_150, HT_90_pipe_250, HT_90_pipe_500, HT_90_pipe_1000, HT_90_pipe_1500, HT_90_pipe_2000, + HT_110_cap, HT_110_pipe_150, HT_110_pipe_250, HT_110_pipe_500, HT_110_pipe_1000, HT_110_pipe_1500, HT_110_pipe_2000, + HT_125_cap, HT_125_pipe_150, HT_125_pipe_250, HT_125_pipe_500, HT_125_pipe_1000, HT_125_pipe_1500, HT_125_pipe_2000, + HT_160_cap, HT_160_pipe_150, HT_160_pipe_250, HT_160_pipe_500, HT_160_pipe_1000, HT_160_pipe_1500, HT_160_pipe_2000, + ]; + +use