Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenSCAD Source Code: Pencil guide for ruler quilting design
// Quilting Ruler Adapters
// Ed Nisley KE4ZNU October 2016
//- Extrusion parameters must match reality!
ThreadThick = 0.25;
ThreadWidth = 0.40;
HoleWindage = 0.2;
Protrusion = 0.1; // make holes end cleanly
inch = 25.4;
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
//----------
// Dimensions
ID = 0;
OD = 1;
LENGTH = 2;
Offset = 0.25 * inch;
Template = [2.0,2*Offset,3.0];
NumSides = 16*4;
HoleSides = 8;
//----------------------
// 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(d=(FixDia + HoleWindage),h=Height,$fn=Sides);
}
//----------
// Build it
difference() {
cylinder(d=Template[OD],h=Template[LENGTH],$fn=NumSides);
translate([0,0,-Template[LENGTH]])
PolyCyl(Template[ID],3*Template[LENGTH],HoleSides);
translate([0,0,-Protrusion])
cylinder(d1=2*Template[ID],d2=Template[ID],h=Template[LENGTH]/3 + Protrusion,$fn=HoleSides);
translate([0,0,Template[LENGTH] + Protrusion])
mirror([0,0,1])
cylinder(d1=2*Template[ID],d2=Template[ID],h=Template[LENGTH]/3 + Protrusion,$fn=HoleSides);
}
@ednisley

This comment has been minimized.

Copy link
Owner Author

@ednisley ednisley commented Oct 2, 2016

More details on my blog at http://wp.me/poZKh-6dI

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