/* Sockets 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 . ** 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 Socket 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. V1.0 V1.1 - Refined Hexagon Re-Enforcement */ use; use; //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //Test - Comment Out for Module Usage //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> socket(hex=true); socket_test(); //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //Test Module - Example usages //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> module socket_test(){ socket(); translate([50,0,0])color("grey") socket(size=0.75,type="std",threads=false,ribs=true,hex=true,qual=200); translate([110,0,0])color("blue") socket(size=1,type="std",threads=true,ribs=true,hex=false,qual=120); translate([110,-50,0])color("green") socket(size=3/8,type="std",qual=50); translate([50,-50,0])color("orange") socket(size=0.25,hex=false, type="std",qual=100); translate([0,70,0])color("pink") socket(size=5/4,type="std",ribs=true,hex=false,qual=120); translate([70,70,0])color("Indigo") socket(size=1.5,hex=false,threads=true, type="std",qual=100); translate([160,70,0])color("white") socket(size=2,hex=true, type="std",qual=100); translate([0,160,0])color("brown") socket(size=2.5,hex=true, type="std",qual=100); translate([150,175,0])color("LightSkyBlue") socket(size=3,ribs=true,hex=true, type="std",qual=100); translate([1,300,0])color("OliveDrab") socket(size=4,ribs=true,hex=true, type="std",qual=100); translate([150,300,0])color("DarkGoldenrod") socket(size=5,ribs=true,hex=false, type="std",qual=100); translate([0,500,0])color("red") socket(size=6,ribs=true,hex=true, type="std",qual=100); } //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //Outer Module - Negotiates sizes and calls correct sub module //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> module socket(size=0.5,type="std",threads=false,ribs=false,hex=true,qual=50){ if(size==0.25){ if(type=="std"){ _socket(core=0.451,od=0.518,tpi=19,pod=13.9,pt=2.9,a=25.5,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==0.375){ if(type=="std"){ _socket(core=0.589,od=0.656,tpi=19,pod=17.4,pt=2.9,a=28.5,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==0.5){ if(type=="std"){ _socket(core=0.734,od=0.825,tpi=14,pod=21.70,pt=3.2,a=34,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==0.75){ if(type=="std"){ _socket(core=0.95,od=1.041,tpi=14,pod=27.20,pt=3.2,a=37,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==1){ if(type=="std"){ _socket(core=1.193,od=1.309,tpi=11,pod=34.2,pt=4,a=43,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=48,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==1.5){ if(type=="std"){ _socket(core=1.766,od=1.882,tpi=11,pod=48.8,pt=4,a=52.5,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==2){ if(type=="std"){ _socket(core=2.231,od=2.347,tpi=11,pod=60.80,pt=4.5,a=62.5,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==2.5){ if(type=="std"){ _socket(core=2.8436,od=2.960,tpi=11,pod=76.6,pt=4.5,a=71.5,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==3){ if(type=="std"){ _socket(core=3.3436,od=3.46,tpi=11,pod=89.5,pt=5,a=77,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==4){ if(type=="std"){ _socket(core=4.3336,od=4.45,tpi=11,pod=114.90,pt=5.4,a=91,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==5){ if(type=="std"){ _socket(core=5.3336,od=5.45,tpi=11,pod=140.6,pt=5.4,a=105.5,threads=threads,ribs=ribs,hex=hex,qual=qual); } } if(size==6){ if(type=="std"){ _socket(core=6.3336,od=6.45,tpi=11,pod=166.10,pt=5.4,a=116.5,threads=threads,ribs=ribs,hex=hex,qual=qual); } } } //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //inner modules //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //module to make equal socket module _socket(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); union(){ if(threads){ fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=a/2,no_threads=7,threads=true,male=false,qual=qual); translate([0,0,a]) rotate([180,0,0]) fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=a/2,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/2,no_threads=7,threads=false,male=false,qual=qual); translate([0,0,a]) rotate([180,0,0]) fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=a/2,no_threads=7,threads=false,male=false,qual=qual); } if(ribs){ difference(){ union(){ translate([ir,-t,0]) cube([rr-ir,2*t,a]); translate([-rr,-t,0]) cube([rr-ir,2*t,a]); } difference(){ cylinder(r=rr+t,h=a,$fn=qual); cylinder(r=rr,h=a,$fn=qual); } } } if(hex){ hex_form(height=t*3,hex_id=pod,wall_thickness=t,sides=8,inclination=1.1,qual=qual); translate([0,0,(a)-(3*t)]) hex_form(height=t*3,hex_id=pod,wall_thickness=t,sides=8,inclination=1.1,qual=qual); } } } //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>