// Last edited on 2010-04-01 19:22:29 by stolfi // "ENGL" label // Requires // // button_label_font_scale = scaling factor for font. // button_dugout_depth = how deep to dig // // Defines // // button_dugout = the holes to dig into the button's face // button_relief = the relief to add on the button's face // button_overlay = extra objects to paste on the button's face // // button_label_HX = max abs X extent of button_relief and button_overlay // button_label_HY = max abs Y extent of button_relief and button_overlay // button_label_HZ = max abs Z extent of button_relief and button_overlay // // Declares empty relief/dugout #declare stemR = 0.08; // Radius of strokes #declare pointR = stemR; // Radius of dots. #include "fonts/sausage-0060-0100/ALL.inc" #declare button_relief = object{ empty } #declare button_overlay = object{ empty } // Letter widths and spacing (in font units) #declare S0 = 0.1 #declare W1 = widthUCaseE #declare S1 = 0 #declare W2 = widthUCaseN #declare S2 = 0.1 #declare W3 = widthUCaseG #declare S3 = 0 #declare W4 = widthUCaseL #declare S5 = 0.1 #declare tot_letter_width = W1 + W2 + W3 + W4 #declare tot_space_width = S0 + S1 + S2 + S3 + S5 #declare label_width = tot_letter_width + tot_space_width #declare label_height = heightUCaseN #declare label_depth = 0 // Letter positions #declare X1 = 00 + S0 #declare X2 = X1 + W1 + S1 #declare X3 = X2 + W2 + S2 #declare X4 = X3 + W3 + S3 #declare button_dugout_HX = button_label_font_scale * label_width/2 #declare button_dugout_shift_X = - button_dugout_HX #declare button_dugout_shift_Z = ceil(- button_label_font_scale * (label_height - label_depth)/2) - 0.5 #declare button_dugout_HZ = max( abs(- button_label_font_scale * label_depth + button_dugout_shift_Z), abs(+ button_label_font_scale * label_height + button_dugout_shift_Z) ) #render concat("button_dugout_shift_Z = ", str(button_dugout_shift_Z,7,3), "\n") #render concat("button_dugout_HZ = ", str(button_dugout_HZ,7,3), "\n") #declare button_dugout_scale_Y = button_dugout_depth/(button_label_font_scale*stemR) #declare button_dugout = union{ object{ glyphUCaseE translate < X1, 0, 0 > } object{ glyphUCaseN translate < X2, 0, 0 > } object{ glyphUCaseG translate < X3, 0, 0 > } object{ glyphUCaseL translate < X4, 0, 0 > } texture{ pigment{ color rgb < 0.8, 1.0, 0.6 > } finish{ diffuse 0 ambient 1 } } bounded_by{ box{ < - 0.0001, - stemR - 0.0001, - label_depth - 0.0001 > < label_width + 0.0001, + stemR + 0.0001, + label_height + 0.0001 > } } scale < button_label_font_scale, button_dugout_scale_Y, button_label_font_scale > translate < button_dugout_shift_X, 0, button_dugout_shift_Z > no_shadow } #declare button_label_HX = 0 #declare button_label_HY = 0 #declare button_label_HZ = 0