actualizando

main
parent 364855379a
commit 3ed6d05e74

@ -0,0 +1 @@
Subproject commit 61ca34d5dec638f92a8f14f72d89863839803e23

Binary file not shown.

@ -0,0 +1,12 @@
nombre_completo: "Ernesto Acevedo Nuñez"
nombre_corto: "acevedo"
telefono: "+5352886079"
email: "ernestoacevedonunez@gmail.com"
dia_nacimiento: ""
direccion: ""
geo: "23.106478, -82.321609"
cuenta_bancaria: "9224959879650271"
titulo: ""
organizacion: ""
descripcion: ""
servicios: "impresion 3d"

@ -0,0 +1,14 @@
nombre_completo: "Eduardo Perez Pujol"
nombre_corto: "kopek"
telefono: "+5353442140"
email: ""
dia_nacimiento: ""
direccion: ""
geo: "23.106478, -82.321609"
cuenta_bancaria: "9225959876016566"
titulo: ""
organizacion: ""
descripcion: ""
servicios: "impresion 3D"

@ -0,0 +1,12 @@
nombre_completo: ""
nombre_corto: ""
telefono: ""
email: ""
dia_nacimiento: ""
direccion: ""
geo: "" -- geolocalizacion de su direccion
cuenta_bancaria: ""
titulo: ""
organizaciones: "" -- organizaciones a las que pertenece
descripcion: "" -- una breve descripción de Ud.
servicios: ""

@ -0,0 +1,13 @@
--por favor, rellene los campos colocando la información dentro de las comillas.
nombre_completo: ""
nombre_corto: ""
telefono: ""
email: ""
fecha_nacimiento: ""
direccion: ""
geo: "" -- geolocalizacion de su direccion
titulo: ""
profesion: ""
organizaciones: "" -- organizaciones a las que pertenece
descripcion: "" -- una breve descripción de Ud (200 palabras).

@ -0,0 +1,6 @@
//modulos
use <"./component--joint--tee.scad">;
joint_tee();

@ -0,0 +1,5 @@
module joint_tee(size=60)
{
cube(size,center=true);
};
joint_tee();

@ -0,0 +1,6 @@
module pipe(diam=30, hight=500)
{
cylinder(d=diam,h=hight,center=true);
};
pipe();

@ -0,0 +1,30 @@
radius = 20;
angles = [0, 90];
width = 5;
fn = 24;
module sector(radius, angles, fn = 24) {
r = radius / cos(180 / fn);
step = -360 / fn;
points = concat([[0, 0]],
[for(a = [angles[0] : step : angles[1] - 360])
[r * cos(a), r * sin(a)]
],
[[r * cos(angles[1]), r * sin(angles[1])]]
);
difference() {
circle(radius, $fn = fn);
polygon(points);
}
}
module arc(radius, angles, width = 1, fn = 24) {
difference() {
sector(radius + width, angles, fn);
sector(radius, angles, fn);
}
}
linear_extrude(1) arc(radius, angles, width);

@ -0,0 +1,228 @@
//modules
use <./component--joint--tee.scad>;
use <./component--pipe.scad>;
{ //parameters
{
caster_hight=135;
caster_widht=50;
joint_tee_size=60;
pipe_diameter=26.67;
}
{
table_widht=600;
table_length=1800;
table_hight=700;
}
{
base_bottom_center=caster_hight+joint_tee_size/2;
base_top_center=table_hight-joint_tee_size/2;
}
{
base_widht=table_widht-2*(0)/2;
base_length=table_length-2*(0)/2;
}
{
assembly_offset=5;
}
}
{ //operations
{ //positioning
point_node=(
[
[base_widht/2,base_length/2,base_bottom_center]
]
);
point_pipe_horizontal=(
[
[base_widht/4,base_length/2,base_bottom_center],
[base_widht/4,base_length/2,base_top_center],
]
);
point_central_node=(
[
[0,base_length/2,base_bottom_center],
[0,base_length/2,base_top_center],
]
);
point_pipe=(
[
[base_widht/2,base_length/2,caster_hight+(base_top_center-caster_hight)/2],
]
);
point_caster=(
[
[base_widht/2,base_length/2,caster_hight/2],
]
);
point_crossbar=(
[
[0,0,base_bottom_center],
[0,0,base_top_center],
]
);
point_node_top=(
[
[base_widht/2,base_length/2,base_top_center],
]
);
}
{ //modules
color("yellow")
crossbars();
laterals();
module laterals()
{
lateral_mid();
lateral_mid_mirror();
}
module lateral_mid()
{
lateral_quarter();
lateral_quarter_mirror();
node_pos_central();
}
module lateral_quarter()
{
color("blue")
caster();
color("red")
for (pos=point_node)
translate(pos)
node_bottom();
color("orange")
pipe_vertical();
color("orange")
pipe_horizontal_pos();
color("green")
node_top();
}
module node_bottom()
{
joint_tee(size=joint_tee_size);
};
module pipe_vertical()
{
for (pos=point_pipe)
translate(pos)
pipe(diam=pipe_diameter,hight=base_top_center-caster_hight-joint_tee_size+2*assembly_offset);
};
module pipe_horizontal_pos ()
{
for (pos=point_pipe_horizontal)
translate(pos)
pipe_horizontal();
};
module pipe_horizontal()
{
rotate([0,90,0])
pipe(diam=pipe_diameter,hight=base_widht/2-joint_tee_size+2*assembly_offset);
};
module caster()
{
for (pos=point_caster)
translate(pos)
rotate([0,90,0])
cylinder(h=caster_widht,r=caster_hight/2,center=true);
};
module node_top()
{
for (pos=point_node_top)
translate(pos)
cube(size=joint_tee_size,center=true);
};
module lateral_quarter_mirror()
{
mirror([1,0,0])
lateral_quarter();
};
module lateral_mid_mirror()
{
mirror([1,0,0])
lateral_mid();
}
module node_pos_central()
{
color("red")
for (pos=point_central_node)
translate(pos)
joint_tee(size=joint_tee_size);
}
module lateral_mid_mirror()
{
mirror([0,1,0])
lateral_mid();
};
module crossbars()
{
color("red")
for (pos=point_crossbar)
translate(pos)
crossbar();
}
module crossbar()
{
rotate([90,0,0])
pipe(diam=pipe_diameter,hight=base_length-joint_tee_size+2*assembly_offset);
}
}
}

@ -0,0 +1,15 @@
//modulos
use <./tee.scad>;
base_ancho=1000;
base_largo=500;
altura=700;
altura_rueda=100;
point=([[1,1,1],[base_ancho,0,altura_rueda],[base_ancho,0,altura_rueda],[base_ancho,0,altura_rueda]]);
for (pos=point)
translate(pos)
color("white")
cube(30);

@ -0,0 +1,16 @@
//modulos
use <./tee.scad>;
//base_ancho=1000;
//base_largo=500;
//altura=700;
//altura_rueda=100;
//point([[base_ancho,0,altura_rueda],[base_ancho,0,altura_rueda],[base_ancho,0,altura_rueda],[base_ancho,0,altura_rueda]])
//
//for (pos=point)
translate(pos)
color("white")
tee(size=5,ribs=true,hex=false, type="std",qual=100);

@ -0,0 +1,74 @@
//BSP_form();
//BSP_thread(pitch=25.4/14,dia=1.041*25.4,threads = 7,draw_inc=1000);
//**************************************************
//Horrible module to rotate a slice
//**************************************************
module BSP_thread(pitch=1.814,dia=18.613,threads = 1,draw_inc=360){
a_move = (360*threads)/draw_inc;
function x_move(i) = dia-(sin(i*a_move)*dia);
function y_move(i) = dia+(cos(i*a_move)*dia);
function z_move(i) = i * (pitch*threads)/draw_inc;
function z_rot(i) = 90 + (i * a_move);
union(){
for(i = [0:draw_inc])
{
echo(i,x_move(i),y_move(i),z_move(i));
translate([x_move(i),
y_move(i),
z_move(i)])
rotate([90,
0,
z_rot(i)])
linear_extrude(height = 2.2*(threads*3.142*dia)/draw_inc,
center = true,
convexity = 10,
twist = 0,
$fn = 100)
BSP_form(P=pitch,D=dia,AA=55);
}
}
}
//**************************************************
//Flat Thread Form For Extrusion
//**************************************************
module BSP_form( male=true, P=1.814,D=18.613,AA=55,$fn=30){
/* male, is the form a male of female thread
P, Pitch
D, diameter
AA, form angle
*/
tr = P * 0.137329; //end radius
th = P*0.640327; //thread form height
AA2 = AA/2; //functional angle
tvv = cos(AA2)*tr; //height of tangent point
thv = sin(AA2)*tr; //horizontal of tanget
cc = (th)-tr; //end radius circle centre
tc = cc + thv;
thh = tan(AA2)*th;
tbh = thh + tvv;
//echo(tvv,thv,tc,thh);
//**************************************************
//rotate([90,0,0])
union(){
translate([cc,0])circle(r=tr);
polygon(points = [ [0, tbh],
[tc, tvv],
[tc, -tvv],
[0, -tbh]]);
}
}

@ -0,0 +1,220 @@
/*
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);
}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@ -0,0 +1,123 @@
/*
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");
}
}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@ -0,0 +1,57 @@
/*
Hex (or other polygon) form for making nuts and such
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 a hexeagon or ocogon or n... sided forn for use as a nut or re-enforcement
*/
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//Test - Comment Out for Module Usage
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//hex_form();
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//Module
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
module hex_form(height=12,hex_id=21.70,wall_thickness=3.2,sides=8,inclination=1.1,qual=100){
hh = height/3;
t = wall_thickness; //thickness
ir = hex_id/2; //internal rad
rr = ir + (1.5*t); //reenforced radius
inc = inclination;
difference(){
translate([0,0,0])
rotate_extrude(convexity=4,$fn=qual)
//rotate([90,0,0])
polygon( points=[[rr,0],[ir,0],[ir,hh*3],[rr,hh*3],[inc*rr,hh*2],[inc*rr,hh]]);
translate([0,0,0])
difference(){
cylinder(r=1.5*rr+t,h=3*hh,$fn=qual);
cylinder(r=1.1*rr+(0.0*t),h=3*hh,$fn=sides);
}
}
}

@ -0,0 +1,5 @@
use <./tee.scad>
translate([0,700,0])color("red")
tee(size=6,type="std",threads=true,ribs=false,hex=true,qual=25);

@ -0,0 +1,218 @@
/*
Simple screwed pipe generator
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 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 1387 heavy.
*/
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
use<fitting_end.scad>;
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//test area - comment out to use as module
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
pipe(size=0.5,length=100,threads=true);
/*
translate([40,0,0])color("orange")
_pipe(pod=21.7,pt=3.2,od= 0.825,core=0.734,tpi=14,length=200,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=100);
translate([100,0,0])color("indigo") pipe(size=2,qual=25);
*/
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//outer module - calls standard sizes
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
module pipe(size=0.5,type="std",threads=true,length=100,qual=50){
if(size==0.25){
if(threads){
_pipe(core=0.451,od=0.518,tpi=19,pod=13.9,pt=2.9,length=200,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=0.451,od=0.518,tpi=19,pod=13.9,pt=2.9,length=200,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==0.375){
if(threads){
_pipe(core=0.589,od=0.656,tpi=19,pod=17.4,pt=2.9,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=0.589,od=0.656,tpi=19,pod=17.4,pt=2.9,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==0.5){
if(threads){
_pipe(core=0.734,od=0.825,tpi=14,pod=21.70,pt=3.2,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=0.734,od=0.825,tpi=14,pod=21.70,pt=3.2,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==0.75){
if(threads){
_pipe(core=0.95,od=1.041,tpi=14,pod=27.20,pt=3.2,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=0.95,od=1.041,tpi=14,pod=27.20,pt=3.2,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==1){
if(threads){
_pipe(core=1.193,od=1.309,tpi=11,pod=34.2,pt=4,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=1.193,od=1.309,tpi=11,pod=34.2,pt=4,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==1.25){
if(threads){
_pipe(core=1.534,od=1.65,tpi=11,pod=42.9,pt=4,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=1.534,od=1.65,tpi=11,pod=42.9,pt=4,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==1.5){
if(threads){
_pipe(core=1.766,od=1.882,tpi=11,pod=48.8,pt=4,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=1.766,od=1.882,tpi=11,pod=48.8,pt=4,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==2){
if(threads){
_pipe(core=2.231,od=2.347,tpi=11,pod=60.80,pt=4.5,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=2.231,od=2.347,tpi=11,pod=60.80,pt=4.5,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==2.5){
if(threads){
_pipe(core=2.8436,od=2.960,tpi=11,pod=76.6,pt=4.5,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=2.8436,od=2.960,tpi=11,pod=76.6,pt=4.5,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==3){
if(threads){
_pipe(core=3.3436,od=3.46,tpi=11,pod=89.5,pt=5,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=3.3436,od=3.46,tpi=11,pod=89.5,pt=5,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==4){
if(threads){
_pipe(core=4.3336,od=4.45,tpi=11,pod=114.90,pt=5.4,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=4.3336,od=4.45,tpi=11,pod=114.90,pt=5.4,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==5){
if(threads){
_pipe(core=5.3336,od=5.45,tpi=11,pod=140.6,pt=5.4,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=5.3336,od=5.45,tpi=11,pod=140.6,pt=5.4,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
if(size==6){
if(threads){
_pipe(core=6.3336,od=6.45,tpi=11,pod=166.10,pt=5.4,length=length,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,qual=qual);
}
if(!threads){
_pipe(core=6.3336,od=6.45,tpi=11,pod=166.10,pt=5.4,length=length,thread_1=false,thread_2=false,no_threads_1=9,no_threads_2=9,qual=qual);
}
}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//inner module - draws pipe
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
module _pipe(pod=34.20,pt=4,length=150,thread_1=true,thread_2=true,no_threads_1=9,no_threads_2=9,od= 1.309,core=1.193,tpi=11,qual=20){
union(){
if(thread_1){
fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=length/2,no_threads=no_threads_1,threads=true,male=true,qual=qual);
}
if(!thread_1){
fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=length/2,no_threads=no_threads_1,threads=false,male=true,qual=qual);
}
if(thread_2){
translate([0,0,length])
rotate([180,0,0])
fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=length/2,no_threads=no_threads_2,threads=true,male=true,qual=qual);
}
if(!thread_2){
translate([0,0,length])
rotate([180,0,0])
fitting_end(core=core,od=od,tpi=tpi,pod=pod,pt=pt,l=length/2,no_threads=no_threads_2,threads=false,male=true,qual=qual);
}
//add the actual pipe
if(thread_1){
if (thread_2){
translate([0,0,no_threads_1*(25.4/tpi)])
difference(){
cylinder(h=length-(no_threads_1*(25.4/tpi)+no_threads_2*(25.4/tpi)),r1=pod/2,r2=pod/2,$fn=qual);
cylinder(h=length-(no_threads_1*(25.4/tpi)+no_threads_2*(25.4/tpi)),r1=(pod-pt)/2,r2=(pod-pt)/2,$fn=qual);
}
}
if (!thread_2){
translate([0,0,no_threads_1*(25.4/tpi)])
difference(){
cylinder(h=length-(no_threads_1*(25.4/tpi)),r1=pod/2,r2=pod/2,$fn=qual);
cylinder(h=length-(no_threads_1*(25.4/tpi)),r1=(pod-pt)/2,r2=(pod-pt)/2,$fn=qual);
}
}
}
if(!thread_1){
if (thread_2){
difference(){
cylinder(h=length-(no_threads_2*(25.4/tpi)),r1=pod/2,r2=pod/2,$fn=qual);
cylinder(h=length- (no_threads_2*(25.4/tpi)),r1=(pod-pt)/2,r2=(pod-pt)/2,$fn=qual);
}
}
if (!thread_2){
difference(){
cylinder(h=length,r1=pod/2,r2=pod/2,$fn=qual);
cylinder(h=length,r1=(pod-pt)/2,r2=(pod-pt)/2,$fn=qual);
}
}
}
}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@ -0,0 +1,204 @@
/*
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 <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 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<fitting_end.scad>;
use<hex_form.scad>;
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//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);
}
}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@ -0,0 +1,220 @@
/*
Tee'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 Tee 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(){
tee();
translate([50,0,0])color("grey")
tee(size=0.75,type="std",threads=false,ribs=true,hex=true,qual=200);
translate([110,0,0])color("blue")
tee(size=1,type="std",threads=false,ribs=true,hex=true,qual=100);
translate([120,-50,0])color("green")
tee(size=3/8,type="std",qual=50);
translate([50,-50,0])color("orange")
tee(size=0.25,hex=false, type="std",qual=100);
translate([0,100,0])color("pink")
tee(size=5/4,type="std",ribs=true,hex=false,qual=120);
translate([70,100,0])color("Indigo")
tee(size=1.5,hex=false,hex=true, type="std",qual=120);
translate([160,100,0])color("white")
tee(size=2,type="std",threads=true,ribs=true,hex=true,qual=25);
translate([0,200,0])color("brown")
tee(size=2.5,hex=true, type="std",qual=100);
translate([150,270,0])color("LightSkyBlue")
tee(size=3,ribs=true,hex=true, type="std",qual=100);
translate([-20,400,0])color("OliveDrab")
tee(size=4,ribs=true,hex=true, type="std",qual=100);
translate([150,450,0])color("DarkGoldenrod")
tee(size=5,ribs=true,hex=false, type="std",qual=100);
translate([0,700,0])color("red")
tee(size=6,type="std",threads=true,ribs=false,hex=true,qual=25);
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//Outer Module - Negotiates sizes and calls correct sub module
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
module tee(size=0.5,type="std",threads=false,ribs=false,hex=true,qual=50){
if(size==0.25){
if(type=="std"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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=48,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==1.5){
if(type=="std"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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 tee
module _tee(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,0,a*2])
rotate([180,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);
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,0,a*2])
rotate([180,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,-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);
}
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,0,(a*2)-(3*t)])
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,(a)-(or)])
cylinder(r=ir, h=2*or,$fn=qual);
translate([0,0,(a)])rotate([90,0,0])
cylinder(r=ir, h=a-tl,$fn=qual);
}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@ -0,0 +1,220 @@
/*
Tee'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 Tee 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(){
tee();
translate([50,0,0])color("grey")
tee(size=0.75,type="std",threads=false,ribs=true,hex=true,qual=200);
translate([110,0,0])color("blue")
tee(size=1,type="std",threads=false,ribs=true,hex=true,qual=100);
translate([120,-50,0])color("green")
tee(size=3/8,type="std",qual=50);
translate([50,-50,0])color("orange")
tee(size=0.25,hex=false, type="std",qual=100);
translate([0,100,0])color("pink")
tee(size=5/4,type="std",ribs=true,hex=false,qual=120);
translate([70,100,0])color("Indigo")
tee(size=1.5,hex=false,hex=true, type="std",qual=120);
translate([160,100,0])color("white")
tee(size=2,type="std",threads=true,ribs=true,hex=true,qual=25);
translate([0,200,0])color("brown")
tee(size=2.5,hex=true, type="std",qual=100);
translate([150,270,0])color("LightSkyBlue")
tee(size=3,ribs=true,hex=true, type="std",qual=100);
translate([-20,400,0])color("OliveDrab")
tee(size=4,ribs=true,hex=true, type="std",qual=100);
translate([150,450,0])color("DarkGoldenrod")
tee(size=5,ribs=true,hex=false, type="std",qual=100);
translate([0,700,0])color("red")
tee(size=6,type="std",threads=true,ribs=false,hex=true,qual=25);
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//Outer Module - Negotiates sizes and calls correct sub module
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
module tee(size=0.5,type="std",threads=false,ribs=false,hex=true,qual=50){
if(size==0.25){
if(type=="std"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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=48,threads=threads,ribs=ribs,hex=hex,qual=qual);
}
}
if(size==1.5){
if(type=="std"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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"){
_tee(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 tee
module _tee(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,0,a*2])
rotate([180,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);
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,0,a*2])
rotate([180,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,-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);
}
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,0,(a*2)-(3*t)])
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,(a)-(or)])
cylinder(r=ir, h=2*or,$fn=qual);
translate([0,0,(a)])rotate([90,0,0])
cylinder(r=ir, h=a-tl,$fn=qual);
}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@ -0,0 +1,205 @@
/*
* Modified by the DoomMeister
* To allow a parsable quality setting, better tuned for BSP threads
*
* Origionally By
* Dan Kirshner - dan_kirshner@yahoo.com
*
* You are welcome to make free use of this software. Retention of my
* authorship credit would be appreciated.
*
* Version 1.3. 2013-12-01 Correct loop over turns -- don't have early cut-off
* Version 1.2. 2012-09-09 Use discrete polyhedra rather than linear_extrude()
* Version 1.1. 2012-09-07 Corrected to right-hand threads!
*/
// Examples:
//metric_thread(8, 1, 10);
//english_thread(1/4, 20, 1);
// Rohloff hub thread:
//metric_thread(34, 1, 10, internal=true, n_starts=6);
//metric_thread(8, 2, 4);
// ----------------------------------------------------------------------------
pi = 3.14159265;
// ----------------------------------------------------------------------------
function segments(diameter) = min(10, ceil(diameter*6));
// ----------------------------------------------------------------------------
// internal - true = clearances for internal thread (e.g., a nut).
// false = clearances for external thread (e.g., a bolt).
// (Internal threads should be "cut out" from a solid using
// difference()).
// n_starts - Number of thread starts (e.g., DNA, a "double helix," has
// n_starts=2). See wikipedia Screw_thread.
module metric_thread(diameter=8, pitch=1, length=1, internal=false, n_starts=1,tq=10)
{
// Number of turns needed.
n_turns = floor(length/pitch);
n_segments = tq;
h = pitch * cos(30);
union() {
intersection() {
// Start one below z = 0. Gives an extra turn at each end.
for (i=[-1*n_starts : n_turns+1]) {
translate([0, 0, i*pitch]) {
metric_thread_turn(diameter, pitch, internal, n_starts,tq);
}
}
// Cut to length.
translate([0, 0, length/2]) {
cube([diameter*1.1, diameter*1.1, length], center=true);
}
}
// Solid center, including Dmin truncation.
if (internal) {
cylinder(r=diameter/2 - h*5/8, h=length, $fn=n_segments);
} else {
// External thread includes additional relief.
cylinder(r=diameter/2 - h*5.3/8, h=length, $fn=n_segments);
}
}
}
// ----------------------------------------------------------------------------
// Input units in inches.
// Note: units of measure in drawing are mm!
module english_thread(diameter=0.25, threads_per_inch=20, length=1,
internal=false, n_starts=1,tq=10)
{
// Convert to mm.
mm_diameter = diameter*25.4;
mm_pitch = (1.0/threads_per_inch)*25.4;
mm_length = length*25.4;
echo(str("mm_diameter: ", mm_diameter));
echo(str("mm_pitch: ", mm_pitch));
echo(str("mm_length: ", mm_length));
metric_thread(mm_diameter, mm_pitch, mm_length, internal, n_starts,tq);
}
// ----------------------------------------------------------------------------
module metric_thread_turn(diameter, pitch, internal, n_starts,tq)
{
n_segments = tq;
fraction_circle = 1.0/n_segments;
for (i=[0 : n_segments-1]) {
rotate([0, 0, i*360*fraction_circle]) {
translate([0, 0, i*n_starts*pitch*fraction_circle]) {
thread_polyhedron(diameter/2, pitch, internal, n_starts,tq);
}
}
}
}
// ----------------------------------------------------------------------------
// z (see diagram) as function of current radius.
// (Only good for first half-pitch.)
function z_fct(current_radius, radius, pitch)
= 0.5*(current_radius - (radius - 0.875*pitch*cos(30)))
/cos(30);
// ----------------------------------------------------------------------------
module thread_polyhedron(radius, pitch, internal, n_starts,tq)
{
n_segments = tq;
fraction_circle = 1.0/n_segments;
h = pitch * cos(30);
outer_r = radius + (internal ? h/20 : 0); // Adds internal relief.
//echo(str("outer_r: ", outer_r));
inner_r = radius - 0.875*h; // Does NOT do Dmin_truncation - do later with
// cylinder.
// Make these just slightly bigger (keep in proportion) so polyhedra will
// overlap.
x_incr_outer = outer_r * fraction_circle * 2 * pi * 1.005;
x_incr_inner = inner_r * fraction_circle * 2 * pi * 1.005;
z_incr = n_starts * pitch * fraction_circle * 1.005;
/*
(angles x0 and x3 inner are actually 60 deg)
/\ (x2_inner, z2_inner) [2]
/ \
(x3_inner, z3_inner) / \
[3] \ \
|\ \ (x2_outer, z2_outer) [6]
| \ /
| \ /|
z | \/ / (x1_outer, z1_outer) [5]
| | | /
| x | |/
| / | / (x0_outer, z0_outer) [4]
| / | / (behind: (x1_inner, z1_inner) [1]
|/ | /
y________| |/
(r) / (x0_inner, z0_inner) [0]
*/
x1_outer = outer_r * fraction_circle * 2 * pi;
z0_outer = z_fct(outer_r, radius, pitch);
//echo(str("z0_outer: ", z0_outer));
//polygon([[inner_r, 0], [outer_r, z0_outer],
// [outer_r, 0.5*pitch], [inner_r, 0.5*pitch]]);
z1_outer = z0_outer + z_incr;
// Rule for triangle ordering: look at polyhedron from outside: points must
// be in clockwise order.
polyhedron(
points = [
[-x_incr_inner/2, -inner_r, 0], // [0]
[x_incr_inner/2, -inner_r, z_incr], // [1]
[x_incr_inner/2, -inner_r, pitch + z_incr], // [2]
[-x_incr_inner/2, -inner_r, pitch], // [3]
[-x_incr_outer/2, -outer_r, z0_outer], // [4]
[x_incr_outer/2, -outer_r, z0_outer + z_incr], // [5]
[x_incr_outer/2, -outer_r, pitch - z0_outer + z_incr], // [6]
[-x_incr_outer/2, -outer_r, pitch - z0_outer] // [7]
],
faces = [
[0, 3, 4], // This-side trapezoid, bottom
[3, 7, 4], // This-side trapezoid, top
[1, 5, 2], // Back-side trapezoid, bottom
[2, 5, 6], // Back-side trapezoid, top
[0, 1, 2], // Inner rectangle, bottom
[0, 2, 3], // Inner rectangle, top
[4, 6, 5], // Outer rectangle, bottom
[4, 7, 6], // Outer rectangle, top
[7, 2, 6], // Upper rectangle, bottom
[7, 3, 2], // Upper rectangle, top
[0, 5, 1], // Lower rectangle, bottom
[0, 4, 5] // Lower rectangle, top
]
);
}

@ -0,0 +1,206 @@
/*
* Modified by the DoomMeister
* To allow a parsable quality setting, better tuned for BSP threads
*
* Origionally By
* Dan Kirshner - dan_kirshner@yahoo.com
*
* You are welcome to make free use of this software. Retention of my
* authorship credit would be appreciated.
*
* Version 1.3. 2013-12-01 Correct loop over turns -- don't have early cut-off
* Version 1.2. 2012-09-09 Use discrete polyhedra rather than linear_extrude()
* Version 1.1. 2012-09-07 Corrected to right-hand threads!
*/
// Examples:
//metric_thread(8, 1, 10);
//english_thread(1/4, 20, 1);
// Rohloff hub thread:
//metric_thread(34, 1, 10, internal=true, n_starts=6);
//metric_thread(8, 2, 4);
thread_polyhedron(1.309*0.5*25.4, 1/11*25.4, false, 1,20);
// ----------------------------------------------------------------------------
pi = 3.14159265;
// ----------------------------------------------------------------------------
function segments(diameter) = min(10, ceil(diameter*6));
// ----------------------------------------------------------------------------
// internal - true = clearances for internal thread (e.g., a nut).
// false = clearances for external thread (e.g., a bolt).
// (Internal threads should be "cut out" from a solid using
// difference()).
// n_starts - Number of thread starts (e.g., DNA, a "double helix," has
// n_starts=2). See wikipedia Screw_thread.
module metric_thread(diameter=8, pitch=1, length=1, internal=false, n_starts=1,tq=10)
{
// Number of turns needed.
n_turns = floor(length/pitch);
n_segments = tq;
h = pitch * cos(27.5);
union() {
intersection() {
// Start one below z = 0. Gives an extra turn at each end.
for (i=[-1*n_starts : n_turns+1]) {
translate([0, 0, i*pitch]) {
metric_thread_turn(diameter, pitch, internal, n_starts,tq);
}
}
// Cut to length.
translate([0, 0, length/2]) {
cube([diameter*1.1, diameter*1.1, length], center=true);
}
}
// Solid center, including Dmin truncation.
if (internal) {
cylinder(r=diameter/2 - h*5/8, h=length, $fn=n_segments);
} else {
// External thread includes additional relief.
cylinder(r=diameter/2 - h*5.3/8, h=length, $fn=n_segments);
}
}
}
// ----------------------------------------------------------------------------
// Input units in inches.
// Note: units of measure in drawing are mm!
module english_thread(diameter=0.25, threads_per_inch=20, length=1,
internal=false, n_starts=1,tq=10)
{
// Convert to mm.
mm_diameter = diameter*25.4;
mm_pitch = (1.0/threads_per_inch)*25.4;
mm_length = length*25.4;
echo(str("mm_diameter: ", mm_diameter));
echo(str("mm_pitch: ", mm_pitch));
echo(str("mm_length: ", mm_length));
metric_thread(mm_diameter, mm_pitch, mm_length, internal, n_starts,tq);
}
// ----------------------------------------------------------------------------
module metric_thread_turn(diameter, pitch, internal, n_starts,tq)
{
n_segments = tq;
fraction_circle = 1.0/n_segments;
for (i=[0 : n_segments-1]) {
rotate([0, 0, i*360*fraction_circle]) {
translate([0, 0, i*n_starts*pitch*fraction_circle]) {
thread_polyhedron(diameter/2, pitch, internal, n_starts,tq);
}
}
}
}
// ----------------------------------------------------------------------------
// z (see diagram) as function of current radius.
// (Only good for first half-pitch.)
function z_fct(current_radius, radius, pitch)
= 0.5*(current_radius - (radius - 0.875*pitch*cos(30)))
/cos(30);
// ----------------------------------------------------------------------------
module thread_polyhedron(radius, pitch, internal, n_starts,tq)
{
n_segments = tq;
fraction_circle = 1.0/n_segments;
h = pitch * cos(30);
outer_r = radius + (internal ? h/20 : 0); // Adds internal relief.
//echo(str("outer_r: ", outer_r));
inner_r = radius - 0.875*h; // Does NOT do Dmin_truncation - do later with
// cylinder.
// Make these just slightly bigger (keep in proportion) so polyhedra will
// overlap.
x_incr_outer = outer_r * fraction_circle * 2 * pi * 1.005;
x_incr_inner = inner_r * fraction_circle * 2 * pi * 1.005;
z_incr = n_starts * pitch * fraction_circle * 1.005;
/*
(angles x0 and x3 inner are actually 60 deg)
/\ (x2_inner, z2_inner) [2]
/ \
(x3_inner, z3_inner) / \
[3] \ \
|\ \ (x2_outer, z2_outer) [6]
| \ /
| \ /|
z | \/ / (x1_outer, z1_outer) [5]
| | | /
| x | |/
| / | / (x0_outer, z0_outer) [4]
| / | / (behind: (x1_inner, z1_inner) [1]
|/ | /
y________| |/
(r) / (x0_inner, z0_inner) [0]
*/
x1_outer = outer_r * fraction_circle * 2 * pi;
z0_outer = z_fct(outer_r, radius, pitch);
//echo(str("z0_outer: ", z0_outer));
//polygon([[inner_r, 0], [outer_r, z0_outer],
// [outer_r, 0.5*pitch], [inner_r, 0.5*pitch]]);
z1_outer = z0_outer + z_incr;
// Rule for triangle ordering: look at polyhedron from outside: points must
// be in clockwise order.
polyhedron(
points = [
[-x_incr_inner/2, -inner_r, 0], // [0]
[x_incr_inner/2, -inner_r, z_incr], // [1]
[x_incr_inner/2, -inner_r, pitch + z_incr], // [2]
[-x_incr_inner/2, -inner_r, pitch], // [3]
[-x_incr_outer/2, -outer_r, z0_outer], // [4]
[x_incr_outer/2, -outer_r, z0_outer + z_incr], // [5]
[x_incr_outer/2, -outer_r, pitch - z0_outer + z_incr], // [6]
[-x_incr_outer/2, -outer_r, pitch - z0_outer] // [7]
],
faces = [
[0, 3, 4], // This-side trapezoid, bottom
[3, 7, 4], // This-side trapezoid, top
[1, 5, 2], // Back-side trapezoid, bottom
[2, 5, 6], // Back-side trapezoid, top
[0, 1, 2], // Inner rectangle, bottom
[0, 2, 3], // Inner rectangle, top
[4, 6, 5], // Outer rectangle, bottom
[4, 7, 6], // Outer rectangle, top
[7, 2, 6], // Upper rectangle, bottom
[7, 3, 2], // Upper rectangle, top
[0, 5, 1], // Lower rectangle, bottom
[0, 4, 5] // Lower rectangle, top
]
);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save