Skip to content

Instantly share code, notes, and snippets.

@ednisley
Last active January 10, 2016 19:16
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/8701701af71832650842 to your computer and use it in GitHub Desktop.
Save ednisley/8701701af71832650842 to your computer and use it in GitHub Desktop.
OpenSCAD Source Code: Blue Gauntlet Fencing Helmet Ear Grommet
// Fencing Helmet Ear Grommet
// Ed Nisley KE4ZNU December 2015
// Layout options
Layout = "Show"; // Base Cap Build Show
//- Extrusion parameters must match reality!
// Print with +1 shells and 3 solid layers
ThreadThick = 0.20;
ThreadWidth = 0.40;
HoleWindage = 0.2;
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
Protrusion = 0.1; // make holes end cleanly
//----------------------
// Dimensions
NumSides = 12*4;
$fn = NumSides;
//----------------------
// 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(r=(FixDia + HoleWindage)/2,
h=Height,
$fn=Sides);
}
//-------------------
// Parts
// Base on outside of liner
PostOD = 15.5;
PostLength = 8.0;
BaseOD = 26.0;
BaseLength = 3.4;
module Base() {
difference() {
union() {
cylinder(d=BaseOD,h=2.0);
cylinder(d=20.0,h=BaseLength);
for (i=[0:5])
rotate(i*360/6)
translate([11.5,0,0])
rotate(180/6)
cylinder(d1=2.5,d2=3*ThreadWidth,h=4.0,$fn=6);
}
translate([0,0,-Protrusion])
// PolyCyl(PostOD,4.0,NumSides/4);
cylinder(d=PostOD,h=PostLength,$fn=NumSides/4);
translate([0,0,(BaseLength - 4*ThreadThick)])
cylinder(d1=PostOD,d2=(PostOD + 2*ThreadWidth),h=(4*ThreadThick + Protrusion),$fn=NumSides/4);
}
}
// Cap inside liner
CapID = 12.0;
CapOD = 28.0;
CapThick = 3.0;
module Cap() {
difference() {
union() {
rotate_extrude(convexity=2)
polygon(points=[
[CapID/2 + CapThick/3,0.0],
[CapOD/2 - CapThick/3,0.0],
[CapOD/2,CapThick/2],
[CapOD/2,CapThick],
[CapID/2,CapThick],
[CapID/2,CapThick - CapThick/3]
]);
translate([0,0,CapThick - Protrusion])
cylinder(d=PostOD,h=(PostLength - (CapThick - Protrusion)),$fn=NumSides/4);
}
translate([0,0,-Protrusion])
PolyCyl(CapID,10.0,$fn);
}
}
//----------------------
// Build it!
if (Layout == "Base")
Base();
if (Layout == "Cap")
Cap();
BuildSpace = 30/2;
if (Layout == "Build") {
for (j=[-1,1])
translate([j*BuildSpace,0,0]) {
translate([0,-BuildSpace,0])
Base();
translate([0,BuildSpace,0])
Cap();
}
}
if (Layout == "Show") {
color("LightGreen") Base();
translate([0,0,12])
rotate([180,0,0])
color("LightBlue") Cap();
}
@ednisley
Copy link
Author

More detail on my blog at http://wp.me/poZKh-5ux

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