Society of Robots - Robot Forum

Software => Software => Topic started by: Admin on February 01, 2009, 01:30:57 AM

Title: POV-Ray, Parse Error: No matching }
Post by: Admin on February 01, 2009, 01:30:57 AM
I'm running Eagle3D that compiles using POV-Ray.

This is the error I'm getting:

Quote
Parse Error: No matching } in 'pigment', string identifier found instead

I'm calling this code I wrote in user.inc:

Code: [Select]
#macro DIODE_SMD_CHIP_0805(color_sub)
  union{
  object{CAP_SMD_CHIP_GRND(2.0,1.25,1.3,rgb <0.8, 0.1, 0.2>)}
  }
#end


which references this default cap.inc library that already works:

Code: [Select]
#macro CAP_SMD_CHIP_GRND(L,W,T,K)
union{
superellipsoid{<0.25-(L+W)/150, 0.25-(L+W)/150> pigment{color_sub} scale<L/2,W/2,T/2> }     //Grundkoerper braun
superellipsoid{<0.25-(L+W)/200, 0.25-(L+W)/200> scale<(K+L/100)/2,W/2,T/2> translate <(L-K)/2,0,0> texture{col_silver}}      //rechter Anschluss
superellipsoid{<0.25-(L+W)/200, 0.25-(L+W)/200> scale<(K+L/100)/2,W/2,T/2> translate <-(L-K)/2,0,0> texture{col_silver}}      //linker Anschluss
rotate<90,0,0>
translate<0,T/2,0>
}
#end

//2220
#macro CAP_SMD_CHIP_2220(color_sub)
object{CAP_SMD_CHIP_GRND(5.7,5.0,2.7,0.5)}
#end
//1825
#macro CAP_SMD_CHIP_1825(color_sub)
object{CAP_SMD_CHIP_GRND(4.5,6.4,1.7,0.5)}
#end
//1812
#macro CAP_SMD_CHIP_1812(color_sub)
object{CAP_SMD_CHIP_GRND(4.5,3.2,1.7,0.5)}
#end
//1210
#macro CAP_SMD_CHIP_1210(color_sub)
object{CAP_SMD_CHIP_GRND(3.2,2.5,1.7,0.5)}
#end
#macro CAP_SMD_CHIP_1206(color_sub)
object{CAP_SMD_CHIP_GRND(3.2,1.6,1.5,0.5)}
#end
#macro CAP_SMD_CHIP_0805(color_sub)
object{CAP_SMD_CHIP_GRND(2.0,1.25,1.3,0.5)}
#end
#macro CAP_SMD_CHIP_0603(color_sub)
object{CAP_SMD_CHIP_GRND(1.6,0.8,0.9,0.3)}
#end
#macro CAP_SMD_CHIP_0402(color_sub)
object{CAP_SMD_CHIP_GRND(1.0,0.5,0.6,0.2)}
#end

When I get the error, POV-Ray highlights this line:
Code: [Select]
superellipsoid{<0.25-(L+W)/150, 0.25-(L+W)/150> pigment{color_sub} scale<L/2,W/2,T/2> }     //Grundkoerper braun
Anyone know what I'm doing wrong?


ps - for reference, this is Eagle3D:
http://www.societyofrobots.com/electronics_Eagle3D_tutorial.shtml

edit: I also posted this question on the POV-Ray site, although they probably aren't familiar with Eagle3D
http://news.povray.org/povray.general/thread/%3Cweb.49854e434ba44896e977d74a0%40news.povray.org%3E/
Title: Re: POV-Ray, Parse Error: No matching }
Post by: Dscrimager on February 01, 2009, 08:39:50 PM
Could it be a parser problem when it's expanded it would be something  like this

Union {
          Union {
                    Blah(..)
                    Blah(..)
                   }
          }

And maybe it needs more than one other element in the outermost Union?

Doug
Title: Re: POV-Ray, Parse Error: No matching }
Post by: fuzzyt on February 03, 2009, 11:40:59 AM
I haven't worked with POVRay for years and years, and I'm not sure this is relevant, but:

the last term being passed to the macro in your code is "rgb <0.8, 0.1, 0.2>".

object{CAP_SMD_CHIP_GRND(2.0,1.25,1.3,rgb <0.8, 0.1, 0.2>)}

All the other examples there use "0.5".  Might there be an issue with this?  Especially the whitespace.  I've seen compilers go mad with this.

Just an idea.
Title: Re: POV-Ray, Parse Error: No matching }
Post by: paulstreats on February 03, 2009, 04:08:10 PM
The default library doesnt call an object function from within a union, have you tried it without?
Title: Re: POV-Ray, Parse Error: No matching }
Post by: Admin on February 18, 2009, 05:43:10 AM
Playing around with it, I managed to entirely avoid the macro call. Basically using 100% Eagle3D code and nothing that I wrote.

Well, the code still had an error, meaning the parser bug is specifically in this below code. I suspect it has something to do with "neu Parameter K = Anschlussbreite", which although I don't speak German, I assume it means a new parameter was added but code not tested.

Code: [Select]
/********************************************************************************************************************************************
//Grundmakro fuer SMD-Keramik-Chip-Kondensator (neu Parameter K = Anschlussbreite)
//basiert auf Makro von Walter Muecke
********************************************************************************************************************************************/
#macro CAP_SMD_CHIP_GRND(L,W,T,K)
union{
superellipsoid{<0.25-(L+W)/150, 0.25-(L+W)/150> pigment{color_sub} scale<L/2,W/2,T/2> }     //Grundkoerper braun
superellipsoid{<0.25-(L+W)/200, 0.25-(L+W)/200> scale<(K+L/100)/2,W/2,T/2> translate <(L-K)/2,0,0> texture{col_silver}}      //rechter Anschluss
superellipsoid{<0.25-(L+W)/200, 0.25-(L+W)/200> scale<(K+L/100)/2,W/2,T/2> translate <-(L-K)/2,0,0> texture{col_silver}}      //linker Anschluss
rotate<90,0,0>
translate<0,T/2,0>
}
#end

#macro CAP_SMD_CHIP_0805(color_sub)
object{CAP_SMD_CHIP_GRND(2.0,1.25,1.3,0.5)}
#end

That being said, I just did a macro over to a resistor as a replacement. For an SMD part, it looks close enough I guess . . . If someone wants to mull over the code please do! Otherwise I'll consider it good enough of a solution . . .