POV-Ray : Newsgroups : povray.newusers : Cutaway_textures Server Time
24 Nov 2024 12:44:37 EST (-0500)
  Cutaway_textures (Message 1 to 6 of 6)  
From: BoudewijnDocter
Subject: Cutaway_textures
Date: 11 Jul 2008 05:55:00
Message: <web.48772d6758ea35f669b634a70@news.povray.org>
Hi,

I'm having trouble using the cutaway_textures feature when trying to cut
something with a complex csg. The following simplified code illustrates my
problem:

#include "colors.inc"

camera {location <3,4,-4> look_at 0 }
light_source {<10,20,-5>, rgb 3}

#declare MyObject = union {
  box {<-1,-1,-1>,<1,0,1> pigment {Red} }
  box {<-1,0,-1>,<1,1,1> pigment {Blue}}
}

#declare MyCuttingObject = difference {
  cylinder {<0,-2,0>,<0,2,0>,1}
  box {<0,-3,-1>,<1,3,0>}
}

difference {
  object {MyObject}
  object {MyCuttingObject}
  cutaway_textures
}

I've got two colored boxes on top of each other, which I want to cut with an
object that is a construction of two objects. Obviously I would like to see the
colors inside the cut, hence the cutaway_textures, but this doesn't seem to
work. Is there anyone who has the golden tip?

Thanks!

Boud


Post a reply to this message

From: Chris B
Subject: Re: Cutaway_textures
Date: 11 Jul 2008 06:32:55
Message: <487736d7@news.povray.org>
"BoudewijnDocter" <nomail@nomail> wrote in message 
news:web.48772d6758ea35f669b634a70@news.povray.org...
> Hi,
>
> I'm having trouble using the cutaway_textures feature when trying to cut
> something with a complex csg. The following simplified code illustrates my
> problem:
>
> #include "colors.inc"
>
> camera {location <3,4,-4> look_at 0 }
> light_source {<10,20,-5>, rgb 3}
>
> #declare MyObject = union {
>  box {<-1,-1,-1>,<1,0,1> pigment {Red} }
>  box {<-1,0,-1>,<1,1,1> pigment {Blue}}
> }
>
> #declare MyCuttingObject = difference {
>  cylinder {<0,-2,0>,<0,2,0>,1}
>  box {<0,-3,-1>,<1,3,0>}

*** Add  pigment {Yellow} here  ***

> }
>
> difference {
>  object {MyObject}
>  object {MyCuttingObject   *** or here ***}
>  cutaway_textures
> }
>
> I've got two colored boxes on top of each other, which I want to cut with 
> an
> object that is a construction of two objects. Obviously I would like to 
> see the
> colors inside the cut, hence the cutaway_textures, but this doesn't seem 
> to
> work. Is there anyone who has the golden tip?
>
> Thanks!
>
> Boud
>

Your cutting object doesn't currently have a texture defined for it, so it 
comes out black. If you add a pigment it should work.

Regards,
Chris B.


Post a reply to this message

From: BoudewijnDocter
Subject: Re: Cutaway_textures
Date: 11 Jul 2008 08:50:01
Message: <web.48775656beb19c4a69b634a70@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "BoudewijnDocter" <nomail@nomail> wrote in message
> news:web.48772d6758ea35f669b634a70@news.povray.org...
> > Hi,
> >
> > I'm having trouble using the cutaway_textures feature when trying to cut
> > something with a complex csg. The following simplified code illustrates my
> > problem:
> >
> > #include "colors.inc"
> >
> > camera {location <3,4,-4> look_at 0 }
> > light_source {<10,20,-5>, rgb 3}
> >
> > #declare MyObject = union {
> >  box {<-1,-1,-1>,<1,0,1> pigment {Red} }
> >  box {<-1,0,-1>,<1,1,1> pigment {Blue}}
> > }
> >
> > #declare MyCuttingObject = difference {
> >  cylinder {<0,-2,0>,<0,2,0>,1}
> >  box {<0,-3,-1>,<1,3,0>}
>
> *** Add  pigment {Yellow} here  ***
>
> > }
> >
> > difference {
> >  object {MyObject}
> >  object {MyCuttingObject   *** or here ***}
> >  cutaway_textures
> > }
> >
> > I've got two colored boxes on top of each other, which I want to cut with
> > an
> > object that is a construction of two objects. Obviously I would like to
> > see the
> > colors inside the cut, hence the cutaway_textures, but this doesn't seem
> > to
> > work. Is there anyone who has the golden tip?
> >
> > Thanks!
> >
> > Boud
> >
>
> Your cutting object doesn't currently have a texture defined for it, so it
> comes out black. If you add a pigment it should work.
>
> Regards,
> Chris B.

Thanks for your quick reply, but it doesn't seem to solve the problem.
Now the inside becomes Yellow, so the cutaway_textures does not seem to do
anything. Is this a bug? What version should I use? I'm currently running
V3.6.1 for Windows


Post a reply to this message

From: BoudewijnDocter
Subject: Re: Cutaway_textures
Date: 11 Jul 2008 09:55:00
Message: <web.487764b9beb19c4a69b634a70@news.povray.org>
"BoudewijnDocter" <nomail@nomail> wrote:
> "Chris B" <nom### [at] nomailcom> wrote:
> > "BoudewijnDocter" <nomail@nomail> wrote in message
> > news:web.48772d6758ea35f669b634a70@news.povray.org...
> > > Hi,
> > >
> > > I'm having trouble using the cutaway_textures feature when trying to cut
> > > something with a complex csg. The following simplified code illustrates my
> > > problem:
> > >
> > > #include "colors.inc"
> > >
> > > camera {location <3,4,-4> look_at 0 }
> > > light_source {<10,20,-5>, rgb 3}
> > >
> > > #declare MyObject = union {
> > >  box {<-1,-1,-1>,<1,0,1> pigment {Red} }
> > >  box {<-1,0,-1>,<1,1,1> pigment {Blue}}
> > > }
> > >
> > > #declare MyCuttingObject = difference {
> > >  cylinder {<0,-2,0>,<0,2,0>,1}
> > >  box {<0,-3,-1>,<1,3,0>}
> >
> > *** Add  pigment {Yellow} here  ***
> >
> > > }
> > >
> > > difference {
> > >  object {MyObject}
> > >  object {MyCuttingObject   *** or here ***}
> > >  cutaway_textures
> > > }
> > >
> > > I've got two colored boxes on top of each other, which I want to cut with
> > > an
> > > object that is a construction of two objects. Obviously I would like to
> > > see the
> > > colors inside the cut, hence the cutaway_textures, but this doesn't seem
> > > to
> > > work. Is there anyone who has the golden tip?
> > >
> > > Thanks!
> > >
> > > Boud
> > >
> >
> > Your cutting object doesn't currently have a texture defined for it, so it
> > comes out black. If you add a pigment it should work.
> >
> > Regards,
> > Chris B.
>
> Thanks for your quick reply, but it doesn't seem to solve the problem.
> Now the inside becomes Yellow, so the cutaway_textures does not seem to do
> anything. Is this a bug? What version should I use? I'm currently running
> V3.6.1 for Windows

Some additional comments on this subject:
The problem seems to be the difference statement in MyCuttingObject. If I change
this into a union, the scene renders without problems. Looking at the
documentation concerning cutaway_textures (sect. 3.5.10) it gives the following
syntax:
  difference | intersection {
    OBJECT_1_WITH_TEXTURES
    OBJECT_2_WITH_NO_TEXTURE
    cutaway_textures
  }
This suggests that the second object should not have any texture. My suspicion
now is that the difference function in MyCuttingObject results in a csg with
(partially?) default textures (like what would happen if you leave the
cutaway_textures statement out). If this suspicion is right, then removing all
texture information should do the trick, but how?

Does anyone know a method of removing all texture information from a csg?

Thanks!

Boud


Post a reply to this message

From: Chris B
Subject: Re: Cutaway_textures
Date: 11 Jul 2008 10:51:55
Message: <4877738b$1@news.povray.org>
"BoudewijnDocter" <nomail@nomail> wrote in message 
news:web.48775656beb19c4a69b634a70@news.povray.org...
> "Chris B" <nom### [at] nomailcom> wrote:
>> "BoudewijnDocter" <nomail@nomail> wrote in message
>> news:web.48772d6758ea35f669b634a70@news.povray.org...
>> > Hi,
>> >
>> > I'm having trouble using the cutaway_textures feature when trying to 
>> > cut
>> > something with a complex csg. The following simplified code illustrates 
>> > my
>> > problem:
>> >
>> > #include "colors.inc"
>> >
>> > camera {location <3,4,-4> look_at 0 }
>> > light_source {<10,20,-5>, rgb 3}
>> >
>> > #declare MyObject = union {
>> >  box {<-1,-1,-1>,<1,0,1> pigment {Red} }
>> >  box {<-1,0,-1>,<1,1,1> pigment {Blue}}
>> > }
>> >
>> > #declare MyCuttingObject = difference {
>> >  cylinder {<0,-2,0>,<0,2,0>,1}
>> >  box {<0,-3,-1>,<1,3,0>}
>>
>> *** Add  pigment {Yellow} here  ***
>>
>> > }
>> >
>> > difference {
>> >  object {MyObject}
>> >  object {MyCuttingObject   *** or here ***}
>> >  cutaway_textures
>> > }
>> >
>> > I've got two colored boxes on top of each other, which I want to cut 
>> > with
>> > an
>> > object that is a construction of two objects. Obviously I would like to
>> > see the
>> > colors inside the cut, hence the cutaway_textures, but this doesn't 
>> > seem
>> > to
>> > work. Is there anyone who has the golden tip?
>> >
>> > Thanks!
>> >
>> > Boud
>> >
>>
>> Your cutting object doesn't currently have a texture defined for it, so 
>> it
>> comes out black. If you add a pigment it should work.
>>
>> Regards,
>> Chris B.
>
> Thanks for your quick reply, but it doesn't seem to solve the problem.
> Now the inside becomes Yellow, so the cutaway_textures does not seem to do
> anything. Is this a bug? What version should I use? I'm currently running
> V3.6.1 for Windows
>

Ah. Sorry yes I see what you mean.

If MyCuttingObject is defined as just a cylinder the finished object 
inherits red and blue cutaway surfaces from the object that you cut into, 
whereas if you use a CSG object as MyCuttingObject it inherits the surface 
texture of the cutting object.

I did run across a similar issue recently and, unless I'm missing something, 
I think it may well be a bug. I don't see anything in the help that outlaws 
using a 'difference' CSG object as the cutting object with cutaway_textures.

Regards,
Chris B.


Regards,
Chris B.


Post a reply to this message

From: Mike Williams
Subject: Re: Cutaway_textures
Date: 11 Jul 2008 11:33:38
Message: <Mk5Yb2BUy3dIFwAh@econym.demon.co.uk>
Wasn't it BoudewijnDocter who wrote:
>Hi,
>
>I'm having trouble using the cutaway_textures feature when trying to cut
>something with a complex csg. The following simplified code illustrates my
>problem:
>
>#include "colors.inc"
>
>camera {location <3,4,-4> look_at 0 }
>light_source {<10,20,-5>, rgb 3}
>
>#declare MyObject = union {
>  box {<-1,-1,-1>,<1,0,1> pigment {Red} }
>  box {<-1,0,-1>,<1,1,1> pigment {Blue}}
>}
>
>#declare MyCuttingObject = difference {
>  cylinder {<0,-2,0>,<0,2,0>,1}
>  box {<0,-3,-1>,<1,3,0>}
>}
>
>difference {
>  object {MyObject}
>  object {MyCuttingObject}
>  cutaway_textures
>}
>
>I've got two colored boxes on top of each other, which I want to cut with an
>object that is a construction of two objects. Obviously I would like to see the
>colors inside the cut, hence the cutaway_textures, but this doesn't seem to
>work. Is there anyone who has the golden tip?

It looks like a bug. A rather ugly workround is to do this:

union {
  difference {
    object {MyObject}
    cylinder {<0,-2,0>,<0,2,0>,1}
    cutaway_textures
  }
  intersection {
    object {MyObject}
    box {<0,-3,-1>,<1,3,0>}
    cutaway_textures
  }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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