diff --git a/labeler.scad b/labeler.scad index 4a708ad..1b47aec 100644 --- a/labeler.scad +++ b/labeler.scad @@ -1,16 +1,20 @@ use -content="10kΩ 0603"; -fnt="Arial"; -height=3.5; - -abs=0; // 1 if printing ABS...adds anti-warp pads $fn=45; -l=measureText(content, font=fnt, size=height)+2; +label("10kΩ 0603", "Arial", 5, .75); -translate([0.5,2,.4]) -linear_extrude(.6, convexity=10) - text(content, size=height, font=fnt); +translate([0,10,0]) +label("10", "Arial:style=Bold", 5, 1); -cube([l, 8, 0.4]); +module label(t, f, h, xc) +{ + l=measureText(t, font=f, size=h)+2; + + scale([xc, 1, 1]) + translate([0.5,2,.4]) + linear_extrude(.6, convexity=10) + text(t, size=h, font=f); + + cube([l*xc, 8, 0.4]); +}