Last active
September 7, 2016 19:28
-
-
Save ednisley/a170d95f08b887c2ab1f53928d4df265 to your computer and use it in GitHub Desktop.
OpenSCAD source code: Miniblind bottom rail endcap and cord pull cap
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
// Cap for miniblind cord and bottom rail endcaps | |
// Ed Nisley KE4ZNU - September 2016 | |
Layout = "BaseEndCap"; // CordCap BaseEndCap | |
//- Extrusion parameters - must match reality! | |
ThreadThick = 0.25; | |
ThreadWidth = 0.40; | |
Protrusion = 0.1; | |
HoleWindage = 0.2; | |
//------ | |
// Dimensions | |
OD1 = 0; | |
OD2 = 1; | |
LENGTH = 2; | |
//---------------------- | |
//- Build it | |
if (Layout == "CordCap") { | |
Cap = [9.0,16.0,25.0]; | |
Cord = [2.5,7.0,Cap[LENGTH] - 5]; | |
NumSides = 8; | |
difference() { | |
hull() { // overall shape | |
translate([0,0,Cap[LENGTH] - Cap[OD1]/2]) | |
sphere(d=Cap[OD1],$fn=NumSides); | |
translate([0,0,0.5*Cap[OD2]/2]) | |
sphere(d=Cap[OD2],$fn=2*NumSides); // round the bottom just a bit | |
} | |
translate([0,0,-Cap[LENGTH]/2]) // trim bottom | |
cube([2*Cap[OD2],2*Cap[OD2],Cap[LENGTH]],center=true); | |
translate([0,0,Cap[LENGTH] + 0.8*Cap[OD1]]) // trim top (arbitrarily) | |
cube([2*Cap[OD1],2*Cap[OD1],2*Cap[OD1]],center=true); | |
translate([0,0,-Protrusion]) | |
cylinder(d=Cord[OD1],h=(Cap[LENGTH] + 2*Protrusion),$fn=NumSides); | |
translate([0,0,-Protrusion]) | |
cylinder(d1=Cord[OD2],d2=Cord[OD1],h=(Cord[LENGTH] + Protrusion),$fn=NumSides); | |
} | |
} | |
if (Layout == "BaseEndCap") { | |
Base = [25.2,9.0,12.2]; // base outside dimensions | |
Edge = 8.0; // size of sqare ends | |
CornerRadius = 0.75; | |
Wall = 3; // wall thickness in threads | |
ChordHeight = (Base[1] - Edge) / 2; | |
ChordRadius = (pow(ChordHeight,2) + pow(Base[0],2)/4) / (2*ChordHeight); | |
NumSides = 4*4; | |
echo(str("Chord height: ",ChordHeight," radius: ",ChordRadius)); | |
difference() { | |
linear_extrude(height=Base[2],convexity=2) { | |
hull() { | |
for (i=[-1,1], j=[-1,1]) | |
translate([i*(Base[0]/2 - CornerRadius + Wall*ThreadWidth),j*(Base[1]/2 - CornerRadius + Wall*ThreadWidth)]) | |
circle(r=CornerRadius,$fn=4*4,center=true); | |
for (j=[-1,1]) | |
translate([0,j*(ChordHeight + Base[1]/2 - CornerRadius + Wall*ThreadWidth)]) | |
rotate(180/(2*4)) | |
circle(r=CornerRadius,$fn=2*4,center=true); | |
} | |
} | |
translate([0,0,3*ThreadThick]) | |
linear_extrude(height=Base[2],convexity=2) | |
intersection() { | |
intersection_for (j=[-1,1]) | |
translate([0,j*(ChordHeight + Base[1]/2 - ChordRadius)]) | |
circle(r=ChordRadius,$fn=32*4,center=true); | |
square([Base[0],2*Base[1]],center=true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More detail on my blog at http://wp.me/poZKh-6aL