POV-Ray : Newsgroups : povray.beta-test : No String Parameters for Macros? : Re: No String Parameters for Macros? Server Time
28 Jul 2024 22:29:49 EDT (-0400)
  Re: No String Parameters for Macros?  
From: Sven Littkowski
Date: 16 Nov 2006 07:37:23
Message: <455c5b83$1@news.povray.org>
True, I should have added the sample code. Here is the macro:

#macro Exit(Sign,SignWhere,Angle,Rotation,Translation)
 union
 {
  difference
  {
   union
   {
    cylinder // Round Wall
    {
     < -0.025, 0.0, 0.0 > < 0.025, 0.0, 0.0 > 1.20
     pigment
     {
      gradient y
      pigment_map
      {
       [ 0.0 rgb < 0.3137255, 0.3882353, 0.5607843 > ]
       [ 0.3 rgb < 0.3137255, 0.3882353, 0.5607843 > ]
       [ 0.3 White ]
       [ 1.0 White ]
      }
      scale 2.40
      translate < 0.0, -1.20, 0.0 >
     }
    }
    box // Door Frame
    {
     < -0.035, -1.05, -0.55 > < 0.035, 1.05, 0.55 >
     pigment { Black }
    }
   }
   box // Door Cut-Out
   {
    < -0.036, -1.0, -0.5 > < 0.036, 1.0, 0.5 >
    pigment { Black }
   }
  }
  union
  {
   difference
   {
    box // Door
    {
     < -0.055, -1.0, -0.5 > < 0.055, 1.0, 0.5 >
     pigment { White }
    }
    cylinder // Window Cut-Out
    {
     < -0.056, 0.4, 0.0 > < 0.056, 0.4, 0.0 > 0.10
     pigment { Black }
    }
   }
   torus
   {
    0.10, 0.025
    pigment { rgb < 0.9960784,  0.7686275,  0.2392157 > }
    translate < 0.0, 0.0, 0.30 >
   }
   #if(Sign!="") 
////////////////////////////////////////////////////////////////////////////// 
HERE IS THE ERROR
    #if(SignWhere="A")
     box { < -0.000, 0.6, -0.20 > < 0.056, 0.8, 0.20 > pigment { Black } 
rotate < 0.0, 000.0, 0.0 > }
    #end
    #if(SignWhere="B")
     box { < -0.000, 0.6, -0.20 > < 0.056, 0.8, 0.20 > pigment { Black } 
rotate < 0.0, 180.0, 0.0 > }
    #end
   #end
   #if(Angle>90.0)
    #declare Angle=90.0;
   #end
   #if(Angle<-90.0)
    #declare Angle=-90.0;
   #end
   translate < 0.0, 0.0, 0.5 >
   rotate < 0.0, Angle, 0.0 >
   translate < 0.0, 0.0, -0.5 >
  }
  rotate Rotation
  translate Translation
 }
#end

And here is the call to that macro:

 Exit("A",0,+70,< 0.0, 090.0, 0.0 >,< -0.0, 1.5, 3.85 >)  // Exits

This causes the error message "Numerical value expected but string value 
found" (something like that).

Sven


Post a reply to this message

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