Created
May 26, 2017 23:33
-
-
Save ednisley/cc5ce13a170282f9b324c3f7260c3565 to your computer and use it in GitHub Desktop.
OpenSCAD source code: Retainer for bathroom door
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
// Bathroom Door Retainer | |
// Ed Nisley KE4ZNU - May 2017 | |
Layout = "Show"; // Show Build | |
//------- | |
//- Extrusion parameters must match reality! | |
ThreadThick = 0.20; | |
ThreadWidth = 0.40; | |
HoleWindage = 0.2; | |
Protrusion = 0.1; // make holes end cleanly | |
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit); | |
//------- | |
// Dimensions | |
TowelBarSide = 20.5; // towel bar across flat side | |
TowelBarAngle = 45; // rotation of top flat from horizontal | |
DoorOffset = 16.0; // from towel bar to door | |
DoorThick = 36.5; | |
WallThick = 4.0; // minimum wall thickness | |
RetainerDepth = 10.0; // thickness of retaining notch | |
NumSides = 6*4; | |
CornerRad = WallThick; | |
BarClipOD = TowelBarSide*sqrt(2) + 2*WallThick; | |
BarClipRad = BarClipOD/2; | |
OAH = RetainerDepth + WallThick; | |
module LatchPlan() { | |
union() { | |
linear_extrude(height=OAH,convexity=4) | |
difference() { | |
union() { | |
circle(d=BarClipOD,$fn=NumSides); | |
hull() | |
for (i=[0,1], j=[0,1]) | |
translate([i*(BarClipRad + DoorOffset + DoorThick + WallThick - CornerRad),j*(BarClipRad - CornerRad)]) | |
circle(r=CornerRad,$fn=4*4); | |
} | |
rotate(TowelBarAngle) // towel bar shape | |
square(size=TowelBarSide,center=true); | |
translate([0,-TowelBarSide/sqrt(2)]) // make access slot | |
rotate(-TowelBarAngle) | |
square(size=[2*TowelBarSide,TowelBarSide],center=false); | |
} | |
translate([0,-TowelBarSide/sqrt(2),OAH/2]) | |
rotate([90,0,45]) | |
sphere(r=TowelBarSide/25,$fn=4*3); | |
} | |
} | |
module Latch() { | |
difference() { | |
LatchPlan(); | |
translate([BarClipRad + DoorOffset,-BarClipRad/2,-Protrusion]) | |
cube([DoorThick,BarClipOD,RetainerDepth + Protrusion],center=false); | |
} | |
} | |
//------- | |
// Build it! | |
if (Layout == "Show") { | |
Latch(); | |
} | |
if (Layout == "Build") { | |
translate([0,0,OAH]) | |
rotate([180,0,0]) | |
Latch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More details on my blog at http://wp.me/poZKh-6Nk