|
|
Am 09.05.2013 15:00, schrieb kurtz le pirate:
> I declare a variables :
> #declare objectName = "TheBrick";
>
>
> My macro write this name in the inc file with this code :
>
> #write(OUTFILE,"#declare ",objectName," = mesh {\n")
>
> which generates :
>
> #declare TheBrick = mesh {
> triangle {<-4.25,2.25,-3.25>,<-3.57,2.33,-3.33>,<-4.33,2.33,-2.57>}
> triangle {<-4.33,2.33,-2.57>,<-3.57,2.33,-3.33>,<-3.57,2.52,-2.57>}
> triangle {<-3.57,2.33,-3.33>,<-3.15,2.33,-3.33>,<-3.57,2.52,-2.57>}
> ...
> ...
> }
>
>
> Now, in the main script if i write :
>
> #include fileName
> object {
> objectName
> pigment { color White }
> finish { ambient 0 }
> }
>
>
> I get this parse error :
>
> Expected 'object', string identifier found instead.
>
> Seems consistent, but then how can I use this variable to draw object ?
Try the "Parse_Strings" macro:
#include "strings.inc"
...
object {
Parse_String(objectName)
...
}
Post a reply to this message
|
|