Skip to content

Instantly share code, notes, and snippets.

@Dracks
Created June 22, 2021 19:41
Show Gist options
  • Save Dracks/ac80b3bc099293ab330325a98ce3b339 to your computer and use it in GitHub Desktop.
Save Dracks/ac80b3bc099293ab330325a98ce3b339 to your computer and use it in GitHub Desktop.
Customizable napkin ring
Width = 25; // Int
Height = 20; // Int
Depth = 50;
Name = "Name"; // String
Font = ".SF NS Text Condensed:style=Regular"; // String
FontSize = 8; // Font size
module base(width, height) {
half_width=width/2;
half_height = height/2;
translate([-half_height, 0])
circle(d=width, $fn=50);
translate([-half_height, -half_width])
square([height, width]);
translate([half_height, 0])
circle(d=width, $fn=50);
}
module gen_text() {
translate([0, -Width/2+3, Height/2])
rotate([90,0,0])
linear_extrude(height=6, convexity=4)
text( Name, size= 5, font=Font, halign="center", valign="center");
}
module simple(width, depth, height){
linear_extrude(height)
difference(){
base(width, depth);
offset(delta=-1.5, chamfer=true)
base(width, depth);
};
}
difference(){
simple(Width, Depth-Width, Height);
gen_text();
}
simple(Width-1, Depth-1-Width, Height);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment