POV-Ray : Newsgroups : povray.general : POVRay says Macro is not defined : POVRay says Macro is not defined Server Time
2 Aug 2024 08:18:35 EDT (-0400)
  POVRay says Macro is not defined  
From: Matthias Weißer
Date: 12 Dec 2004 13:28:13
Message: <41bc8dbd$1@news.povray.org>
Hi

I have the following macros:

#macro CON_SMD_MOLEX_53261_GRND(n)
union{
     #local pin =
     union{
         box{<-0.18,-0.35,0><0.18,0.35,3.6> translate<0,1.375,0>}
         box{<-0.18,0.8,0><0.18,1.375,-0.3> }
         box{<-0.18,0.0,-0.3><0.18,1.375,-1.0> }
     }

     //Pins
     union{
         #local i = 0;
         #while(i<n)
             object{pin translate<-(n-1)*1.25/2+i*1.25,0,0>}
             #local i = i + 1;
         #end
         texture{col_silver}
     }

     //Plastikkoerper
     union{
         difference{
             box{<-(4.25+(n-2)*1.25)/2,0,0.01>
                 <(4.25+(n-2)*1.25)/2,3.4,4.2>}
             box{<-(3.05+(n-2)*1.25)/2,0.6,0.8>
                 <(3.05+(n-2)*1.25)/2,3.0,4.3>}
             box{<-(4.3+(n-2)*1.25)/2,2.99,3.2>
                 <(4.3+(n-2)*1.25)/2,3.41,4.3>}
             box{<-(2.5+(n-2)*1.25)/2,2.99,2.8>
                 <(2.5+(n-2)*1.25)/2,3.41,4.3>}

             #local i = 0;
             #while(i<n+2)
                 box{<-0.3,2.8,0> <0.3,3.41,0.6>
                     translate<-(n+1)*1.25/2+i*1.25,0,0>}
                 #local i = i + 1;
             #end
         }
         texture{pigment{Gray30}}
     }
}
#end

#macro CON_SMD_MOLEX_53261_2()
object{CON_SMD_MOLEX_53261_GRND(2)}
#end
#macro CON_SMD_MOLEX_53261_3()
object{CON_SMD_MOLEX_53261_GRND(3)}
#end
#macro CON_SMD_MOLEX_53261_4()
object{CON_SMD_MOLEX_53261_GRND(4)}
#end

POVRay parses the file containing this macro (and others befor and 
behind it) When I call that macro POVRay says

Parse Error: Expected 'object', undeclared identifier 
'CON_SMD_MOLEX_53261_4' found instead.

Any ideas?

-- 

mat### [at] matweide
http://www.matwei.de


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.