POV-Ray : Newsgroups : povray.general : CSG troubles : Re: CSG troubles Server Time
30 Jul 2024 10:21:33 EDT (-0400)
  Re: CSG troubles  
From: stevenvh
Date: 9 Mar 2009 03:45:00
Message: <web.49b4c830da4bf64fc0721a1d0@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote:
> > That's what I first thought, but it isn't true.
> >
> >  difference { A  difference { B C } }
> >
> > will subtract B from A, but C will be added again.
>
> C cannot add anything that wasn't already within A.
>
>  - Slime
>  [ http://www.slimeland.com/ ]


You're absolutely right. It only works because the door is in the volume of the
wall. Modeling an open door wouldn't work.

But I'm still wondering if CSG can't be extended in a future version of POV-Ray.
A 'cutaway' (or 'remove' or 'delete') could make CSG more fit for an
OO-approach. Something like this:

  // code start =====2=========3=========4=========5=========6=========7====
  #macro door ( wall-thickness )
    merge {
   cutaway {
        box { 0, < 80, 203, wall-thickness > }
      }
    box {
      < 0, 0, wall-thickness / 2 - 2 > < 80, 203, wall-thickness / 2 + 2 >
      rotate y * 80  // door is open
    }
  }
  // code end =======2=========3=========4=========5=========6=========7====

Wadya guyz think?


Post a reply to this message

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