POV-Ray : Newsgroups : povray.general : Preserving textures through CSG : Re: Preserving textures through CSG Server Time
1 Aug 2024 12:24:36 EDT (-0400)
  Re: Preserving textures through CSG  
From: Mike Williams
Date: 2 Oct 2005 02:31:56
Message: <ygav3TAp33PDFwa6@econym.demon.co.uk>
Wasn't it Rarius who wrote:
>This works fine, but I have actually found out that my problem is that 
>instead of a simple plane, I was trying to cut the object with an 
>intersection as follows:
>
>difference
>{
>    union
>    {
>        cylinder{-x, y, 1 pigment{Red}}
>        cylinder{x, -y, 1 pigment{Yellow}}
>    }
>    intersection
>    {
>        plane{-y, 0}
>        plane{-y, 0 rotate<60, 0, 0>}
>    }
>    cutaway_textures
>}

It looks like cutaway_textures doesn't work if the cutting object itself
is compound. Is this a bug?

If your cutting object is an intersection, you can work round it like
this:

#declare Thing = union
{
   cylinder{-x, y, 1 pigment{Red}}
   cylinder{x, -y, 1 pigment{Yellow}}
}

union {
  difference {
    object {Thing}
    plane{-y, 0}
    cutaway_textures
  }
  difference {
    object {Thing}
    plane{-y, 0 rotate<60, 0, 0>}
    cutaway_textures
  }
}


Or if the cutting object is a union or merge, rather than an
intersection, do this:

#declare Thing = union
{
   cylinder{-x, y, 1 pigment{Red}}
   cylinder{x, -y, 1 pigment{Yellow}}
}

union {
  difference {
    object {Thing}
    plane{-y, 0}
    plane{-y, 0 rotate<60, 0, 0>}
    cutaway_textures
  }
}


If the cutting object is a difference, use the same method as for
intersection but add "inverse" to the second object.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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