Created
August 12, 2019 23:30
-
-
Save ednisley/4165b285114eb90448497090b6357e82 to your computer and use it in GitHub Desktop.
OpenSCAD source code: CNC 3018-Pro Home switch mounts
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
// 3018-Pro Mount for Makerbot Endstop PCB | |
// Ed Nisley KE4ZNU - 2019-07 | |
/* [Build Options] */ | |
Layout = "Show"; // [Build, Show] | |
/* [Hidden] */ | |
ThreadThick = 0.25; // [0.20, 0.25] | |
ThreadWidth = 0.40; // [0.40] | |
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit); | |
Protrusion = 0.01; // [0.01, 0.1] | |
HoleWindage = 0.2; | |
ID = 0; | |
OD = 1; | |
LENGTH = 2; | |
//- Shapes | |
// Basic PCB with hole for switch pins | |
// origin at switch actuator corner, as seen looking at component side | |
SwitchClear = [15.0,5.0,2.0]; // clearance around switch pins | |
SwitchOffset = [12.5,9.0,0.0]; // center of switch pins from actuator corner | |
PCB = [26.0,16.4,2*SwitchClear.z]; // switch PCB beyond connector, pin height | |
XBlock = [PCB.x,PCB.y,5.0]; | |
module XMount() { | |
difference() { | |
cube(XBlock,center=false); | |
translate(SwitchOffset + [0,0,XBlock.z - SwitchClear.z/2]) | |
cube(SwitchClear + [0,0,Protrusion],center=true); | |
} | |
} | |
YBlock = [PCB.x + 10.0,PCB.y,20.0]; | |
module YMount() { | |
difference() { | |
translate([-10.0,0,0]) | |
cube(YBlock,center=false); | |
translate([0,-Protrusion,10.0]) | |
cube(YBlock + [0,2*Protrusion,0],center=false); | |
translate(SwitchOffset + [0,0,10.0 - SwitchClear.z/2]) | |
cube(SwitchClear + [0,0,Protrusion],center=true); | |
} | |
} | |
ZBlock = [PCB.x,PCB.y,6.0]; | |
ZPin = [20.0,10.0,5.5]; | |
module ZMount() { | |
difference() { | |
cube(ZBlock,center=false); | |
translate(SwitchOffset + [0,0,ZBlock.z - SwitchClear.z/2]) | |
cube(SwitchClear + [0,0,Protrusion],center=true); | |
} | |
translate([0,-ZBlock.y,0]) | |
difference() { | |
cube(ZPin,center=false); | |
translate([ZPin.x/2,-Protrusion,4.0]) | |
cube(ZPin + [0,2*Protrusion,0],center=false); | |
} | |
} | |
//- Build things | |
if (Layout == "Show") { | |
translate([0,YBlock.y,0]) | |
XMount(); | |
translate([0,-YBlock.y/2]) | |
YMount(); | |
translate([0,-(ZBlock.y + YBlock.y)]) | |
ZMount(); | |
} |
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-8m7