diff --git a/lib.scad b/lib.scad index fc28023..7b6fffa 100644 --- a/lib.scad +++ b/lib.scad @@ -40,6 +40,7 @@ include include include include +include include include include diff --git a/vitamins/ht_pipe.scad b/vitamins/ht_pipe.scad new file mode 100644 index 0000000..c101cfc --- /dev/null +++ b/vitamins/ht_pipe.scad @@ -0,0 +1,113 @@ +// +// 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> + +function pipe_od(type) = type[2]; //! Outside diameter +function pipe_wall(type) = type[3]; //! Wall thickness +function pipe_length(type) = type[4]; //! Pipe length + +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; + difference() { + union() { + cylinder(pipe_wall(type), tube_id/2 + pipe_wall(type) + 2.6, tube_id/2 + pipe_wall(type) + 2.6); + translate([0, 0, -pipe_length(type) - 5]) + cylinder(pipe_length(type) + 5, tube_id/2 + pipe_wall(type), tube_id/2 + pipe_wall(type)); + } + translate([0, 0, -pipe_length(type) - 5.01]) + cylinder(pipe_length(type) + 5.01, tube_id/2, tube_id/2); + } +} + +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; + difference() { + union() { + translate([0, 0, pipe_length(type) + tube_id - pipe_wall(type)]) + HTpipeFitting(type, 0); + cylinder(pipe_length(type), tube_id/2 + pipe_wall(type), tube_id/2 + pipe_wall(type)); + } + cylinder(pipe_length(type), tube_id/2, tube_id/2); + } +} + +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; + difference() { + union() { + translate([0, 0, pipe_length(type) + tube_id - pipe_wall(type)]) + HTpipeFitting(type, 0); + cylinder(pipe_length(type), tube_id/2 + pipe_wall(type), tube_id/2 + pipe_wall(type)); + translate([0, -70, pipe_length(type) - 25]) { + rotate ([90, 0, 0]) { + HTpipeFitting(type, 0); + translate([0, 0, -60]) + cylinder(20, tube_id/2 + pipe_wall(type), tube_id/2 + pipe_wall(type)); + } + } + } + cylinder(pipe_length(type), tube_id/2, tube_id/2); + translate([0, 0, 75]) + rotate([90, 0, 0]) + cylinder(pipe_length(type), tube_id/2, tube_id/2); + } +} + +module ht_t40pipe(type) { //! Draw specified T-pipe + vitamin(str("ht_tpipe(", type[0], "): PVC Waterpipe - ", type[1])); + tube_id = pipe_od(type) - pipe_wall(type) * 2; + difference() { + union() { + translate([0, 0, pipe_length(type) + tube_id - pipe_wall(type)]) + HTpipeFitting(type, 0); + cylinder(pipe_length(type), tube_id/2 + pipe_wall(type), tube_id/2 + pipe_wall(type)); + + translate([0, -60, pipe_length(type) - 25]) { + rotate ([90, 0, 0]) { + HTpipeFitting(type, 10); + translate([0, 0, -50]) + cylinder(20, (tube_id-10)/2 + pipe_wall(type), (tube_id-10)/2 + pipe_wall(type)); + } + } + } + cylinder(pipe_length(type), tube_id/2, tube_id/2); + translate([0, 0, 75]) + rotate([90, 0, 0]) + cylinder(pipe_length(type), (tube_id-10)/2, (tube_id-10)/2); + } +} + +module HTpipeFitting(type, side_reduction) { + tube_id = pipe_od(type) - side_reduction - pipe_wall(type) * 2; + difference() { + union() { + cylinder(12, tube_id/2 + pipe_wall(type) + 5, tube_id/2 + pipe_wall(type) + 5); + translate([0, 0, 12]) + cylinder(3.7, tube_id/2 + pipe_wall(type), tube_id/2 + pipe_wall(type)); + translate([0, 0, -tube_id + 12]) + cylinder(tube_id, tube_id/2 + pipe_wall(type) + 2.6, tube_id/2 + pipe_wall(type) + 2.6); + translate([0, 0, -tube_id + 2]) + cylinder(10, tube_id/2 + pipe_wall(type), tube_id/2 + pipe_wall(type) + 2.6); + } + translate([0, 0, -50]) + cylinder(70, tube_id/2, tube_id/2); + } +} diff --git a/vitamins/ht_pipes.scad b/vitamins/ht_pipes.scad new file mode 100644 index 0000000..5cbc690 --- /dev/null +++ b/vitamins/ht_pipes.scad @@ -0,0 +1,30 @@ +// +// 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 . +// + +// definition name diameter wall length +HT_40_pipe_250 = ["HT_40_pipe_250", "HT 40 pipe 250 mm", 40, 2.1, 250]; +HT_50_cap = ["HT_50_cap", "HT 50 cap", 50, 2.1, 34]; +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_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]; +HT_50_40_tpipe = ["HT_50_40_tpipe", "HT 50/40 T pipe", 50, 2.1, 100]; + +ht_pipes = [HT_50_cap, HT_50_pipe_250, HT_50_pipe_500, HT_50_pipe_1000, HT_50_pipe_2000, HT_50_tpipe, HT_50_40_tpipe, HT_40_pipe_250]; + +use \ No newline at end of file