Created
May 27, 2020 14:31
-
-
Save ednisley/e7620079c4bdc9979356d4114497a004 to your computer and use it in GitHub Desktop.
OpenSCAD source code: soaker hose end plug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rubber Soaker Hose End Plug | |
// Ed Nisley KE4ZNU June 2019 | |
// 2020-05 Two-channel hose end plug | |
Layout = "Hose"; // [Hose,Block,Show,Build] | |
//- Extrusion parameters must match reality! | |
/* [Hidden] */ | |
ThreadThick = 0.25; | |
ThreadWidth = 0.40; | |
HoleWindage = 0.2; | |
Protrusion = 0.1; // make holes end cleanly | |
inch = 25.4; | |
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit); | |
//---------- | |
// Dimensions | |
// Hose lies along X axis | |
HoseTubeOD = 12.0; // water tube diameter | |
HoseTubeOC = 12.5; // .. spacing | |
HoseWebThick = 7.8; // center joining tubes | |
Hose = [100,25.0,HoseTubeOD]; // X=very long, Y=overall width, Z=thickness | |
HoseSides = 12*4; | |
PlugLength = 25.0; // plugs in hose channels | |
PlateThick = 5.0; // end block thickness | |
WallThick = 2.0; // overall minimum thickness | |
Kerf = 0.75; // cut through middle to apply compression | |
ID = 0; | |
OD = 1; | |
LENGTH = 2; | |
// 8-32 stainless screws | |
Screw = [4.1,8.0,3.0]; // OD = head LENGTH = head thickness | |
Washer = [4.4,9.5,1.0]; | |
Nut = [4.1,9.7,6.0]; | |
CornerRadius = Washer[OD]/2; | |
ScrewOC = Hose.y + Washer[OD]; | |
echo(str("Screw OC: ",ScrewOC)); | |
BlockOAL = [PlugLength + PlateThick,ScrewOC + Washer[OD],2*WallThick + Hose.z]; // overall splice block size | |
echo(str("Block: ",BlockOAL)); | |
//---------------------- | |
// Useful routines | |
module PolyCyl(Dia,Height,ForceSides=0) { // based on nophead's polyholes | |
Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2); | |
FixDia = Dia / cos(180/Sides); | |
cylinder(d=(FixDia + HoleWindage),h=Height,$fn=Sides); | |
} | |
// Hose shape | |
module HoseProfile() { | |
rotate([0,-90,0]) | |
translate([0,0,-Hose.x/2]) | |
linear_extrude(height=Hose.x,convexity=4) | |
union() { | |
for (j=[-1,1]) // outer channels | |
translate([0,j*HoseTubeOC/2]) | |
circle(d=HoseTubeOD,$fn=HoseSides); | |
translate([0,0]) | |
square([HoseWebThick,HoseTubeOC],center=true); | |
} | |
} | |
// Outside shape of splice Block | |
// Z centered on hose rim circles, not overall thickness through center ridge | |
module SpliceBlock() { | |
difference() { | |
hull() | |
for (i=[-1,1], j=[-1,1]) // rounded block | |
translate([i*(BlockOAL.x/2 - CornerRadius),j*(BlockOAL.y/2 - CornerRadius),-BlockOAL.z/2]) | |
cylinder(r=CornerRadius,h=BlockOAL.z,$fn=4*8); | |
for (j=[-1,1]) // screw holes | |
translate([0, | |
j*ScrewOC/2, | |
-(BlockOAL.z/2 + Protrusion)]) | |
PolyCyl(Screw[ID],BlockOAL.z + 2*Protrusion,6); | |
cube([2*BlockOAL.x,2*BlockOAL.y,Kerf],center=true); // slice through center | |
} | |
} | |
// Splice block less hose | |
module ShapedBlock() { | |
difference() { | |
SpliceBlock(); | |
translate([(-Hose.x/2) + (BlockOAL.x/2) - PlateThick,0,0]) | |
HoseProfile(); | |
} | |
} | |
//---------- | |
// Build them | |
if (Layout == "Hose") | |
HoseProfile(); | |
if (Layout == "Block") | |
SpliceBlock(); | |
if (Layout == "Show") { | |
ShapedBlock(); | |
translate([(-Hose.x/2) + (BlockOAL.x/2) - PlateThick,0,0]) | |
color("Green",0.25) | |
HoseProfile(); | |
} | |
if (Layout == "Build") { | |
SliceOffset = 0; | |
intersection() { | |
translate([SliceOffset,0,BlockOAL.z/4]) | |
cube([4*BlockOAL.x,4*BlockOAL.y,BlockOAL.z/2],center=true); | |
union() { | |
translate([0,0.6*BlockOAL.y,BlockOAL.z/2]) | |
ShapedBlock(); | |
translate([0,-0.6*BlockOAL.y,BlockOAL.z/2]) | |
rotate([0,180,0]) | |
ShapedBlock(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More details on my blog at https://wp.me/poZKh-96i