Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenSCAD source code: Convert SVG mask outlines to printable cutting templates
// Fu Mask cutting templates
// Ed Nisley - KE4ZNU - 2020-03
// Mask patterns from:
// https://freesewing.org/blog/facemask-frenzy/
// More info on my blog:
// https://softsolder.com/2020/03/29/fu-mask-cutting-templates/
/* [Mask Size] */
Name = "Small"; // [Small, Medium, Large, Test]
/* [Hidden] */
Templates = [ // center ID letter and file name
["S","Small"],
["M","Medium"],
["L","Large"],
["T","Test"], // for whatever you like
];
T_ID = 0; // Template indexes
T_NAME = 1;
BarThick = 4.0; // template thickness
HubOD = 20.0; // center button diameter
// These should match slicer values
ThreadThick = 0.25;
ThreadWidth = 0.40;
Protrusion = 0.1; // make clean holes
//--- Build it
t = Templates[search([Name],Templates,1,1)[0]]; // find template index
Dir = "./";
FnOuter = str(Dir,"Fu Facemask - ",t[T_NAME]," - seam allowance.svg");
FnInner = str(Dir,"Fu Facemask - ",t[T_NAME]," - nominal.svg");
difference() {
linear_extrude(BarThick,convexity=5) {
intersection() {
import(FnOuter,center=true);
union() {
square([200.0,5.0],center=true); // horizontal bar
square([5.0,200.0],center=true); // vertical bar
}
}
circle(d=HubOD); // central button
difference() { // cutting template!
import(FnOuter,center=true);
import(FnInner,center=true);
}
}
translate([0,0,BarThick - ThreadThick]) // top ID recess
cylinder(d=HubOD - 6*ThreadWidth,h=ThreadThick + Protrusion);
translate([0,0,-Protrusion]) // bottom ID recess
cylinder(d=HubOD - 6*ThreadWidth,h=ThreadThick + Protrusion);
}
translate([0,0,2*BarThick/3]) // top ID
linear_extrude(height=BarThick/3,convexity=2)
text(text=t[T_ID],size=10,
font="Arial:style:Bold",halign="center",valign="center");
mirror([1,0,0]) // bottom ID
linear_extrude(height=BarThick/3,convexity=2)
text(text=t[T_ID],size=10,
font="Arial:style:Bold",halign="center",valign="center");
@ednisley

This comment has been minimized.

Copy link
Owner Author

@ednisley ednisley commented Mar 28, 2020

More details on my blog at https://wp.me/poZKh-8UD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.