55 lines
1.3 KiB
OpenSCAD
55 lines
1.3 KiB
OpenSCAD
/* [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);
|
|
} |