POV-Ray : Newsgroups : povray.general : Help with cutaway_textures Server Time
29 Jul 2024 18:25:06 EDT (-0400)
  Help with cutaway_textures (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: Solar Mike
Subject: Help with cutaway_textures
Date: 13 Dec 2010 23:20:00
Message: <web.4d06f017fc8a40ac374ca5240@news.povray.org>
Hi,

I don`t seem to be able to get cutaway_textures to work the way I`m expecting
and I am hoping someone here could set me straight.  The following is a snippit
of code and I would have expected the intersection to have left the texture of
wood.

#macro myWood()
    union {
        #local wPos = 0;
        #while (wPos < wWood)
        object {
            board(lWood, tWood, wWood/3)
            translate <0, 0, wPos>
        }
        #local wPos = wPos + wWood/3;
    #end
    translate 50*y
    }
#end

intersection {
    myWood()
    object {
        cylinder {<wWood/2, 0, lWood/2>,<wWood/2, 150, lWood/2>, lWood/4 }
        texture { pigment { rgb <.1, .2, .8>}}
    }
    cutaway_textures
}

I end up with a cylinder with a wood grained top but blue sides.

Any suggestions?
Thanks.


Post a reply to this message

From: clipka
Subject: Re: Help with cutaway_textures
Date: 14 Dec 2010 07:32:32
Message: <4d0763e0$1@news.povray.org>
Am 14.12.2010 05:18, schrieb Solar Mike:
> Hi,
>
> I don`t seem to be able to get cutaway_textures to work the way I`m expecting
> and I am hoping someone here could set me straight.  The following is a snippit
> of code and I would have expected the intersection to have left the texture of
> wood.

> intersection {
>      myWood()
>      object {
>          cylinder {<wWood/2, 0, lWood/2>,<wWood/2, 150, lWood/2>, lWood/4 }
>          texture { pigment { rgb<.1, .2, .8>}}
>      }
>      cutaway_textures
> }
>
> I end up with a cylinder with a wood grained top but blue sides.

Quote from the docs:

---------------------------------------
3.5.10  Cutaway Textures
Syntax:

   difference | intersection {
     OBJECT_1_WITH_TEXTURES
     OBJECT_2_WITH_NO_TEXTURE
     cutaway_textures
   }
---------------------------------------

Mind the "_WITH_NO_TEXTURE": cutaway_textures only works if your 
"cutting tool" has no explicit texture set.


Post a reply to this message

From: Solar Mike
Subject: Re: Help with cutaway_textures
Date: 14 Dec 2010 21:40:00
Message: <web.4d082a66487b6311aaa700f20@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 14.12.2010 05:18, schrieb Solar Mike:
>
> Quote from the docs:
>
> ---------------------------------------
> 3.5.10  Cutaway Textures
> Syntax:
>
>    difference | intersection {
>      OBJECT_1_WITH_TEXTURES
>      OBJECT_2_WITH_NO_TEXTURE
>      cutaway_textures
>    }
> ---------------------------------------
>
> Mind the "_WITH_NO_TEXTURE": cutaway_textures only works if your
> "cutting tool" has no explicit texture set.

Thanks,

You are quite right.  Unfortunately I did not have a texture with my original
problem.  It seems to be more of a problem if I have a union.  Is this expected
to work or am I again missing something?  The problem occurs whether the union
is within an object or not.

intersection {
    myWood()
    object {
        union {
            cylinder {<lWood/2, 0, wWood/2>,<lWood/2, 150, wWood/2>, lWood/4 }
            cylinder {<lWood/2, 0, wWood/3>,<lWood/2, 150, wWood/3>, lWood/4 }
        }
    }
    cutaway_textures
}


Post a reply to this message

From: Solar Mike
Subject: Re: Help with cutaway_textures
Date: 16 Dec 2010 23:20:00
Message: <web.4d0ae476487b631173b3f5c50@news.povray.org>
I am still having the texture problem - if it is working properly I have not
thought of a good way of working around it.  Here is my test code and the
resulting output

#macro cutter()
    union {
        cylinder {<lWood/2, 0, wWood/3>,<lWood/2, 150, wWood/3>, lWood/4 }
        cylinder {<lWood/2, 0, wWood*2/3>,<lWood/2, 150, wWood*2/3>, lWood/4 }
    }
#end

difference  {
    myWood()
    cutter()
    cutaway_textures
    translate (wWood+20)*z
}

intersection {
    myWood()
    cutter()
    cutaway_textures
}

http://s1223.photobucket.com/albums/dd507/solarmike1/?action=view&current=testIntersect.png

I would have expected the wood texture on both the difference and the
intersection.  Any thoughts as to how I can re-work this?


Post a reply to this message

From: clipka
Subject: Re: Help with cutaway_textures
Date: 17 Dec 2010 04:32:50
Message: <4d0b2e42@news.povray.org>
Am 17.12.2010 05:17, schrieb Solar Mike:
>
http://s1223.photobucket.com/albums/dd507/solarmike1/?action=view&current=testIntersect.png
>
> I would have expected the wood texture on both the difference and the
> intersection.  Any thoughts as to how I can re-work this?

I'd expect the same as you do.
What happens when you add the "inverse" keyword to the cutter() union?


Post a reply to this message

From: Solar Mike
Subject: Re: Help with cutaway_textures
Date: 17 Dec 2010 09:55:01
Message: <web.4d0b797c487b6311a6a53d210@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 17.12.2010 05:17, schrieb Solar Mike:
> >
http://s1223.photobucket.com/albums/dd507/solarmike1/?action=view&current=testIntersect.png
> >
> > I would have expected the wood texture on both the difference and the
> > intersection.  Any thoughts as to how I can re-work this?
>
> I'd expect the same as you do.
> What happens when you add the "inverse" keyword to the cutter() union?

I have tried playing around with that.  If I use the inverse and then difference
I get the same result.  I will also loose the texture if I only have a single
cylinder in the union.  Removing the union from that will restore the texture
but I'm after a slightly more complicated "cutter."

I also tried adding an interior_texture without success.


Post a reply to this message

From: clipka
Subject: Re: Help with cutaway_textures
Date: 17 Dec 2010 20:18:43
Message: <4d0c0bf3$1@news.povray.org>
Am 17.12.2010 15:53, schrieb Solar Mike:
> clipka<ano### [at] anonymousorg>  wrote:
>> Am 17.12.2010 05:17, schrieb Solar Mike:
>>>
http://s1223.photobucket.com/albums/dd507/solarmike1/?action=view&current=testIntersect.png
>>>
>>> I would have expected the wood texture on both the difference and the
>>> intersection.  Any thoughts as to how I can re-work this?
>>
>> I'd expect the same as you do.
>> What happens when you add the "inverse" keyword to the cutter() union?
>
> I have tried playing around with that.  If I use the inverse and then difference
> I get the same result.  I will also loose the texture if I only have a single
> cylinder in the union.  Removing the union from that will restore the texture
> but I'm after a slightly more complicated "cutter."
>
> I also tried adding an interior_texture without success.

What happens if you put "cutaway_textures" into the union?


Post a reply to this message

From: Jim Holsenback
Subject: Re: Help with cutaway_textures
Date: 17 Dec 2010 20:59:25
Message: <4d0c157d$1@news.povray.org>
On 12/17/2010 09:18 PM, clipka wrote:
> Am 17.12.2010 15:53, schrieb Solar Mike:
>> clipka<ano### [at] anonymousorg>  wrote:
>>> Am 17.12.2010 05:17, schrieb Solar Mike:
>>>>
http://s1223.photobucket.com/albums/dd507/solarmike1/?action=view&current=testIntersect.png
>>>>
>>>>
>>>> I would have expected the wood texture on both the difference and the
>>>> intersection.  Any thoughts as to how I can re-work this?
>>>
>>> I'd expect the same as you do.
>>> What happens when you add the "inverse" keyword to the cutter() union?
>>
>> I have tried playing around with that.  If I use the inverse and then
>> difference
>> I get the same result.  I will also loose the texture if I only have a
>> single
>> cylinder in the union.  Removing the union from that will restore the
>> texture
>> but I'm after a slightly more complicated "cutter."
>>
>> I also tried adding an interior_texture without success.
> 
> What happens if you put "cutaway_textures" into the union?

could this be the same behavior that was covered in this tag:
http://bugs.povray.org/task/115


Post a reply to this message

From: clipka
Subject: Re: Help with cutaway_textures
Date: 17 Dec 2010 22:35:38
Message: <4d0c2c0a$1@news.povray.org>
Am 18.12.2010 02:59, schrieb Jim Holsenback:

> could this be the same behavior that was covered in this tag:
> http://bugs.povray.org/task/115

No, it's actually just the opposite. Though they're closely related.

Gee, this cutaway thing is more complicated than I was just thinking.


Post a reply to this message

From: Solar Mike
Subject: Re: Help with cutaway_textures
Date: 17 Dec 2010 23:20:01
Message: <web.4d0c35b8487b631173b3f5c50@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 18.12.2010 02:59, schrieb Jim Holsenback:
>
> > could this be the same behavior that was covered in this tag:
> > http://bugs.povray.org/task/115
>
> No, it's actually just the opposite. Though they're closely related.
>
> Gee, this cutaway thing is more complicated than I was just thinking.

I had a look at task115 and I found that I could get correct rendering if I
moved the final application of orange to the difference only (the walls.)  I
think that the orange may have been applied to the fillet since no texture was
explicitly applied to it and the orange was applied to the entire final union.
Interestingly, I would have expected the orange to override all the textures in
the final union but I guess that is not the case!

I'm still not sure how to work around the problem I am having. :/


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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