// Persistence of Vision Ray Tracer Scene Description File // File: l_macros.inc // Vers: 3.6 // Desc: Macros being used by LEGO parts // Auth: Nicolas Alvarez // Date created: 24-2-2004 // Last modification: 20-7-2004 // 1 POV unit = 1/16 inch #ifdef(View_POV_Include_Stack) #debug "including l_macros.inc\n" #end #declare SeamWidth=1/1000; #declare Plt=<5,2,5>; //size of p3024 #declare Brk=<5,6,5>; //size of p3005 #declare JoinMethod=1; //1: union, 2: merge #macro Round(N) N < 0.5 ? floor(N) : ceil(N) #end #macro Tb(V) translate Brk*V #end #macro Tp(V) translate Plt*V #end #macro Rt(V) rotate 360*V #end #macro UseUnion() #declare JoinMethod=1; #end #macro UseMerge() #declare JoinMethod=2; #end #macro Join() #switch (JoinMethod) #case(1) union #break #case(2) merge #break #else #error "Incorrect JoinMethod number." #break #end #end #macro Sep() #ifdef (SeamWidth) scale 1-SeamWidth #end #end #declare Std1=cylinder { <0, 1,0> <0,-2,0> 0.75 } #declare Std2=cylinder { <0,0,0> <0,1,0> 1.5 } #declare Std3=difference { cylinder { <0,-1,0> <0,-6,0> 2 } cylinder { <0, 0,0> <0,-7,0> 1.5 } } #declare Div1=difference { box { < 0.1,-1, 4> <-0.1,-5,-4> } cylinder { <0,-1,0> <0,-7,0> 2 } } #declare F_Lego=finish { phong 0.5 phong_size 40 reflection { 0.03, 0.5 } diffuse 0.9 ambient 0.1 } #macro SetDefFinish() #default { finish { F_Lego } } #end #macro Studs(objStud, cantX, cantZ) #local i=0; #local j=0; #local firstStud=<-(cantX-1)*2.5, 0, -(cantZ-1)*2.5>; #while (i } #declare j=j+1; #end #declare i=i+1; #end #end #macro loadPart(arrPartNums) #local I=0; #fopen Temp "parts.tmp" write #while (I < dimension_size(arrPartNums,1)) #local strPartNum=arrPartNums[I]; #if (file_exists(concat(strPartNum,".inc"))) #write(Temp, "#ifndef (p", strPartNum, ") #include \"", strPartNum, ".inc\" #end ") #else #error concat("File \"", strPartNum, ".inc\" doesn't exist. ", "It is requiered for the LEGO model you are rendering") #end #declare I=I+1; #end #fclose Temp #include "parts.tmp" #end