/* //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 #local VerticalBar = object { union { cylinder {<0, 0, 0> <0, 1, 0>, R} sphere {<0, 0, 0>, R} sphere {<0, 1, 0>, R} } //union } //object #declare MOP_Character [A_] = object { #local A1 = .03; #local A2 = .59; //Determines angle of sides #local A3 = .06; #local A4 = .13; //Width of top flat part, must be longer than A3 * 2 #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 A_RoundedCorner0 = object { #local TCornerRadius = CornerRadius; #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 A_RoundedCorner1 = object { #local TCornerRadius = CornerRadius * 1.1; #local Theta = -radians (180 - degrees (Theta)); #local Theta2 = Theta / 2; #local A_L6 = TCornerRadius / sin (Theta2); #local A_X6 = -A_L6 * cos (Theta2); #local A_Y6 = -A_L6 * sin (Theta2); union { intersection { torus {TCornerRadius, 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>, TCornerRadius} } //difference plane {y, TCornerRadius} plane {x, -TCornerRadius rotate (90 + degrees (Theta)) * z inverse} plane {x, 0 rotate (-degrees (Theta2)) * 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 {A_RoundedCorner0 translate + } object {A_RoundedCorner0 rotate 180 * y translate + <-A_X5, A_Y5, 0>} object {A_RoundedCorner1 translate + } object {A_RoundedCorner1 rotate 180 * y translate + <-A_X6, A_Y6, 0>} } //union #declare MOP_CharacterWidth [A_] = A2 + A4 + A2; } //object #declare MOP_Character [B_] = object { #local B1 = .12; #local B2 = 1.135; //Top width #local B3 = .2; #local B4 = .52; //Vertical #local B5 = 1.18; //Bottom width 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 #declare MOP_CharacterWidth [B_] = B5; } //object #declare MOP_Character [C_] = object { #local C1 = .12; #local C2 = 1.21; //Width #local C3 = .2; #local C5 = .15; //Must be longer than C1 + C3 #local C6 = .22; //Length of ends 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 } //intersection } //union #declare MOP_CharacterWidth [C_] = C2; } //object #declare MOP_Character [D_] = object { #local D1 = .12; #local D2 = 1.21; //Width #local D3 = .2; union { object {VerticalBar} cylinder {<0, 0, 0> <.5, 0, 0>, R} cylinder {<0, 1, 0> <.5, 1, 0>, R} 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 #declare MOP_CharacterWidth [D_] = D2; } //object #declare MOP_Character [E_] = object { #local E1 = .98; //Top and bottom bars #local E2 = .945; //Middle bar #local E3 = .52; //Vertical union { object {VerticalBar} cylinder {<0, 0, 0> , R} sphere {, R} cylinder {<0, E3, 0> , R} sphere {, R} cylinder {<0, 1, 0> , R} sphere {, R} 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 #declare MOP_CharacterWidth [E_] = E1; } //object #declare MOP_Character [F_] = object { #local F1 = .95; //Top bar #local F2 = .91; //Bottom bar #local F3 = .52; //Vertical union { object {VerticalBar} cylinder {<0, F3, 0> , R} sphere {, R} cylinder {<0, 1, 0> , R} sphere {, R} 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 #declare MOP_CharacterWidth [F_] = F1; } //object #declare MOP_Character [G_] = object { #local G1 = .12; #local G2 = 1.18; //Width #local G3 = .2; #local G4 = G1 + G3 + .115; //G4 must be > G1 + G3 #local G5 = G2 / 2 + .04; 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 cylinder { , R} sphere {, R} sphere {, R} object {RoundedCorner rotate 180 * x rotate 180 * y translate + <-CornerRadius, -CornerRadius, 0>} } //union #declare MOP_CharacterWidth [G_] = G2; } //object #declare MOP_Character [H_] = object { #local H1 = 1.05; //Width #local H2 = .52; //Vertical union { object {VerticalBar} object {VerticalBar translate H1 * x} cylinder {<0, H2, 0> , R} 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 #declare MOP_CharacterWidth [H_] = H1; } //object #declare MOP_Character [I_] = object { object {VerticalBar} #declare MOP_CharacterWidth [I_] = 0; } //object #declare MOP_Character [J_] = object { #local J1 = .12; #local J2 = 1.11; //Width #local J3 = .2; #local J4 = J1 + J3 + .01; //J4 must be > J1 + J3 sphere_sweep { b_spline 11 <0, J4, 0>, R <0, J1 + J3, 0>, R <0, J1, 0>, R , R , R , R , R , R , R , R // , R } //sphere_sweep #declare MOP_CharacterWidth [J_] = J2; } //object #declare MOP_Character [K_] = object { #local K1 = .02; #local K2 = .3; //Width of horizontal bar #local K3 = .52; //Vertical #local K4 = K1 * 4; #local K_A0 = 34; #local K5_Top = sin (radians (90 - K_A0)) * (1 - K3) / sin (radians (K_A0)); #local K5_Bottom = sin (radians (90 - K_A0)) * K3 / sin (radians (K_A0)); #local K_L0_Top = sqrt ((1 - K3) * (1 - K3) + K5_Top * K5_Top); #local K_L0_Bottom = sqrt (K3 * K3 + K5_Bottom * K5_Bottom); #local K_L1_Top = K_L0_Top + .78; //Use to adjust length of angled part #local K_L1_Bottom = K_L0_Bottom + .85; //Use to adjust length of angled part #local K_P0 = ; #local K_P1 = ; #local K_P2_Top = ; #local K_P2_Bottom = ; #local K_P3_Top = ; #local K_P3_Bottom = ; union { object {VerticalBar} sphere_sweep { //Top b_spline 7 <-.95, K3, 0>, R , R , R , R , R , R , R } //sphere_sweep sphere_sweep { //Bottom b_spline 7 <-.95, K3, 0>, R , R , R , R , R , R , R } //sphere_sweep object {RoundedCorner rotate 180 * x translate <0, K3, 0> + } object {RoundedCorner translate <0, K3, 0> + } } //union #declare MOP_CharacterWidth [K_] = K2 + K_P2_Bottom.x; } //object #declare MOP_Character [L_] = object { #local L1 = 1.03; //Width union { object {VerticalBar} cylinder {<0, 0, 0> , R} sphere {, R} object {RoundedCorner translate } } //union #declare MOP_CharacterWidth [L_] = L1; } //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); object {VerticalBar} //Left side cylinder {<0, 1, 0> , R} object {VerticalBar translate (M_P0.x + M2 + M2 + M_P0.x) * x} //Right side 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>} #local M_RoundedCorner0 = object { #local M_L1 = CornerRadius / sin (radians (M_A0)); union { intersection { torus {CornerRadius, R sturm rotate 90 * x} plane {y, 0 rotate M_A0 * z} plane {y, 0 rotate -M_A0 * z} } //intersection intersection { difference { box {<-CornerRadius, -M_L1, -R> } cylinder {<0, 0, -R - .1> <0, 0, R + .1>, CornerRadius} } //difference plane {y, 0 rotate M_A0 * z} plane {y, 0 rotate -M_A0 * z} plane {x, 0 inverse rotate M_A0 * z translate -M_L1 * y} plane {x, 0 rotate -M_A0 * z translate -M_L1 * y} } //intersection } //union } //object object {M_RoundedCorner0 translate } } //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 = 44; 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)); object {VerticalBar} //Left side cylinder {<0, 1, 0> , R} object {VerticalBar translate (N_P1.x + N1) * x} 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; //Width #local O3 = .2; 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 #declare MOP_CharacterWidth [O_] = O2; } //object #declare MOP_Character [P_] = object { #local P1 = .12; #local P2 = 1.13; //Width #local P3 = .2; #local P4 = .42; //Vertical union { object {VerticalBar} cylinder {<0, 1, 0> <.5, 1, 0>, R} cylinder {<0, P4, 0> <.5, P4, 0>, R} 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 #declare MOP_CharacterWidth [P_] = P2; } //object #declare MOP_Character [Q_] = object { #local Multiplier = 1.5; #local Base = .88 + Multiplier * .06; #local Q1 = Base - Multiplier * R; //Moving more to the right causes failure #local Q2 = R + .15; #local Q3 = R + .36; #local Q_A0 = 60; union { object {MOP_Character [O_]} #local QTail = object { union { cylinder {<-Q3, 0, 0> , R} sphere {<-Q3, 0, 0>, R} sphere {, R} } //union } //object #local Q_RoundedCorner0 = object { #local TCornerRadius = CornerRadius * .9; #local Q_A1 = 180 - Q_A0 / 2; #local Q_L0 = TCornerRadius / sin (radians (Q_A0 / 2)); #local Q_P0 = ; union { intersection { torus {TCornerRadius, R sturm rotate 90 * x} plane {x, 0 inverse} plane {x, 0 inverse rotate (-Q_A0) * z} } //intersection intersection { difference { box {<-Q_P0.x - .5, -Q_P0.y, -R> <-Q_P0.x, .3, R>} cylinder {<0, 0, -R - .1> <0, 0, R + .1>, TCornerRadius} } //difference plane {x, 0 inverse} plane {x, 0 inverse rotate -Q_A0 * z} plane {y, 0 rotate -Q_A0 * z translate <-Q_P0.x, -Q_P0.y, 0>} } //intersection } //union translate Q_P0 } //object #local Q_RoundedCorner1 = object { #local TCornerRadius = CornerRadius * 1.1; #local Q_A2 = 180 - Q_A0; #local Q_L1 = TCornerRadius / sin (radians (Q_A2 / 2)); #local Q_P1 = ; union { intersection { torus {TCornerRadius, R sturm rotate 90 * x} plane {x, 0} plane {x, 0 inverse rotate -Q_A0 * z} } //intersection intersection { difference { box {<-Q_P1.x - .5, -Q_P1.y, -R> <.3, .1, R>} cylinder {<0, 0, -R - .1> <0, 0, R + .1>, TCornerRadius} } //difference plane {x, 0} plane {x, 0 inverse rotate -Q_A0 * z} plane {y, 0 inverse rotate -Q_A0 * z translate <-Q_P1.x, -Q_P1.y, 0>} } //intersection } //union translate Q_P1 } //object object {QTail rotate -Q_A0 * z translate Q1 * x} object {Q_RoundedCorner0 translate Q1 * x} object {Q_RoundedCorner0 rotate 180 * y rotate 180 * x translate Q1 * x} object {Q_RoundedCorner1 translate Q1 * x} object {Q_RoundedCorner1 rotate 180 * y rotate 180 * x translate Q1 * x} } //union #declare MOP_CharacterWidth [Q_] = MOP_CharacterWidth [O_]; } //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 union { object {VerticalBar} cylinder {<0, 1, 0> <.5, 1, 0>, R} cylinder {<0, R4, 0> <.5, R4, 0>, R} 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 #declare MOP_CharacterWidth [R_] = R5; } //object #declare MOP_Character [S_] = object { #local S1 = .12; #local S2 = 1.13; //Top width #local S3 = .2; #local S4 = .5; //Vertical #local S5 = .15; //Must be longer than S1 + S3 #local S6 = .22; //Length of ends #local S7 = .025; //Additional bottom width 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 #declare MOP_CharacterWidth [S_] = S2 + S7; } //object #declare MOP_Character [T_] = object { #local T1 = 1.18; //Top bar union { cylinder { , R} sphere {, R} cylinder {<0, 1, 0> , R} sphere {<0, 1, 0>, R} sphere {, R} object {RoundedCorner rotate 180 * x rotate 180 * y translate + <-CornerRadius, -CornerRadius, 0>} object {RoundedCorner rotate 180 * x translate + } } //union #declare MOP_CharacterWidth [T_] = T1; } //object #declare MOP_Character [U_] = object { #local U1 = .15; #local U2 = 1.18; //Width #local U3 = .2; 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 #declare MOP_CharacterWidth [U_] = U2; } //object #declare MOP_Character [V_] = object { #local V1 = .565; //Determines angle of sides #local V2 = .9867; //Vertical #local V3 = .14; //Width of bottom flat part #local V4 = .9; #local V5 = .01; //Fix sphere_sweep { b_spline 8 <-V1, V2, 0>, R <0, 0, 0>, R , R , R , R , R , R , R } //sphere_sweep translate #declare MOP_CharacterWidth [V_] = V5 + V1 + V3 + V1 + V5; } //object #declare MOP_Character [W_] = object { #local W1 = .12; #local W2 = .45; //Center width #local W3 = .02; #local W4 = W1 * .14; #local W5 = 0; //Height of the center point #local W6 = .38; //Side offset 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 #declare MOP_CharacterWidth [W_] = W1 + W2 + W3 + W2 + W1 + W6 + W6; } //object #declare MOP_Character [X_] = object { #local X1 = .53; //Vertical #if (R < .06) #local X3 = 0; //Offset #else #local X3 = .02; //Offset #end //#if #local X_A0 = 45; //Don't change #local X_L0_Bottom = X1 / sin (radians (X_A0)); #local X2 = X_L0_Bottom * sin (radians (90 - X_A0)); #local X_P0 = ; #local X_P1_Left = ; #local X_P1_Right = ; #local X_L0_Top = (1 - X_P1_Left.y) / sin (radians (X_A0)); #local X_L0_Bottom = X_L0_Bottom - X3; union { #local TempX = object { union { #local Bar_Bottom = object { union { sphere {<0, 0, 0>, R} cylinder {<0, 0, 0> , R} } //union } //object #local Bar_Top = object { union { sphere {, R} cylinder {<0, 0, 0> , R} } //union } //object object {Bar_Bottom rotate X_A0 * z} //Bottom left object {Bar_Bottom rotate (180 - X_A0) * z translate } //Bottom right object {Bar_Top rotate (180 - X_A0) * z translate X_P1_Left} //Top left object {Bar_Top rotate X_A0 * z translate X_P1_Right} //Top right } //union rotate X_A0 * z } //object object {TempX} #local X_L1 = sqrt (X_P1_Left.x * X_P1_Left.x + X_P1_Left.y * X_P1_Left.y); #local X_A2 = atan (X_P1_Left.y / X_P1_Left.x) + radians (X_A0); #local X_P2 = ; #local X_L2 = sqrt (X_P1_Right.x * X_P1_Right.x + X_P1_Right.y * X_P1_Right.y); #local X_A3 = atan (X_P1_Right.y / X_P1_Right.x) + radians (X_A0); #local X_P3 = ; object {RoundedCorner rotate 180 * x rotate 180 * y translate translate <-CornerRadius, -CornerRadius, 0>} object {RoundedCorner rotate 180 * x translate translate } object {RoundedCorner translate translate } object {RoundedCorner rotate 180 * y translate translate <-CornerRadius, CornerRadius, 0>} } //union rotate -X_A0 * z #declare MOP_CharacterWidth [X_] = X2 + X2; } //object #declare MOP_Character [Y_] = object { #local Y1 = .035; #local Y2 = .45; //Vertical, matches the "G" #local Y3 = Y1 * 4; #local Y_A0 = 45; #local Y4 = (1 - Y2) / sin (radians (90 - Y_A0)) * sin (radians (Y_A0)); #local Y_L0 = sqrt ((1 - Y2) * (1 - Y2) + Y4 * Y4); #local Y_L1 = Y_L0 + .64; //Use to adjust length of angled part #local Y_P0 = ; #local Y_P1 = ; #local Y_P2 = ; #local Y_P3 = ; union { sphere_sweep { //Left b_spline 8 <0, -.31, 0>, R <0, 0, 0>, R <0, Y2 - Y3, 0>, R <0, Y2 - Y1, 0>, R <-Y_P0.y, Y2 + Y_P0.x, 0>, R <-Y_P1.y, Y2 + Y_P1.x, 0>, R <-Y_P2.y, Y2 + Y_P2.x, 0>, R <-Y_P3.y, Y2 + Y_P3.x, 0>, R } //sphere_sweep sphere_sweep { //Right b_spline 8 <0, -.31, 0>, R <0, 0, 0>, R <0, Y2 - Y3, 0>, R <0, Y2 - Y1, 0>, R , R , R , R , R } //sphere_sweep } //union translate Y_P2.y * x #declare MOP_CharacterWidth [Y_] = Y_P2.y * 2; } //object /* #declare MOP_Character [Z_] = object { #local Z1 = 1.13; //Total width union { sphere {<0, 0, 0>, R} sphere {, R} sphere {<0, 1, 0>, R} sphere {, R} cylinder {<0, 0, 0> , R} cylinder {<0, 0, 0> , R} cylinder {<0, 1, 0> , R} #local Z_RoundedCorner0 = object { #local Z_A0 = atan (1 / Z1); #local Z2 = CornerRadius / sin (Z_A0 / 2); #local Z_P0 = ; union { object { intersection { torus {CornerRadius, R sturm rotate 90 * x} plane {x, 0} plane {x, 0 rotate degrees (Z_A0) * z} } //intersection translate Z_P0 } //object intersection { difference { box {<0, 0, -R> } cylinder {<0, 0, -R - .1> <0, 0, R + .1>, CornerRadius translate Z_P0} } //difference plane {y, 0 rotate degrees (Z_A0) * z} plane {x, 0 rotate degrees (Z_A0) * z translate Z_P0} } //intersection } //union } //object object {Z_RoundedCorner0} object {Z_RoundedCorner0 rotate 180 * z translate } } //union #declare MOP_CharacterWidth [Z_] = Z1; } //object */ #declare MOP_Character [Z_] = object { #local Z1 = 1.17; //Width #local ZCornerRadius = R * 1.3; union { #local Z9 = .024; //Shorten right side of top bar #local Z2 = ZCornerRadius; #local Z3 = ZCornerRadius; #local Z4 = Z1 - Z9 - ZCornerRadius; #local Z5 = 1 - ZCornerRadius; #local Z6 = ZCornerRadius + R; #local Z7 = ZCornerRadius - R; #local Z8 = .03; //Shorten left side of top bar #local Z_P0X = (Z4 * Z6 + Z2 * Z7) / (Z6 + Z7); //Intersection of inner tangents #local Z_P0Y = (Z5 * Z6 + Z3 * Z7) / (Z6 + Z7); #local Z_P1X = (Z6 * Z6 * (Z_P0X - Z2) - Z6 * (Z_P0Y - Z3) * sqrt ((Z_P0X - Z2) * (Z_P0X - Z2) + (Z_P0Y - Z3) * (Z_P0Y - Z3) - Z6 * Z6)) / ((Z_P0X - Z2) * (Z_P0X - Z2) + (Z_P0Y - Z3) * (Z_P0Y - Z3)) + Z2; #local Z_P1Y = (Z6 * Z6 * (Z_P0Y - Z3) + Z6 * (Z_P0X - Z2) * sqrt ((Z_P0X - Z2) * (Z_P0X - Z2) + (Z_P0Y - Z3) * (Z_P0Y - Z3) - Z6 * Z6)) / ((Z_P0X - Z2) * (Z_P0X - Z2) + (Z_P0Y - Z3) * (Z_P0Y - Z3)) + Z3; #local Z_P2 = ; #local Z_A0 = atan (Z_P2.y / Z_P2.x); #local Z_P3 = ; #local Z_A0 = Z_A0 + radians (90); #local Z_P4X = Z4 + Z7 * cos (Z_A0 - radians (90)); #local Z_P4Y = Z5 + Z7 * sin (Z_A0 - radians (90)); #local Z_L0 = sqrt ((Z_P4X - Z_P1X) * (Z_P4X - Z_P1X) + (Z_P4Y - Z_P1Y) * (Z_P4Y - Z_P1Y)); #local ZCorner = object { intersection { torus {ZCornerRadius, R sturm rotate 90 * x} plane {x, 0} plane {x, 0 rotate degrees (Z_A0) * z} } //intersection } //object sphere {, R} sphere {, R} cylinder { , R} cylinder { , R} cylinder {<0, 0, 0> , R rotate degrees (Z_A0) * z translate Z_P3} object {ZCorner translate } //Bottom object {ZCorner rotate 180 * z translate } //Top } //union #declare MOP_CharacterWidth [Z_] = Z1; } //object #declare MOP_Character [DASH_] = object { #local DASH1 = .5; //Width #local DASH2 = .435; //Vertical, match the "G" union { cylinder {<0, DASH2, 0> , R} sphere {<0, DASH2, 0>, R} sphere {, R} } //union #declare MOP_CharacterWidth [DASH_] = DASH1; } //object /* #declare MOP_Character [PERIOD_] = object { //Round version #local PERIODRadius = R * .175; union { torus {PERIODRadius, R sturm rotate 90 * x} cylinder {<0, 0, -R> <0, 0, R>, PERIODRadius} } //union translate #declare MOP_CharacterWidth [PERIOD_] = PERIODRadius * 2; } //object */ #declare MOP_Character [PERIOD_] = object { //Oblong version #local PERIOD1 = R * .425; //Width #local PERIOD2 = PERIOD1 * .5; //Height #local PERIODRadius = R * .075; union { #local PERIODCorner = object { intersection { torus {PERIODRadius, R sturm rotate 90 * x} plane {x, 0} plane {y, 0} } //intersection } //object object {PERIODCorner translate <0, PERIODRadius, 0>} object {PERIODCorner rotate 90 * z translate } object {PERIODCorner rotate 180 * z translate } object {PERIODCorner rotate 270 * z translate <0, PERIOD2, 0>} cylinder {<0, 0, 0> , R} //Bottom cylinder { , R} //Right cylinder {<0, PERIOD2 + PERIODRadius, 0> , R} //Top cylinder {<-PERIODRadius, PERIODRadius, 0> <-PERIODRadius, PERIOD2, 0>, R} //Left cylinder {<0, 0, -R>, <0, 0, R>, PERIODRadius translate <0, PERIODRadius, 0>} cylinder {<0, 0, -R>, <0, 0, R>, PERIODRadius translate } cylinder {<0, 0, -R>, <0, 0, R>, PERIODRadius translate } cylinder {<0, 0, -R>, <0, 0, R>, PERIODRadius translate <0, PERIOD2, 0>} box {<-PERIODRadius, PERIODRadius, -R> } box {<0, 0, -R> } } //union translate PERIODRadius * x #declare MOP_CharacterWidth [PERIOD_] = PERIOD1 + PERIODRadius; } //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 = 45 - 65) #local CurrentCharacter = DASH_; #elseif (CurrentCharacter = 46 - 65) #local CurrentCharacter = PERIOD_; #elseif (CurrentCharacter < 0 | CurrentCharacter > 25) #debug "\nOnly letters A - Z, [SPACE], [DASH], 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 DASH_ = 26; #declare PERIOD_ = 27; #declare MOP_Character = array [28]; #declare MOP_CharacterWidth = array [28]; #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