POV-Ray : Newsgroups : povray.general : POVRay says Macro is not defined : Re: POVRay says Macro is not defined Server Time
2 Aug 2024 08:11:37 EDT (-0400)
  Re: POVRay says Macro is not defined  
From: Anthony D  Baye
Date: 12 Dec 2004 14:30:00
Message: <web.41bc9bda655f53448a85f6810@news.povray.org>
I had no problems running the macro as it was under POV-Ray 3.6 for Mac OS
9.x, although there were a few issues that I noticed with the general
construction.

First of all it is un-necessary to encapsulate the contents of your macro in
a union, and I found no problems in dispensing with the outer union block.

Second, It is, in my opinion, redundant to encapsulate your macro calls in
their own macros when they can be called easier by themselves and it takes
up less space doing so.

Third, it is also un-necessary to place your macro calls inside an object
block unless you are going to trasform them in some way (f.ex. translate,
rotate or scale)

Other than that I simply added some stuff so that I could view the scene.

Regards,

ADB

#include "colors.inc"
#include "metals.inc"

camera {
 location <5.0, 4.0, -10.0>
 look_at 0
 }

light_source { <5.0, 15.0, -20.0> rgb 1 }

#default { pigment { White } finish { ambient 0.4 diffuse 0.6 } }

#macro CON_SMD_MOLEX_53261_GRND(n)

#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
         pigment { P_Silver3 }
  }

     //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


CON_SMD_MOLEX_53261_GRND(2)
CON_SMD_MOLEX_53261_GRND(3)
CON_SMD_MOLEX_53261_GRND(4)


Post a reply to this message

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