POV-Ray : Newsgroups : povray.programming : "minus" clause Server Time
2 May 2024 16:12:34 EDT (-0400)
  "minus" clause (Message 1 to 5 of 5)  
From: Andrey K 
Subject: "minus" clause
Date: 18 Jan 2007 17:35:00
Message: <web.45aff57c945f1bc98123242a0@news.povray.org>
Pre Scriptum: Sorry for my english language.

N.B. Abstract article.

I think, may the "minus" clause be useful for "union" and "merge" ?
Often need make hole, and then allocate in this hole some object. For
example:
wall_object, window_hole_object, and window_frame_object (with glasses and
curtains :) ).

Normal way, to make it:

union{
  // making wall with hole
  difference{
    wall_object
    window_hole_object
  }
  // making holled wall with window
  window_frame_object
}

Using "minus" clause:

union{
  wall_object
  // making wall with hole
  MINUS window_hole_object
  // making holled wall with window
  window_frame_object
}

Difference between both cases not very match, but (I think), second case is
more readable.


Post a reply to this message

From: Le Forgeron
Subject: Re: "minus" clause
Date: 19 Jan 2007 04:38:22
Message: <45b0918e@news.povray.org>
Andrey K. scripsit::
> Pre Scriptum: Sorry for my english language.
> 
> N.B. Abstract article.
> 
> I think, may the "minus" clause be useful for "union" and "merge" ?
> Often need make hole, and then allocate in this hole some object. For
> example:
> wall_object, window_hole_object, and window_frame_object (with glasses and
> curtains :) ).
> 
> Normal way, to make it:
> 
> union{
>   // making wall with hole
>   difference{
>     wall_object
>     window_hole_object
>   }
>   // making holled wall with window
>   window_frame_object
> }
> 
> Using "minus" clause:
> 
> union{
>   wall_object
>   // making wall with hole
>   MINUS window_hole_object
>   // making holled wall with window
>   window_frame_object
> }
> 
> Difference between both cases not very match, but (I think), second case is
> more readable.
> 
> 
> 
This look purely like syntaxing sugar (and it tastes bad too me).
Please draw your CSG tree for both, and explain the difference if any.

I do not see the interest, moreover it is confusing when used on
something like:

union { a
        b
        minus c
        d
      }

would you subtract c from b or (a+b) ?

Also, how would you interpret
union { a minus b minus c d } ?

Too much ambiguity for my taste.

-- 
Eifersucht ist die Leidenschaft, die mit Eifer sucht, was Leiden
schafft.

Eco: -8.75 Soc: -6.72
http://www.politicalcompass.org/


Post a reply to this message

From: Andrey K 
Subject: Re: "minus" clause
Date: 21 Jan 2007 19:30:01
Message: <web.45b404b8b920906b8123242a0@news.povray.org>
Le Forgeron <jgr### [at] freefr> wrote:
> would you subtract c from b or (a+b) ?
>
> Also, how would you interpret
> union { a minus b minus c d } ?
>
> Too much ambiguity for my taste.

So, let`s look on
union{
  a
  b
  minus c
  d
}

yes, it equal to ((a+b)-c)+d

So

union{
  a
  minus b
  c
}

not equal to

union{
  a
  c
  minus b
}

Order, in which objects allocated, very significant here.

Your`s sample "union { a minus b minus c d }" is equal to next clause:

union{          // ((a minus b) minus c) + d
  difference{   // (a minus b) minus c
    difference{ // a minus b
      a
      b
    }
    c
  }
  d
}


Post a reply to this message

From: Le Forgeron
Subject: Re: "minus" clause
Date: 22 Jan 2007 07:03:31
Message: <45b4a813$1@news.povray.org>
Andrey K. scripsit::
> Le Forgeron <jgr### [at] freefr> wrote:

>> Too much ambiguity for my taste.

> Order, in which objects allocated, very significant here.
> 

I won't reenter the fight about prefix vs infix operation. (do not
even mention postfix...)
CSG is prefix within povray SDL, so just keep it that way.

Or soon you will get a request of a reverse-polish notation for
expression. Let's do it the Forth way !
sphere{ 0,1 } MyObj =

is too easy...

1 0 sphere MyObj =

is better!

> Your`s sample "union { a minus b minus c d }" is equal to next clause:
> 
> union{          // ((a minus b) minus c) + d
>   difference{   // (a minus b) minus c
>     difference{ // a minus b
>       a
>       b
>     }
>     c
>   }
>   d
> }

There is a shorter syntax
union {
       difference {
       a
       b
       c
       }
   d
}



-- 
Eifersucht ist die Leidenschaft, die mit Eifer sucht, was Leiden
schafft.

Eco: -8.75 Soc: -6.72
http://www.politicalcompass.org/


Post a reply to this message

From: Andrey K 
Subject: Re: "minus" clause
Date: 22 Jan 2007 17:35:00
Message: <web.45b53ba7b920906b8123242a0@news.povray.org>
> Le Forgeron <jgr### [at] freefr>.

Yes, it was not very good idea. As result, I surrender. :)

Thanks.


Post a reply to this message

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