|
|
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
|
|
|
|
"Sven Littkowski" <sve### [at] jamaica-focuscom> wrote:
> #if(Sign!="")
The problem is not the macro. It's that #if expects numericals and does not
accept strings. Try using the strcmp() function which compares strings:
#if (strcmp(Sign,"")!=0) //TRUE if (Sign != ""), strcmp()returns 0 if
both strings are equal
> #if(SignWhere="A")
> #if(SignWhere="B")
You're also going to have to fix this. You pass a number for SignWhere, but
try to use it as a string. Choose which you want and modify accordingly.
> Exit("A",0,+70,< 0.0, 090.0, 0.0 >,< -0.0, 1.5, 3.85 >) // Exits
-tgq
Post a reply to this message
|
|