POV-Ray : Newsgroups : povray.general : clone/duplicate of a union Server Time: 23 Mar 2019 06:28:58 GMT
 clone/duplicate of a union (Message 1 to 7 of 7)
 From: Kima Subject: clone/duplicate of a union Date: 25 May 2018 12:20:01 Message:
```It is probably a ridiculous question, but imagine we have created a union as

#declare obj_u1 =
union {
obj1
obj2
}

how can we create clones of obj_u1 and apply different transformations?

For example, how can we transform three independent copies of obj_u1 as

translate obj_u1
scale obj_u1
rotate obj_u1
```
 From: Stephen Subject: Re: clone/duplicate of a union Date: 25 May 2018 13:49:24 Message: <5b081464\$1@news.povray.org>
```On 25/05/2018 13:16, Kima wrote:
> It is probably a ridiculous question, but imagine we have created a union as
>
> #declare obj_u1 =
>      union {
>          obj1
>          obj2
>      }
>
> how can we create clones of obj_u1 and apply different transformations?
>
> For example, how can we transform three independent copies of obj_u1 as
>
> translate obj_u1
> scale obj_u1
> rotate obj_u1
>
>
Once you have declared it. Call it by using:

object{ obj_u1

rotate <a,b,c>
scale <l,m,n>
translate <x,y,z>
}

Repeat as many times as you want with different transformations and
textures.

--

Regards
Stephen
```
 From: Bald Eagle Subject: Re: clone/duplicate of a union Date: 25 May 2018 16:50:01 Message:
```"Kima" <nomail@nomail> wrote:
> It is probably a ridiculous question, but imagine we have created a union as

POV-Ray has a somewhat steep learning curve, so these things aren't really
ridiculous.

> #declare obj_u1 =
>     union {
>         obj1
>         obj2
>     }
>
> how can we create clones of obj_u1 and apply different transformations?

> For example, how can we transform three independent copies of obj_u1 as
>
> translate obj_u1
> scale obj_u1
> rotate obj_u1

What you want to do is use the
object {} "directive" or whatever this type of SDL command is properly called.

So, assuming you've declared values for x1, y1, and z1, you could use the
following structures:

object {obj_u1 translate <x1, y1, z1>}
object {obj_u1 translate x*10}

object {obj_u1 scale <x1, y1, z1>}
object {obj_u1 scale 3}

object {obj_u1 rotate <x1, y1, z1>}
object {obj_u1 rotate y*degrees}
```
 From: Stephen Subject: Re: clone/duplicate of a union Date: 25 May 2018 19:30:43 Message: <5b086463\$1@news.povray.org>
```On 25/05/2018 17:49, Bald Eagle wrote:
> POV-Ray has a somewhat steep learning curve, so these things aren't really
> ridiculous.

And there are no stupid questions only stupid answers.

--

Regards
Stephen
```
 From: Jim Holsenback Subject: Re: clone/duplicate of a union Date: 25 May 2018 20:12:07 Message: <5b086e17\$1@news.povray.org>
```On 05/25/2018 03:30 PM, Stephen wrote:
> On 25/05/2018 17:49, Bald Eagle wrote:
>> POV-Ray has a somewhat steep learning curve, so these things aren't
>> really
>> ridiculous.
>
> And there are no stupid questions only stupid answers.
>
well i'm glad to see that i'm not the only cranky old man here...sounds
like something i might have said
```
 From: Alain Subject: Re: clone/duplicate of a union Date: 25 May 2018 20:16:18 Message: <5b086f12@news.povray.org>
```Le 18-05-25 Ã  08:16, Kima a Ã©critÂ :
> It is probably a ridiculous question, but imagine we have created a union as
>
> #declare obj_u1 =
>      union {
>          obj1
>          obj2
>      }
>
> how can we create clones of obj_u1 and apply different transformations?
>
> For example, how can we transform three independent copies of obj_u1 as
>
> translate obj_u1
> scale obj_u1
> rotate obj_u1
>
>

Very simple.
You can simply place the object multiple times into your scene :
object{obj_u1 translate SomeTranslation}
object{obj_u1 scale SomeScalling}
object{obj_u1 rotate SomeRotation}

Or, you can make transformed copies :
#declare obj_t1 = object{obj_u1 translate SomeTranslation}
#declare obj_t2 = object{obj_u1 scale SomeScalling}
#declare obj_t3 = object{obj_u1 rotate SomeRotation}
```
 From: Stephen Subject: Re: clone/duplicate of a union Date: 25 May 2018 20:41:42 Message: <5b087506\$1@news.povray.org>
```On 25/05/2018 21:12, Jim Holsenback wrote:
> On 05/25/2018 03:30 PM, Stephen wrote:
>> On 25/05/2018 17:49, Bald Eagle wrote:
>>> POV-Ray has a somewhat steep learning curve, so these things aren't
>>> really
>>> ridiculous.
>>
>> And there are no stupid questions only stupid answers.
>>
> well i'm glad to see that i'm not the only cranky old man here...sounds
> like something i might have said

:-)
And where is Shelly when you need her. ;-)

--

Regards
Stephen
```