commit fd0375304e821562d0573acf9a394bc07f61fb2e Author: William Miceli Date: Mon Mar 2 22:04:01 2026 -0500 Added script diff --git a/Nametag.scad b/Nametag.scad new file mode 100644 index 0000000..401fd6e --- /dev/null +++ b/Nametag.scad @@ -0,0 +1,55 @@ +/* [Text] */ + +// Text to be written +text_content = "William Miceli"; + +base_depth = 1; +text_depth = 0.5; +size = [100, 20]; +corner_radius = 5; +border_width = 1; +text_height_as_pct_of_base_height = 0.6; +text_spacing = 0.95; + +$fn = 100; + +// Text +color("blue"){ + translate( + [size[0]/2, + size[1]*((1-text_height_as_pct_of_base_height)/2), + base_depth] + ) + linear_extrude(height=text_depth, center = false) + text( + text_content, + size[1]*text_height_as_pct_of_base_height, + "Arial:style=Regular", + halign="center", + valign="baseline", + spacing=text_spacing + ); +} + +// Border +color("blue"){ + difference(){ + translate([0,0,base_depth]) + linear_extrude(height=text_depth, center = false) + roundedRect(size, radius=corner_radius); + translate([0,0,base_depth-1]) + linear_extrude(height=text_depth+2, center = false) + offset(r=-border_width) + roundedRect(size, radius=corner_radius); + } +} + +// Base +color("white"){ + linear_extrude(height=base_depth, center = false) + roundedRect(size, radius=corner_radius); +} + +module roundedRect(size, radius) { + offset(r=radius) offset(r=-radius) square(size); +} \ No newline at end of file