POV-Ray : Newsgroups : povray.advanced-users : Union of unions and macros Server Time
23 Nov 2024 15:56:14 EST (-0500)
  Union of unions and macros (Message 1 to 6 of 6)  
From: Mike Horvath
Subject: Union of unions and macros
Date: 18 Feb 2016 21:51:15
Message: <56c68323$1@news.povray.org>
I have the following bit of code:


union
{
	#for (i, 1, Trees_Number)
		#local Trees_Object = union
		{
			PlantPatch()
			scale 1/64
		}
		Populate_Triangle(Trees_Object, 1, Seed, Flip)
	#end
}


The result of the PlantPatch() and Populate_Triangle() macros are 
additional unions. However, I get the error, "No matching } in 'union', 
union found instead". Is there something wrong with the scene? I thought 
unions could contain other unions. Thanks.


Mike


Post a reply to this message

From: clipka
Subject: Re: Union of unions and macros
Date: 18 Feb 2016 22:20:36
Message: <56c68a04$1@news.povray.org>
Am 19.02.2016 um 03:51 schrieb Mike Horvath:
> I have the following bit of code:
> 
> 
> union
> {
>     #for (i, 1, Trees_Number)
>         #local Trees_Object = union
>         {
>             PlantPatch()
>             scale 1/64
>         }
>         Populate_Triangle(Trees_Object, 1, Seed, Flip)
>     #end
> }
> 
> 
> The result of the PlantPatch() and Populate_Triangle() macros are
> additional unions. However, I get the error, "No matching } in 'union',
> union found instead". Is there something wrong with the scene? I thought
> unions could contain other unions. Thanks.

You might want to have a closer look at the macros.


Post a reply to this message

From: dick balaska
Subject: Re: Union of unions and macros
Date: 18 Feb 2016 22:43:25
Message: <56c68f5d$1@news.povray.org>
On 2/18/2016 9:51 PM, Mike Horvath wrote:
> I have the following bit of code:
>
>
> union
> {
>      #for (i, 1, Trees_Number)
>          #local Trees_Object = union
>          {
>              PlantPatch()
>              scale 1/64
>          }
>          Populate_Triangle(Trees_Object, 1, Seed, Flip)
>      #end
> }
>
>
> The result of the PlantPatch() and Populate_Triangle() macros are
> additional unions. However, I get the error, "No matching } in 'union',
> union found instead". Is there something wrong with the scene? I thought
> unions could contain other unions. Thanks.
>

Change PlantPatch to an intersection and Populate_Triangle to a difference.
The object will be broken but it will parse, and that might lead you to 
which is your offending macro.  One of those has an extra }


Post a reply to this message

From: Alain
Subject: Re: Union of unions and macros
Date: 20 Feb 2016 14:31:18
Message: <56c8bf06$1@news.povray.org>
Le 16-02-18 22:43, dick balaska a écrit :
> On 2/18/2016 9:51 PM, Mike Horvath wrote:
>> I have the following bit of code:
>>
>>
>> union
>> {
>>      #for (i, 1, Trees_Number)
>>          #local Trees_Object = union
>>          {
>>              PlantPatch()
>>              scale 1/64
>>          }
>>          Populate_Triangle(Trees_Object, 1, Seed, Flip)
>>      #end
>> }
>>
>>
>> The result of the PlantPatch() and Populate_Triangle() macros are
>> additional unions. However, I get the error, "No matching } in 'union',
>> union found instead". Is there something wrong with the scene? I thought
>> unions could contain other unions. Thanks.
>>
>
> Change PlantPatch to an intersection and Populate_Triangle to a difference.
> The object will be broken but it will parse, and that might lead you to
> which is your offending macro.  One of those has an extra }
>
>

Excuse me, but changing an union to an intersection or difference?
There is no way that can give the same result, ever. It will also render 
MUCH slower.

My guess is that one of those macros produce an union that may be 
missing it's closing brace.


Alain


Post a reply to this message

From: dick balaska
Subject: Re: Union of unions and macros
Date: 20 Feb 2016 15:42:12
Message: <56c8cfa4$1@news.povray.org>
On 2/20/2016 2:32 PM, Alain wrote:

>
> Excuse me, but changing an union to an intersection or difference?
> There is no way that can give the same result, ever. It will also render
> MUCH slower.
>
> My guess is that one of those macros produce an union that may be
> missing it's closing brace.

No, the point is not to render it, it's just to parse it to figure which 
of the 3 nested unions is missing the }.  If one changes a union to a 
difference, maybe it says "missing } in difference" and buys one a clue 
to where the problem is.

dik


Post a reply to this message

From: Mike Horvath
Subject: Re: Union of unions and macros
Date: 20 Feb 2016 16:47:30
Message: <56c8def2@news.povray.org>
On 2/20/2016 3:42 PM, dick balaska wrote:
> On 2/20/2016 2:32 PM, Alain wrote:
>
>>
>> Excuse me, but changing an union to an intersection or difference?
>> There is no way that can give the same result, ever. It will also render
>> MUCH slower.
>>
>> My guess is that one of those macros produce an union that may be
>> missing it's closing brace.
>
> No, the point is not to render it, it's just to parse it to figure which
> of the 3 nested unions is missing the }.  If one changes a union to a
> difference, maybe it says "missing } in difference" and buys one a clue
> to where the problem is.
>
> dik
>
>


I changed this:

#local Trees_Object = union
          {
              PlantPatch()
              scale 1/64
          }

to this:

#local Trees_Object = object
          {
              PlantPatch()
              scale 1/64
          }

Now it works. Thanks guys!


Mike


Post a reply to this message

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