POV-Ray : Newsgroups : povray.general : Empty object : Re: Empty object Server Time
5 Aug 2024 06:15:38 EDT (-0400)
  Re: Empty object  
From: ABX
Date: 21 Nov 2002 10:27:43
Message: <68uptuc2ftpaajn57ltngrubigtm6vllhn@4ax.com>
On Thu, 21 Nov 2002 16:26:12 +0100, Mark Weyer
<wey### [at] fregemathematikuni-freiburgde> wrote:
> > Do you really need an empty object ? Can't you directly use first box object
> > then instead of whole difference object ?
>
> It seems I forgot to repeat the following information in my
> second post: It need the empty object to feed it as a parameter
> to macros using CSG.

I already saw this but I intentionaly provoked you to more precise answer :-)

> Example: I might have a macro for doors. One of its parameters
> is the key shape, so I can carve in (using difference) an appropriate
> keyhole. Sometimes I might need a door without a keyhole. The I
> would feed the empty object for the key shape. Following your idea
> I would have to make a second copy of the door macro where I omit
> the carving out of the keyhole.

There is a lot of ways how you can do this without empty object.

For example:

// indexes to array
#declare DoorsId=0;
#declare KeyholeId=1;
#declare Key=2;


#macro Room(Elements)
  #local Door=Elements[DoorsId];
  #ifdef(Elements[KeyholeId])
    #local Door=intersection{
                  object{Door}
                  object{Elements[KeyholeId]}
                };
    #ifdef(Elements[Key])
      #local Door=union{
                    object{Door}
                    object{Elements[Key]}
                  };
    #end
  #end
#end

ABX


Post a reply to this message

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