/* //Suggested usage: #declare MOP_Gap = .16; //Set the distance between characters (optional) #declare MOP_Space = .7; //Set the distance between words (optional) #declare MOP_FontRadius = .06; //Set the radius of the strokes (optional) #include "MasterOfPuppetsFont.inc" CreateMOP_TextObject ("Your text goes here.", MOP_Gap, MOP_Space, MOP_FontRadius) object {MOP_TextObject texture {YourTextureHere} translate <-MOP_TextObjectWidth / 2, 0, 0>} //The macro will set the variable [MOP_TextObjectWidth] and the object will extend from x = 0 to x = [MOP_TextObjectWidth]. //In the example above the object will be centered horizontally with the base of the characters at y = 0. The characters //will be 1.12 (1 + MOP_FontRadius * 2) units tall. Note that a variable called [MOP_TextObjectHeight] will be set for you. //In the event that you need to apply kerning and/or different textures to the individual characters in your string, you //can use the following method instead of the CreateMOP_TextObject () macro: #declare MOP_TextObject = object { #local CurrentX = 0; union { object {MOP_Character [D_] texture {D_Color} translate CurrentX * x} #local CurrentX = CurrentX + MOP_CharacterWidth [D_] + MOP_FontRadius * 2 + MOP_Gap - .073; object {MOP_Character [A_] texture {A_Color} translate CurrentX * x} #local CurrentX = CurrentX + MOP_CharacterWidth [A_] + MOP_FontRadius * 2 + MOP_Gap - .543; object {MOP_Character [V_] texture {V_Color} translate CurrentX * x} #local CurrentX = CurrentX + MOP_CharacterWidth [V_] + MOP_FontRadius * 2 + MOP_Gap; object {MOP_Character [E_] texture {E_Color} translate CurrentX * x} #local CurrentX = CurrentX + MOP_CharacterWidth [E_] + MOP_FontRadius * 2 + MOP_Space; object {MOP_Character [B_] texture {B_Color} translate CurrentX * x} #local CurrentX = CurrentX + MOP_CharacterWidth [B_] + MOP_FontRadius * 2 + MOP_Gap; object {MOP_Character [PERIOD_] texture {PERIOD_Color} translate CurrentX * x} #local CurrentX = CurrentX + MOP_CharacterWidth [PERIOD_] + MOP_FontRadius * 2 + MOP_Gap; } //union translate //The lower left corner/back of the text object will be at the origin. #declare MOP_TextObjectWidth = CurrentX - MOP_Gap; } //object object {MOP_TextObject translate <-MOP_TextObjectWidth / 2, 0, 0>} //Note that only capital letters, [SPACE], and [PERIOD] are defined. */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #macro CreateMOP_Characters (MOP_FontRadius) #if (MOP_FontRadius > .1) #warning "\n* * * MOP_FontRadius should not be > .1. The \"S\" will fail. * * *\n" #end //#if #local R = MOP_FontRadius; #local CornerRadius = R; #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 MOP_Character [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 MOP_CharacterWidth [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 = .145; //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 MOP_Character [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 MOP_CharacterWidth [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 MOP_Character [C_] = object { #local C1 = .12; #local C2 = 1.13; #local C3 = .2; #local C4 = C1 + C3 + .01; //C4 must be > C1 + C3 #declare MOP_CharacterWidth [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 MOP_Character [C_] = object { #local C1 = .12; #local C2 = 1.13; #local C3 = .2; #local C4 = .5; //Vertical #local C5 = .15; //Must be longer than C1 + C3 #local C6 = .22; //Length of ends #declare MOP_CharacterWidth [C_] = C2; union { difference { sphere_sweep { b_spline 20 , R , 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 , R } //sphere_sweep box { } } //difference intersection { //Bottom sphere {<0, 0, 0>, R} plane {y, 0 inverse} translate } //intersection intersection { //Top sphere {<0, 0, 0>, R} plane {y, 0} translate } //interCection } //union } //object #declare MOP_Character [D_] = object { #local D1 = .12; #local D2 = 1.13; #local D3 = .2; #declare MOP_CharacterWidth [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 MOP_Character [E_] = object { #local E1 = .98; //Top and bottom bars #local E2 = .945; //Middle bar #local E3 = .52; //Vertical #declare MOP_CharacterWidth [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 MOP_Character [F_] = object { #local F1 = .95; //Top bar #local F2 = .915; //Bottom bar #local F3 = .5; //Vertical #declare MOP_CharacterWidth [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 MOP_Character [G_] = object { #local G1 = .12; #local G2 = 1.13; #local G3 = .2; #local G4 = G1 + G3 + .13; //G4 must be > G1 + G3 #local G5 = G2 / 2; #declare MOP_CharacterWidth [G_] = G2; union { sphere_sweep { b_spline 18 , R , R , 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 MOP_Character [H_] = object { #local H1 = .95; #local H2 = .5; //Vertical #declare MOP_CharacterWidth [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 MOP_Character [I_] = object { #declare MOP_CharacterWidth [I_] = 0; sphere_sweep { linear_spline 2 <0, 0, 0>, R <0, 1, 0>, R } //sphere_sweep } //object #declare MOP_Character [J_] = object { #local J1 = .15; #local J2 = .98; #local J3 = .2; #declare MOP_CharacterWidth [J_] = J2; union { sphere_sweep { b_spline 10 , R , R , 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 MOP_Character [K_] = object { #local K1 = .5; //Vertical #local K2 = .43; //Width of horizontal bar #local K3 = .2; //Width1 #local K4 = .5; //Width2 #declare MOP_CharacterWidth [K_] = K2 + K3 + K4; union { sphere_sweep { linear_spline 2 <0, 0, 0>, R <0, 1, 0>, R } //sphere_sweep sphere_sweep { //Bottom b_spline 5 <-2.25, K1, 0>, R , R , R , R , R } //sphere_sweep sphere_sweep { //Top b_spline 5 <-2.25, 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 MOP_Character [L_] = object { #local L1 = .98; #declare MOP_CharacterWidth [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 MOP_Character [M_] = object { #local M1 = .04 + R; #local M_A0 = 35; union { #local MCorner = object { #local MCornerRadius = R * 1.75; intersection { torus {MCornerRadius, R sturm rotate 90 * x} plane {x, 0 inverse} plane {y, 0 inverse rotate M_A0 * z} } //intersection } //object #local M_P0 = ; #local M2 = M_P0.y / sin (radians (90 - M_A0)) * sin (radians (M_A0)); #local M_P1 = ; #local M_L0 = sqrt (M2 * M2 + M_P0.y * M_P0.y); sphere {<0, 0, 0>, R} //Left side sphere {<0, 1, 0>, R} cylinder {<0, 0, 0> <0, 1, 0>, R} cylinder {<0, 1, 0> , R} sphere {, R} //Right side sphere {, R} cylinder { , R} cylinder { , R} sphere {, R} //Center cylinder {<0, 0, 0> , R rotate (-90 + M_A0) * z translate M_P0} cylinder {<0, 0, 0> , R rotate (270 - M_A0) * z translate M_P1} object {MCorner translate } object {MCorner rotate 180 * y translate } object {RoundedCorner rotate 180 * x translate <0, 1, 0> + } object {RoundedCorner rotate 180 * x rotate 180 * y translate + <-CornerRadius, -CornerRadius, 0>} } //union #declare MOP_CharacterWidth [M_] = M_P0.x + M2 + M2 + M_P0.x; } //object #declare MOP_Character [N_] = object { #local N1 = .04 + R; #local N_A0 = 43; union { #local MCorner = object { #local NCornerRadius = R * 1.75; intersection { torus {NCornerRadius, R sturm rotate 90 * x} plane {x, 0 inverse} plane {y, 0 inverse rotate N_A0 * z} } //intersection } //object #local N_P0 = ; #local N_P1Y = NCornerRadius - NCornerRadius * sin (radians (N_A0)); #local N2 = (N_P0.y - N_P1Y) / sin (radians (90 - N_A0)) * sin (radians (N_A0)); #local N_P1X = N_P0.x + N2 + NCornerRadius * cos (radians (N_A0)); #local N_P1 = ; #local N_L0 = sqrt (N2 * N2 + (N_P0.y - N_P1.y) * (N_P0.y - N_P1.y)); sphere {<0, 0, 0>, R} //Left side sphere {<0, 1, 0>, R} cylinder {<0, 0, 0> <0, 1, 0>, R} cylinder {<0, 1, 0> , R} sphere {, R} //Right side sphere {, R} cylinder { , R} cylinder { , R} cylinder {<0, 0, 0> , R rotate (-90 + N_A0) * z translate N_P0} object {MCorner translate } object {MCorner rotate 180 * x rotate 180 * y translate } object {RoundedCorner rotate 180 * x translate <0, 1, 0> + } object {RoundedCorner rotate 180 * y translate + <-CornerRadius, CornerRadius, 0>} } //union #declare MOP_CharacterWidth [N_] = N_P1.x + N1; } //object #declare MOP_Character [O_] = object { #local O1 = .15; #local O2 = 1.3; #local O3 = .2; #declare MOP_CharacterWidth [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 MOP_Character [P_] = object { #local P1 = .12; #local P2 = 1.13; #local P3 = .2; #local P4 = .42; //Vertical #declare MOP_CharacterWidth [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 MOP_Character [Q_] = object { #local Q1 = .9; #local Q2 = .15; #declare MOP_CharacterWidth [Q_] = MOP_CharacterWidth [O_]; union { object {MOP_Character [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 MOP_Character [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 MOP_CharacterWidth [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 MOP_Character [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 MOP_CharacterWidth [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 {<-.15, S6, -.15> <.15, S5 + .25, .15>} //Left / Bottom box {<-.075, S6 + .0001, -.075> <.075, S5 + .28, .075>} //Left / Bottom box { } //Right / Top box { } //Right / Top } //difference intersection { //Left / Bottom sphere {<0, 0, 0>, R} plane {y, 0 inverse} translate <.002, S6, 0> } //intersection intersection { //Right / Top sphere {<0, 0, 0>, R} plane {y, 0} translate } //intersection } //union } //object #declare MOP_Character [T_] = object { #local T1 = 1.16; //Top bar #declare MOP_CharacterWidth [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 MOP_Character [U_] = object { #local U1 = .15; #local U2 = 1.19; #local U3 = .2; #declare MOP_CharacterWidth [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 MOP_Character [V_] = object { #local V1 = .565; //Determines angle of sides #local V2 = .986; //Vertical #local V3 = .14; //Width of bottom flat part #local V4 = .9; #declare MOP_CharacterWidth [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 - .0028) * y } //object #declare MOP_Character [W_] = object { #local W1 = .12; #local W2 = .5; //Center width #local W3 = .02; #local W4 = W1 * .14; #local W5 = .36; #local W6 = .12; //Side offset #declare MOP_CharacterWidth [W_] = W1 + W2 + W3 + W2 + W1 + W6 + W6; sphere_sweep { b_spline 16 <-W6, -1 + W4, 0>, R <0, 0, 0>, R , R , R , R , R , R , R , R , R , R , R , R , R , R , R } //sphere_sweep rotate 180 * z translate } //object #declare MOP_Character [X_] = object { #local X1 = sqrt (2); #declare MOP_CharacterWidth [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 MOP_Character [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 MOP_CharacterWidth [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 MOP_Character [Z_] = object { #local Z1 = .04 + R; #local Z3 = 1.13; //Total width #local Z_A0 = 31.085; #declare MOP_CharacterWidth [Z_] = Z3; union { #local ZCorner = object { #local ZCornerRadius = R * 1.75; intersection { torus {ZCornerRadius, R sturm rotate 90 * x} plane {x, 0 inverse} plane {y, 0 inverse rotate Z_A0 * z} } //intersection } //object #local Z_P0 = ; #local Z_P1Y = ZCornerRadius - ZCornerRadius * sin (radians (Z_A0)); #local Z2 = (Z_P0.y - Z_P1Y) / sin (radians (90 - Z_A0)) * sin (radians (Z_A0)); #local Z_P1X = Z_P0.x + Z2 + ZCornerRadius * cos (radians (Z_A0)); #local Z_P1 = ; #local Z_L0 = sqrt (Z2 * Z2 + (Z_P0.y - Z_P1.y) * (Z_P0.y - Z_P1.y)); sphere {<0, 0, 0>, R} //Left side sphere {<0, Z3, 0>, R} cylinder {<0, 0, 0> <0, Z3, 0>, R} cylinder {<0, Z3, 0> , R} sphere {, R} //Right side sphere {, R} cylinder { , R} cylinder { , R} cylinder {<0, 0, 0> , R rotate (-90 + Z_A0) * z translate Z_P0} object {ZCorner translate } object {ZCorner rotate 180 * x rotate 180 * y translate } object {RoundedCorner rotate 180 * x translate <0, Z3, 0> + } object {RoundedCorner rotate 180 * y translate + <-CornerRadius, CornerRadius, 0>} } //union rotate -90 * z translate 1 * y } //object #declare MOP_Character [PERIOD_] = object { #declare MOP_CharacterWidth [PERIOD_] = 0; sphere {<0, 0, 0>, R} } //object #declare MOP_TextObjectHeight = 1 + MOP_FontRadius * 2; #declare LastMOP_FontRadius = MOP_FontRadius; #declare MOP_CharactersValid = yes; #end //#macro CreateMOP_Characters #macro CreateMOP_TextObject (TextLine, MOP_Gap_, MOP_Space_, MOP_FontRadius_) #declare MOP_Gap = MOP_Gap_; #declare MOP_Space = MOP_Space_; #declare MOP_FontRadius = MOP_FontRadius_; #if (MOP_FontRadius != LastMOP_FontRadius) CreateMOP_Characters (MOP_FontRadius) #end //#if #local TextLine = strupr (TextLine); #declare MOP_TextObject = object { union { #local CurrentX = 0; #for (I, 1, strlen (TextLine)) #local AddCharacter = yes; #local CurrentCharacter = asc (substr (TextLine, I, 1)) - 65; #if (CurrentCharacter = 32 - 65) #local CurrentX = CurrentX + MOP_Space; #local AddCharacter = no; #elseif (CurrentCharacter = 46 - 65) #local CurrentCharacter = PERIOD_; #elseif (CurrentCharacter < 0 | CurrentCharacter > 25) #debug "\nOnly letters A - Z, [SPACE], and [PERIOD] are supported. A non-supported character was skipped.\n" #local AddCharacter = no; #end //#if #if (AddCharacter) object {MOP_Character [CurrentCharacter] translate CurrentX * x} #local CurrentX = CurrentX + MOP_CharacterWidth [CurrentCharacter] + MOP_FontRadius * 2 + MOP_Gap; #end //#if #end //#for } //union translate //Back is at z = 0 } //object #declare MOP_TextObjectWidth = CurrentX - MOP_Gap; #end //#macro CreateMOP_TextObject /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #declare A_ = 0; #declare B_ = 1; #declare C_ = 2; #declare D_ = 3; #declare E_ = 4; #declare F_ = 5; #declare G_ = 6; #declare H_ = 7; #declare I_ = 8; #declare J_ = 9; #declare K_ = 10; #declare L_ = 11; #declare M_ = 12; #declare N_ = 13; #declare O_ = 14; #declare P_ = 15; #declare Q_ = 16; #declare R_ = 17; #declare S_ = 18; #declare T_ = 19; #declare U_ = 20; #declare V_ = 21; #declare W_ = 22; #declare X_ = 23; #declare Y_ = 24; #declare Z_ = 25; #declare PERIOD_ = 26; #declare MOP_Character = array [27]; #declare MOP_CharacterWidth = array [27]; #declare LastMOP_FontRadius = -1; #ifndef (MOP_Gap) #declare MOP_Gap = .16; #end #ifndef (MOP_Space) #declare MOP_Space = .7; #end #ifndef (MOP_CharactersValid) #declare MOP_CharactersValid = no; #end //#ifndef #if (!MOP_CharactersValid) #ifndef (MOP_FontRadius) #declare MOP_FontRadius = .06; #end //#ifndef CreateMOP_Characters (MOP_FontRadius) #end //#if