POV-Ray : Newsgroups : povray.newusers : A little CSG help : Re: A little CSG help Server Time
30 Jul 2024 02:19:34 EDT (-0400)
  Re: A little CSG help  
From: Mike Williams
Date: 13 Nov 2004 16:05:03
Message: <35IViDA1bnlBFwD5@econym.demon.co.uk>
Wasn't it Alain who wrote:
>As POV Ray don't try to bound a plane, when you subtract a plane from a 
>finite object, the resulting bounding box would stay that of the first 
>object. When using a box to do the same, the resulting bounding box tend 
>to expand to the total combined size of both the cuted and the cuting 
>shapes. This can lead to very large, almost empty bounding shapes.

It's easy to show that that's not the case. For intersection operations
POV bounds with the intersection of the individual bounding boxes, and
for difference operations POV bounds with the bound of the first object
(the one that everything else is cut out from).

Intersecting or differencing a small object with a huge object leaves a
small bounding box.

There seems to be one clever trick that POV does when differencing with
an axis-aligned plane, so I've introduced a one-degree rotation into
this example to prevent that happening. If you render it with +MB0 +UD
in the command line you'll see the bounding boxes are the same size.
Change "difference" into "intersection" and the bounding boxes are still
the same size.


camera {location  <0,0,-10> look_at <0,0,0> angle 30}
light_source {<-30, 100, -30> rgb 1}

difference {
  sphere {0,1}
  plane {x,0 rotate y}
  pigment {rgb 1}
  translate -x
}

difference {
  sphere {0,1}
  box {<0,-100,-100><100,100,100> rotate y}
  pigment {rgb 1}
  translate x
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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