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.
123 lines
3.7 KiB
OpenSCAD
123 lines
3.7 KiB
OpenSCAD
/*
|
|
Threaded fitting Ends
|
|
By the DoomMeister
|
|
|
|
v1.0
|
|
|
|
//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 Threaded Ends For 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, thread sizes to BS 21.
|
|
|
|
*/
|
|
|
|
use<threads.scad>
|
|
|
|
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
//Test Area - uncomment to draw
|
|
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
|
|
/*
|
|
fitting_end(l=30,no_threads=9,threads=true);
|
|
translate([30,0,0])
|
|
fitting_end(core=0.734,od=0.825,tpi=14,pod=21.70,pt=3.2,l=17,no_threads=7,threads=true,male=true,qual=20);
|
|
*/
|
|
|
|
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
//Inner Module
|
|
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
|
|
module fitting_end(core=0.734,od=0.825,tpi=14,pod=21.70,pt=3.2,l=34,no_threads=7,threads=false,male=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 * no_threads; //thread length
|
|
chl = pitch *25.4*0.5; //corner chamfer;
|
|
or = ir + t; //outer radius
|
|
rr = ir + (1.5*t); //reenforced radius
|
|
tor = od * 0.5 * 25.4; //thread max radiaus
|
|
echo(pod,pid,pod/25.4,pid/25.4,pitch,rr,"threads=",no_threads);
|
|
|
|
if(l>tl){
|
|
|
|
if(!male){
|
|
union(){
|
|
|
|
difference(){
|
|
//form body
|
|
rotate_extrude(convexity=4,$fn=qual)
|
|
//rotate([90,0,0])
|
|
polygon( points=[[ir,0],[tcr,chl],[tcr,tl-chl],
|
|
[ir,tl],[ir,l],[or,l],
|
|
[or,l-(2*t)],[or,(2*t)],
|
|
[rr,t],[rr,0]] );
|
|
//cut threads
|
|
if(threads){
|
|
english_thread(diameter=od, threads_per_inch=tpi, length=pitch * no_threads,internal=true, n_starts=1,tq=qual);
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if(male){
|
|
if(threads){
|
|
union(){
|
|
|
|
//form body
|
|
rotate_extrude(convexity=4,$fn=qual)
|
|
//rotate([90,0,0])
|
|
polygon( points=[[ir-t,0],
|
|
[ir-t,l],[ir,l],
|
|
[ir,tl],[tcr,tl-chl],
|
|
[tcr,0]] );
|
|
//cut threads
|
|
|
|
difference(){
|
|
english_thread(diameter=od, threads_per_inch=tpi, length=pitch * no_threads,internal=false, n_starts=1,tq=qual);
|
|
cylinder(r=ir-t,h=tl,$fn=qual);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if(!threads){
|
|
rotate_extrude(convexity=4,$fn=qual)
|
|
//rotate([90,0,0])
|
|
polygon( points=[[ir-t,0],
|
|
[ir-t,l],[ir,l],
|
|
[ir,tl],[tor,tl-chl],
|
|
[tor,chl],[tor-chl,0]] );
|
|
|
|
}
|
|
}
|
|
if(l<tl){
|
|
echo("length of end peice is less than thread length");
|
|
}
|
|
}
|
|
}
|
|
|
|
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
//
|
|
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |