Created
August 30, 2018 10:14
-
-
Save erikaheidi/3464abfd324b0d302683cebdd4c6726d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
font = "Ubuntu Mono"; | |
letter_size = 60; | |
padding = 20; | |
string = "@erikaheidi"; | |
textlen = len(string); | |
box_width = letter_size*textlen*0.8; | |
box_height = letter_size + (2*padding); | |
box_thickness = 20; | |
start_x = 0 - (box_width / 2) + padding; | |
start_z = padding; | |
module text3d(string) { | |
linear_extrude(height = box_thickness - 10) { | |
text(string, size = letter_size, font = font, halign = "center", valign = "center", $fn = 64); | |
} | |
} | |
module tag(width, height, thickness) { | |
spacing = 20; | |
difference() { | |
//tag body | |
linear_extrude(thickness) { | |
square([width, height], center = true); | |
} | |
//tag hole for lanyard | |
linear_extrude(thickness) { | |
hole_x = 0 - width / 2 + spacing; | |
hole_y = 0 - height / 2 + spacing; | |
translate([hole_x, hole_y, 0]) square([15, height-spacing*2]); | |
} | |
} | |
} | |
difference() { | |
tag(box_width, box_height, box_thickness); | |
translate([0+padding, 0, start_z]) text3d(string); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment