/* //Suggested usage: // // #include this file (MasterOfPuppetsFont.inc) then modify and use the following code in your scene: #declare Gap = FontRadius * 2 + .16; //Set the distance between characters #declare Space = Gap + .6; //Set the distance between words #local Alphabet = object { #local CurrentX = 0; union { object {A_ translate CurrentX * x} #local CurrentX = CurrentX + Width_A + Gap; object {B_ translate CurrentX * x} #local CurrentX = CurrentX + Width_B + Gap; object {C_ translate CurrentX * x} #local CurrentX = CurrentX + Width_C + Gap; object {D_ translate CurrentX * x} #local CurrentX = CurrentX + Width_D + Gap; object {E_ translate CurrentX * x} #local CurrentX = CurrentX + Width_E + Gap; object {F_ translate CurrentX * x} #local CurrentX = CurrentX + Width_F + Gap; object {G_ translate CurrentX * x} #local CurrentX = CurrentX + Width_G + Gap; object {H_ translate CurrentX * x} #local CurrentX = CurrentX + Width_H + Gap; object {I_ translate CurrentX * x} #local CurrentX = CurrentX + Width_I + Gap; object {J_ translate CurrentX * x} #local CurrentX = CurrentX + Width_J + Gap; object {K_ translate CurrentX * x} #local CurrentX = CurrentX + Width_K + Gap; object {L_ translate CurrentX * x} #local CurrentX = CurrentX + Width_L + Gap; object {M_ translate CurrentX * x} #local CurrentX = CurrentX + Width_M + Space; object {N_ translate CurrentX * x} #local CurrentX = CurrentX + Width_N + Gap; object {O_ translate CurrentX * x} #local CurrentX = CurrentX + Width_O + Gap; object {P_ translate CurrentX * x} #local CurrentX = CurrentX + Width_P + Gap; object {Q_ translate CurrentX * x} #local CurrentX = CurrentX + Width_Q + Gap; object {R_ translate CurrentX * x} #local CurrentX = CurrentX + Width_R + Gap; object {S_ translate CurrentX * x} #local CurrentX = CurrentX + Width_S + Gap; object {T_ translate CurrentX * x} #local CurrentX = CurrentX + Width_T + Gap; object {U_ translate CurrentX * x} #local CurrentX = CurrentX + Width_U + Gap; object {V_ translate CurrentX * x} #local CurrentX = CurrentX + Width_V + Gap; object {W_ translate CurrentX * x} #local CurrentX = CurrentX + Width_W + Gap; object {X_ translate CurrentX * x} #local CurrentX = CurrentX + Width_X + Gap; object {Y_ translate CurrentX * x} #local CurrentX = CurrentX + Width_Y + Gap; object {Z_ translate CurrentX * x} #local CurrentX = CurrentX + Width_Z + Gap; } //union texture {T_Gold_3D normal {bumps}} translate <-(CurrentX - Gap) / 2, FontRadius, 0> //Center horizontally with the base of the characters at y = 0 } //object object {Alphabet} */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #local R = .06; #local CornerRadius = R; #declare FontRadius = R; //These three variables are available to use for positioning. #declare Gap = FontRadius * 2 + .16; //Default value; re-declare in your scene as necessary. #declare Space = Gap + .6; //Default value; re-declare in your scene as necessary. #local RoundedCorner = object { union { intersection { torus {CornerRadius, R sturm rotate 90 * x} plane {y, 0} plane {x, 0} } //intersection difference { box {<-CornerRadius, -CornerRadius, -R> <0, 0, R>} cylinder {<0, 0, -R - .1> <0, 0, R + .1>, CornerRadius} } //difference } //union } //object /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #declare A_ = object { #local A1 = .03; #local A2 = .58; //Determines angle of sides #local A3 = .06; #local A4 = .13; //Width of top flat part, must be longer than A3 * 2 #declare Width_A = A2 + A4 + A2; #local Theta = atan (1 / A2); #local SideLength = sqrt (A2 * A2 + 1); #local A_L1 = SideLength - A3; #local A_L2 = SideLength - A1; #local A_L3 = .28; //Determines height of crossbar #local A_L4 = .12; //Fix, controls length of legs #local A_X1 = A_L1 * cos (Theta); #local A_Y1 = A_L1 * sin (Theta); #local A_X2 = A_L2 * cos (Theta); #local A_Y2 = A_L2 * sin (Theta); #local A_X3 = A_L3 * cos (Theta); #local A_Y3 = A_L3 * sin (Theta); #local A_X4 = A_L4 * cos (Theta); #local A_Y4 = A_L4 * sin (Theta); #local RoundedCorner_A1 = object { #local TCornerRadius = CornerRadius * .75; #local Theta2 = Theta / 2; #local A_L5 = TCornerRadius / sin (Theta2); #local A_X5 = A_L5 * cos (Theta2); #local A_Y5 = A_L5 * sin (Theta2); union { intersection { torus {TCornerRadius, R sturm rotate 90 * x} plane {x, 0} plane {x, 0 rotate (90 - degrees (Theta2)) * z} } //intersection intersection { difference { box {<-1, -1, -R> <0, 1, R>} cylinder {<0, 0, -R - .1> <0, 0, R + .1>, TCornerRadius} } //difference plane {y, -TCornerRadius inverse} plane {x, TCornerRadius rotate (90 + degrees (Theta)) * z} plane {x, 0 rotate (90 - degrees (Theta2)) * z} } //intersection } //union } //object #local RoundedCorner_A2 = object { #local Theta = -radians (180 - degrees (Theta)); #local Theta2 = Theta / 2; #local A_L6 = CornerRadius / sin (Theta2); #local A_X6 = -A_L6 * cos (Theta2); #local A_Y6 = -A_L6 * sin (Theta2); union { intersection { torus {CornerRadius, R sturm rotate 90 * x} plane {x, 0} plane {x, 0 rotate (-degrees (Theta2)) * z inverse} } //intersection intersection { difference { box {<-1, 0, -R> <0, 1, R>} cylinder {<0, 0, -R - .1> <0, 0, R + .1>, CornerRadius} } //difference plane {y, CornerRadius} plane {x, -CornerRadius rotate (90 + degrees (Theta)) * z inverse} } //intersection } //union } //object union { sphere_sweep { b_spline 14 <-A2, -1, 0>, R , R , R , R , R , R , R , R , R , R , R , R , R , R } //sphere_sweep sphere_sweep { linear_spline 2 , R , R } //sphere_sweep object {RoundedCorner_A1 translate + } object {RoundedCorner_A1 rotate 180 * y translate + <-A_X5, A_Y5, 0>} object {RoundedCorner_A2 translate + } object {RoundedCorner_A2 rotate 180 * y translate + <-A_X6, A_Y6, 0>} } //union } //object #declare B_ = object { #local B1 = .12; #local B2 = 1.08; //Top width #local B3 = .2; #local B4 = .52; //Vertical #local B5 = 1.13; //Bottom width #declare Width_B = B5; union { sphere_sweep { linear_spline 4 <.5, 0, 0>, R <0, 0, 0>, R <0, 1, 0>, R <.5, 1, 0>, R } //sphere_sweep sphere_sweep { linear_spline 2 <0, B4, 0>, R <.5, B4, 0>, R } //sphere_sweep sphere_sweep { //Top b_spline 12 <-1, 1, 0>, R <.5, 1, 0>, R , R , R , R , R , R , R , R , R <.5, B4, 0>, R <-1, B4, 0>, R } //sphere_sweep sphere_sweep { //Bottom b_spline 12 <-1, B4, 0>, R <.5, B4, 0>, R , R , R , R , R , R , R , R , R <.5, 0, 0>, R <-1, 0, 0>, R } //sphere_sweep object {RoundedCorner rotate 180 * x translate <0, 1, 0> + } object {RoundedCorner translate <0, B4, 0> + } object {RoundedCorner rotate 180 * x translate <0, B4, 0> + } object {RoundedCorner translate } } //union } //object #declare C_ = object { #local C1 = .12; #local C2 = 1.13; #local C3 = .2; #local C4 = C1 + C3 + .01; //C4 must be > C1 + C3 #declare Width_C = C2; sphere_sweep { b_spline 18 , R , R , R , R , R , R , R <0, C1, 0>, R <0, C1 + C3, 0>, R <0, 1 - C1 - C3, 0>, R <0, 1 - C1, 0>, R , R , R , R , R , R , R , R } //sphere_sweep } //object #declare D_ = object { #local D1 = .12; #local D2 = 1.13; #local D3 = .2; #declare Width_D = D2; union { sphere_sweep { linear_spline 4 <.5, 0, 0>, R <0, 0, 0>, R <0, 1, 0>, R <.5, 1, 0>, R } //sphere_sweep sphere_sweep { b_spline 12 <-1, 1, 0>, R <.5, 1, 0>, R , R , R , R , R , R , R , R , R <.5, 0, 0>, R <-1, 0, 0>, R } //sphere_sweep object {RoundedCorner rotate 180 * x translate <0, 1, 0> + } object {RoundedCorner translate } } //union } //object #declare E_ = object { #local E1 = .98; //Top and bottom bars #local E2 = .945; //Middle bar #local E3 = .52; //Vertical #declare Width_E = E1; union { sphere_sweep { linear_spline 4 , R <0, 0, 0>, R <0, 1, 0>, R , R } //sphere_sweep sphere_sweep { linear_spline 2 <0, E3, 0>, R , R } //sphere_sweep object {RoundedCorner rotate 180 * x translate <0, 1, 0> + } object {RoundedCorner translate <0, E3, 0> + } object {RoundedCorner rotate 180 * x translate <0, E3, 0> + } object {RoundedCorner translate } } //union } //object #declare F_ = object { #local F1 = .95; //Top bar #local F2 = .915; //Bottom bar #local F3 = .5; //Vertical #declare Width_F = F1; union { sphere_sweep { linear_spline 3 <0, 0, 0>, R <0, 1, 0>, R , R } //sphere_sweep sphere_sweep { linear_spline 2 <0, F3, 0>, R , R } //sphere_sweep object {RoundedCorner rotate 180 * x translate <0, 1, 0> + } object {RoundedCorner translate <0, F3, 0> + } object {RoundedCorner rotate 180 * x translate <0, F3, 0> + } } //union } //object #declare G_ = object { #local G1 = .12; #local G2 = 1.13; #local G3 = .2; #local G4 = G1 + G3 + .13; //C4 must be > G1 + C3 #local G5 = G2 / 2; #declare Width_G = G2; union { sphere_sweep { b_spline 18 , R //, R , R //Fix , R , R , R , R , R , R <0, G1, 0>, R <0, G1 + G3, 0>, R <0, 1 - G1 - G3, 0>, R <0, 1 - G1, 0>, R , R , R , R , R , R , R } //sphere_sweep sphere_sweep { linear_spline 2 , R , R } //sphere_sweep object {RoundedCorner rotate 180 * x rotate 180 * y translate + <-CornerRadius, -CornerRadius, 0>} } //union } //object #declare H_ = object { #local H1 = .95; #local H2 = .5; //Vertical #declare Width_H = H1; union { sphere_sweep { linear_spline 2 <0, 0, 0>, R <0, 1, 0>, R } //sphere_sweep sphere_sweep { linear_spline 2 , R , R } //sphere_sweep sphere_sweep { linear_spline 2 <0, H2, 0>, R , R } //sphere_sweep object {RoundedCorner translate <0, H2, 0> + } object {RoundedCorner rotate 180 * x translate <0, H2, 0> + } object {RoundedCorner rotate 180 * y translate + <-CornerRadius, CornerRadius, 0>} object {RoundedCorner rotate 180 * y rotate 180 * x translate + <-CornerRadius, -CornerRadius, 0>} } //union } //object #declare I_ = object { #declare Width_I = 0; sphere_sweep { linear_spline 2 <0, 0, 0>, R <0, 1, 0>, R } //sphere_sweep } //object #declare J_ = object { #local J1 = .15; #local J2 = .98; #local J3 = .2; #declare Width_J = J2; union { sphere_sweep { b_spline 10 , R //, R , R //Fix , R , R , R , R , R , R <0, J1, 0>, R <0, J1 + J3, 0>, R } //sphere_sweep sphere_sweep { linear_spline 2 <.5, 1, 0>, R , R } //sphere_sweep object {RoundedCorner rotate 180 * x rotate 180 * y translate + <-CornerRadius, -CornerRadius, 0>} } //union } //object #declare K_ = object { #local K1 = .5; //Vertical #local K2 = .2; //Width of horizontal bar #local K3 = .45; //Width1 #local K4 = 1; //Width2 #declare Width_K = K4; union { sphere_sweep { linear_spline 2 <0, 0, 0>, R <0, 1, 0>, R } //sphere_sweep sphere_sweep { //Bottom b_spline 5 <-1, K1, 0>, R , R , R , R , R } //sphere_sweep sphere_sweep { //Top b_spline 5 <-1, K1, 0>, R , R , R , R , R } //sphere_sweep object {RoundedCorner rotate 180 * x translate <0, K1, 0> + } object {RoundedCorner translate <0, K1, 0> + } } //union } //object #declare L_ = object { #local L1 = .98; #declare Width_L = L1; union { sphere_sweep { linear_spline 3 , R <0, 0, 0>, R <0, 1, 0>, R } //sphere_sweep object {RoundedCorner translate } } //union } //object #declare M_ = object { #local M1 = .12; #local M2 = .7; #local M3 = .02; #local M4 = M1 * .14; #declare Width_M = M1 + M2 + M3 + M2 + M1; sphere_sweep { b_spline 16 <0, -1, 0>, R <0, 0, 0>, R <0, 1 - M4, 0>, R , R , R , R , R , R , R , R , R , R , R , R , R , R } //sphere_sweep } //object #declare N_ = object { #local N1 = .12; #local N2 = 1; #local N3 = N1 * .14; #declare Width_N = N1 + N2 + N1; sphere_sweep { b_spline 12 <0, -1, 0>, R <0, 0, 0>, R <0, 1 - N3, 0>, R , R , R , R , R , R , R , R , R , R } //sphere_sweep } //object #declare O_ = object { #local O1 = .15; #local O2 = 1.3; #local O3 = .2; #declare Width_O = O2; sphere_sweep { b_spline 19 , R , R <0, O1, 0>, R <0, O1 + O3, 0>, R <0, 1 - O1 - O3, 0>, R <0, 1 - O1, 0>, R , R , R , R , R , R , R , R , R , R , R , R , R <0, O1, 0>, R } //sphere_sweep } //object #declare P_ = object { #local P1 = .12; #local P2 = 1.13; #local P3 = .2; #local P4 = .42; //Vertical #declare Width_P = P2; union { sphere_sweep { linear_spline 3 <0, 0, 0>, R <0, 1, 0>, R <.5, 1, 0>, R } //sphere_sweep sphere_sweep { linear_spline 2 <0, P4, 0>, R <.5, P4, 0>, R } //sphere_sweep sphere_sweep { b_spline 12 <-1, 1, 0>, R <.5, 1, 0>, R , R , R , R , R , R , R , R , R <.5, P4, 0>, R <-1, P4, 0>, R } //sphere_sweep object {RoundedCorner rotate 180 * x translate <0, 1, 0> + } object {RoundedCorner translate <0, P4, 0> + } object {RoundedCorner rotate 180 * x translate <0, P4, 0> + } } //union } //object #declare Q_ = object { #local O1 = .9; #local O2 = .15; #declare Width_Q = Width_O; union { object {O_} sphere_sweep { linear_spline 2 , R , R } //sphere_sweep object {RoundedCorner rotate 180 * x rotate 180 * y translate + <-CornerRadius, -CornerRadius, 0>} object {RoundedCorner rotate 180 * x translate + } object {RoundedCorner translate + } object {RoundedCorner rotate 180 * y translate + <-CornerRadius, CornerRadius, 0>} } //union } //object #declare R_ = object { #local R1 = .12; #local R2 = 1.13; //Top width #local R3 = .2; #local R4 = .42; //Vertical #local R5 = R2 + .05; //Bottom width #declare Width_R = R5; union { sphere_sweep { linear_spline 3 <0, 0, 0>, R <0, 1, 0>, R <.5, 1, 0>, R } //sphere_sweep sphere_sweep { linear_spline 2 <0, R4, 0>, R <.5, R4, 0>, R } //sphere_sweep sphere_sweep { //Top b_spline 12 <-1, 1, 0>, R <.5, 1, 0>, R , R , R , R , R , R , R , R , R <.5, R4, 0>, R <-1, R4, 0>, R } //sphere_sweep sphere_sweep { //Bottom b_spline 8 <-1, R4, 0>, R <.5, R4, 0>, R , R , R , R , R , R , R } //sphere_sweep object {RoundedCorner rotate 180 * x translate <0, 1, 0> + } object {RoundedCorner translate <0, R4, 0> + } object {RoundedCorner rotate 180 * x translate <0, R4, 0> + } } //union } //object #declare S_ = object { #local S1 = .12; #local S2 = 1.14; #local S3 = .2; #local S4 = .5; //Vertical #local S5 = .15; //Must be longer than S1 + S3 #local S6 = .22; //Length of ends #declare Width_S = S2; union { difference { sphere_sweep { b_spline 28 <0, 1, 0>, R <0, S5, 0>, R <0, S1 + S3, 0>, R <0, S1, 0>, R , R , R , R , R , R , R , R , R , R , R , R , R <0, S4 + S1, 0>, R <0, S4 + S1 + S3, 0>, R <0, 1 - S1 - S3, 0>, R <0, 1 - S1, 0>, R , R , R , R , R , R , R , R , R } //sphere_sweep box {<-1, S6, -1> <.15, S5 + .25, 1>} box { } } //difference intersection { sphere {<0, 0, 0>, R} plane {y, 0 inverse} rotate 0 * z translate <.002, S6, 0> } //intersection intersection { sphere {<0, 0, 0>, R} plane {y, 0} rotate -1 * z translate } //intersection } //union } //object #declare T_ = object { #local T1 = 1.16; //Top bar #declare Width_T = T1; union { sphere_sweep { linear_spline 2 , R , R } //sphere_sweep sphere_sweep { linear_spline 2 <0, 1, 0>, R , R } //sphere_sweep object {RoundedCorner rotate 180 * x rotate 180 * y translate + <-CornerRadius, -CornerRadius, 0>} object {RoundedCorner rotate 180 * x translate + } } //union } //object #declare U_ = object { #local U1 = .15; #local U2 = 1.19; #local U3 = .2; #declare Width_U = U2; sphere_sweep { b_spline 12 , R , R , R , R , R , R , R , R <0, U1, 0>, R <0, U1 + U3, 0>, R <0, 1, 0>, R <0, 1.65, 0>, R } //sphere_sweep } //object #declare V_ = object { #local V1 = .565; //Determines angle of sides #local V2 = .983; //Vertical #local V3 = .14; //Width of bottom flat part #local V4 = .9; #declare Width_V = V1 + V3 + V1; sphere_sweep { b_spline 8 <-V1, V2, 0>, R <0, 0, 0>, R , R , R , R , R , R , R } //sphere_sweep translate V2 * y } //object #declare W_ = object { #local W1 = .12; #local W2 = .7; #local W3 = .02; #local W4 = W1 * .14; #local W5 = .36; #declare Width_W = W1 + W2 + W3 + W2 + W1; sphere_sweep { b_spline 16 <0, -1, 0>, R <0, 0, 0>, R <0, 1 - W4, 0>, R , R , R , R , R , R , R , R , R , R , R , R , R , R } //sphere_sweep rotate 180 * z translate } //object #declare X_ = object { #local X1 = sqrt (2); #declare Width_X = 1; union { #local Bar = object { sphere_sweep { linear_spline 2 <0, -X1 / 2, 0>, R <0, X1 / 2, 0>, R } //sphere_sweep } //object object {Bar} object {Bar rotate 90 * z} object {RoundedCorner rotate 180 * x rotate 180 * y translate <-CornerRadius, -CornerRadius, 0>} object {RoundedCorner rotate 180 * x translate } object {RoundedCorner translate } object {RoundedCorner rotate 180 * y translate <-CornerRadius, CornerRadius, 0>} } //union rotate 45 * z translate <.5, .5, 0> } //object #declare Y_ = object { #local Y1 = .45; //Determines angle of sides #local Y2 = .491; //Vertical #local Y3 = .2; //Width of bottom flat part #local Y4 = .9; #local Y5 = .5; //Height of stem #declare Width_Y = Y1 + Y3 + Y1; union { sphere_sweep { b_spline 8 <-Y1, Y2, 0>, R <0, 0, 0>, R , R , R , R , R , R , R translate (Y2 + Y5) * y } //sphere_sweep sphere_sweep { linear_spline 2 , R , R } //sphere_sweep object {RoundedCorner rotate 180 * x rotate 180 * y translate + <-CornerRadius, -CornerRadius, 0>} object {RoundedCorner rotate 180 * x translate + } } //union } //object #declare Z_ = object { #local N1 = .12; #local N2 = .7; #local N3 = N1 * .14; #local N4 = N1 + N2 + N1; #local Z1 = .12; #local Z2 = .7; #local Z3 = Z1 * .14; #local Z4 = 1.05; //Total width #local Z5 = .94; #declare Width_Z = Z4; sphere_sweep { b_spline 12 <-1, 1, 0>, R <0, 1, 0>, R , R , R , R , R <.05, Z5 - Z1 - Z2 * .95, 0>, R <0, Z5 - Z1 - Z2 - Z3, 0>, R <0, Z3, 0>, R , R , R , R } //sphere_sweep } //object