You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

220 lines
7.5 KiB
OpenSCAD

/*
elbows's
By the DoomMeister
//Released under the terms of the GNU GPL v3.0
This program 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.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
WARNING - No warrenty is given regarding the fitness of these parts to convey pressurised
media if they are fabricated by any means. The user takes all risk in terms of saftey, testing, and material choice.
**
This file will generate a range of elbow Type Pipe fittings either with threads or without, this
means that the resulting part could be a functional pipe fitting or used as a pattern for casting.
Dimensions are generally to BS 143. Options are avilible for ribs and re-enforced hexagonal ends
*/
use<fitting_end.scad>;
use<hex_form.scad>;
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//Test - Comment Out for Module Usage
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//socket();
_test();
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//Test Module - Example usages
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
module _test(){
elbow();
translate([50,0,0])color("grey")
elbow(size=0.75,type="std",threads=false,ribs=true,hex=true,qual=200);
translate([110,0,0])color("blue")
elbow(size=1,type="std",threads=false,ribs=true,hex=true,qual=100);
translate([120,-50,0])color("green")
elbow(size=3/8,type="std",qual=50);
translate([50,-50,0])color("orange")
elbow(size=0.25,hex=false, type="std",qual=100);
translate([0,100,0])color("pink")
elbow(size=5/4,type="std",ribs=true,hex=false,qual=120);
translate([70,100,0])color("Indigo")
elbow(size=1.5,hex=false,hex=true, type="std",qual=120);
translate([160,100,0])color("white")
elbow(size=2,type="std",threads=true,ribs=true,hex=true,qual=25);
translate([0,200,0])color("brown")
elbow(size=2.5,hex=true, type="std",qual=100);
translate([150,270,0])color("LightSkyBlue")
elbow(size=3,ribs=true,hex=true, type="std",qual=100);
translate([-20,400,0])color("OliveDrab")
elbow(size=4,ribs=true,hex=true, type="std",qual=100);
translate([150,450,0])color("DarkGoldenrod")
elbow(size=5,ribs=true,hex=false, type="std",qual=100);
translate([0,700,0])color("red")
elbow(size=6,type="std",threads=true,ribs=false,hex=true,qual=25);
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//Outer Module - Negotiates sizes and calls correct sub module
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
module elbow(size=0.5,type="std",threads=false,ribs=false,hex=false,qual=50){
if(size==0.25){
if(type=="std"){
_elbow(core=0.451,od=0.518,tpi=19,pod=13.9,pt=2.9,a=21,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==0.375){
if(type=="std"){
_elbow(core=0.589,od=0.656,tpi=19,pod=17.4,pt=2.9,a=25,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==0.5){
if(type=="std"){
_elbow(core=0.734,od=0.825,tpi=14,pod=21.70,pt=3.2,a=28,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==0.75){
if(type=="std"){
_elbow(core=0.95,od=1.041,tpi=14,pod=27.20,pt=3.2,a=33,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==1){
if(type=="std"){
_elbow(core=1.193,od=1.309,tpi=11,pod=34.2,pt=4,a=38,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==1.25){
if(type=="std"){
_socket(core=1.534,od=1.65,tpi=11,pod=42.9,pt=4,a=45,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==1.5){
if(type=="std"){
_elbow(core=1.766,od=1.882,tpi=11,pod=48.8,pt=4,a=50,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==2){
if(type=="std"){
_elbow(core=2.231,od=2.347,tpi=11,pod=60.80,pt=4.5,a=58,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==2.5){
if(type=="std"){
_elbow(core=2.8436,od=2.960,tpi=11,pod=76.6,pt=4.5,a=69,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==3){
if(type=="std"){
_elbow(core=3.3436,od=3.46,tpi=11,pod=89.5,pt=5,a=78,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==4){
if(type=="std"){
_elbow(core=4.3336,od=4.45,tpi=11,pod=114.90,pt=5.4,a=96,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==5){
if(type=="std"){
_elbow(core=5.3336,od=5.45,tpi=11,pod=140.6,pt=5.4,a=115,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==6){
if(type=="std"){
_elbow(core=6.3336,od=6.45,tpi=11,pod=166.10,pt=5.4,a=131,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//inner modules
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//module to make equal elbow
module _elbow(core=0.734,od=0.825,tpi=14,pod=21.70,pt=3.2,a=34,threads=false,ribs=false,hex=false,qual=20){
pid = pod -(pt*2);
pitch = 1/tpi;
t = pt; //thickness
ir = pod/2; //internal rad
tcr = core *0.5*25.4; //thread core rad
tl = pitch * 25.4 * 7; //thread length
chl = pitch *25.4*0.5; //corner chamfer;
or = ir + t; //outer radius
rr = ir + (1.5*t); //reenforced radius
echo(pod,pid,pod/25.4,pid/25.4,pitch,rr);
difference(){
union(){
if(threads){
fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=a,no_threads=7,threads=true,male=false,qual=qual);
translate([0,-a,a])
rotate([270,0,0])
fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=a,no_threads=7,threads=true,male=false,qual=qual);
}
if(!threads){
fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=a,no_threads=7,threads=false,male=false,qual=qual);
translate([0,-a,a])
rotate([270,0,0])
fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=a,no_threads=7,threads=false,male=false,qual=qual);
}
translate([0,0,a])
sphere(r=or,$fn=qual);
if(ribs){
/*
rotate([0,0,90])
difference(){
union(){
translate([ir,-t,0])
cube([rr-ir,2*t,a*2]);
//translate([-rr,-t,0])
//cube([rr-ir,2*t,a*2]);
}
difference(){
cylinder(r=rr+t,h=a*2,$fn=qual);
cylinder(r=rr,h=a*2,$fn=qual);
}
}
*/
}
if(hex){
hex_form(height=t*3,hex_id=pod,wall_thickness=t,sides=8,inclination=1.1,qual=qual);
translate([0,-a+(3*t),a])rotate([90,0,0])
hex_form(height=t*3,hex_id=pod,wall_thickness=t,sides=8,inclination=1.1,qual=qual);
}
}
//Cutout middle section
translate([0,0,(tl)])
cylinder(r=ir, h=a-tl,$fn=qual);
translate([0,0,(a)])rotate([90,0,0])
cylinder(r=ir, h=a-tl,$fn=qual);
translate([0,0,(a)])rotate([90,0,0])
sphere(r=ir,$fn=qual);
}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>