Skip to content

Instantly share code, notes, and snippets.

@ednisley
Created July 18, 2018 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ednisley/8af6420b38c578a69db1274bb3c0a339 to your computer and use it in GitHub Desktop.
Save ednisley/8af6420b38c578a69db1274bb3c0a339 to your computer and use it in GitHub Desktop.
OpenSCAD source code: Garden soaker hose splice block
// Rubber Soaker Hose Splice
// Ed Nisley KE4ZNU July 2018
Layout = "Build"; // Hose Block Show Build
TestFit = false; // true to build test fit slice from center
//- Extrusion parameters must match reality!
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
Hose = [200,27.0,12.0]; // X = longer than anything else
Block = [80.0,50.0,4.0 + Hose.z]; // overall splice block size
echo(str("Block: ",Block));
Kerf = 0.1; // 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;
NumScrews = 3; // screws along each side of cable
ScrewOC = [(Block.x - 2*CornerRadius) / (NumScrews - 1),
Block.y - 2*CornerRadius,
2*Block.z // ensure complete holes
];
echo(str("Screw OC: x=",ScrewOC.x," y=",ScrewOC.y));
//----------------------
// 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
// This includes magic numbers measured from reality
module HoseProfile() {
RimThick = 10.0; // outer sections
RimOD = RimThick;
RimFlatRecess = -0.7; // recess to front flat surface
OuterOC = Hose.y - RimOD; // outer tube centers
RecessM = 1.5; // back recess chord
RecessC = OuterOC;
RecessR = (pow(RecessM,2) + pow(RecessC,2)/4) / (2*RecessM);
RidgeM = 1.0; // front ridge chord
RidgeC = 8.0;
RidgeR = (pow(RidgeM,2) + pow(RidgeC,2)/4) / (2*RidgeM);
NumSides = 12*4;
rotate([0,-90,0])
translate([0,0,-Hose.x/2])
linear_extrude(height=Hose.x,convexity=4)
difference() {
union() {
for (j=[-1,1]) // outer channels
translate([0,j*OuterOC/2])
circle(d=RimOD,$fn=NumSides);
translate([-RimOD/4,0]) // rear flat fill
square([RimOD/2,OuterOC],center=true);
translate([(RimOD/4 + RimFlatRecess),0]) // front flat fill
square([RimOD/2,OuterOC],center=true);
intersection() {
translate([Hose.z/2,0])
square([Hose.z,OuterOC],center=true);
translate([-RidgeR + RimOD/2 + RimFlatRecess + RidgeM,0])
circle(r=RidgeR,$fn=NumSides);
}
}
translate([-(RecessR + RimOD/2 - RecessM),0])
circle(r=RecessR,$fn=2*NumSides);
}
}
// 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*(Block.x/2 - CornerRadius),j*(Block.y/2 - CornerRadius),-Block.z/2])
cylinder(r=CornerRadius,h=Block.z,$fn=4*8);
for (i = [0:NumScrews - 1], j=[-1,1]) // screw holes
translate([-(Block.x/2 - CornerRadius) + i*ScrewOC.x,
j*ScrewOC.y/2,
-(Block.z/2 + Protrusion)])
PolyCyl(Screw[ID],Block.z + 2*Protrusion,6);
cube([2*Block.x,2*Block.y,Kerf],center=true); // slice through center
}
}
// Splice block less hose
module ShapedBlock() {
difference() {
SpliceBlock();
HoseProfile();
}
}
//----------
// Build them
if (Layout == "Hose")
HoseProfile();
if (Layout == "Block")
SpliceBlock();
if (Layout == "Bottom")
BottomPlate();
if (Layout == "Top")
TopPlate();
if (Layout == "Show") {
difference() {
SpliceBlock();
HoseProfile();
}
color("Green",0.25)
HoseProfile();
}
if (Layout == "Build") {
SliceOffset = TestFit && !NumScrews%2 ? ScrewOC.x/2 : 0;
intersection() {
translate([SliceOffset,0,Block.z/4])
if (TestFit)
cube([ScrewOC.x/2,4*Block.y,Block.z/2],center=true);
else
cube([4*Block.x,4*Block.y,Block.z/2],center=true);
union() {
translate([0,0.6*Block.y,Block.z/2])
ShapedBlock();
translate([0,-0.6*Block.y,Block.z/2])
rotate([0,180,0])
ShapedBlock();
}
}
}
@ednisley
Copy link
Author

More details on my blog at https://wp.me/poZKh-7Ca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment