Last active
August 3, 2020 22:38
-
-
Save ednisley/f06565f8f902b2f0a3dabd0f0b46feed to your computer and use it in GitHub Desktop.
OpenSCAD source code: Repleacement pegs for Shuttles game
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
// Shuttles game pegs | |
// Ed Nisley KE4ZNU - July 2020 | |
/* [Layout Options] */ | |
Layout = "Peg"; // [Build, Peg] | |
Hollow = false; | |
//------- | |
//- Extrusion parameters must match reality! | |
/* [Hidden] */ | |
ThreadThick = 0.25; | |
ThreadWidth = 0.40; | |
HoleWindage = 0.2; | |
Protrusion = 0.1; // make holes end cleanly | |
ID = 0; | |
OD = 1; | |
LENGTH = 2; | |
//------- | |
// Dimensions | |
/* [Dimensions] */ | |
Peg = [4.0,7.5,26.0]; // overall length, including the rounded Cap | |
Taper = 1.0; | |
CapRadius = Peg[OD]/2; | |
PegBaseLength = Peg[LENGTH] - CapRadius; | |
NumPegs = [1,6]; // lay out in array | |
ArrayCenter = [NumPegs[0] - 1,NumPegs[1] - 1] / 2; | |
NumSides = 6*4; | |
//------- | |
module PolyCyl(Dia,Height,ForceSides=0) { // based on nophead's polyholes | |
Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2); | |
FixDia = Dia / cos(180/Sides); | |
cylinder(r=FixDia/2 + HoleWindage,h=Height,$fn=Sides); | |
} | |
//------- | |
// One peg | |
module Peg() { | |
union() { | |
translate([0,0,PegBaseLength]) | |
difference() { | |
sphere(d=Peg[OD],$fn=NumSides); | |
translate([0,0,-Peg[OD]/2]) | |
cube([2*Peg[OD],2*Peg[OD],Peg[OD]],center=true); | |
} | |
difference() { | |
cylinder(d1=Peg[OD] - Taper,d2=Peg[OD],h=PegBaseLength,$fn=NumSides); | |
if (Hollow) | |
translate([0,0,-Protrusion]) | |
PolyCyl(Peg[ID],PegBaseLength+Protrusion,NumSides); | |
} | |
} | |
} | |
//------- | |
// Build it! | |
if (Layout == "Peg") | |
Peg(); | |
if (Layout == "Build") | |
for (i=[0:NumPegs[0] - 1], j=[0:NumPegs[1] - 1]) | |
translate([(i - ArrayCenter.x)*1.5*Peg[OD],(j - ArrayCenter.y)*1.5*Peg[OD],0]) | |
Peg(); |
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-9gC and https://wp.me/poZKh-9io