POV-Ray : Newsgroups : povray.bugreports : A bug with difference operations Server Time
23 Dec 2024 12:03:11 EST (-0500)
  A bug with difference operations (Message 1 to 2 of 2)  
From: Thomas Nelson
Subject: A bug with difference operations
Date: 17 Nov 1998 03:43:49
Message: <36513745.0@news.povray.org>
Greetings,

I think I have encountered two bugs with difference operations involving
planes.
The first one may be just a miss understanding on my part... The second, I'm
pretty sure is incorrect behavior.

I'm using Version 3.1a-watcom.win32 on a PII 400 with 64meg of memory.

The reader's digest versions of the bugs:
Bug #1: When using a difference to try and cut a hole in a plane I instead
end up "pushing it out" (no hole, just a depression in the shape of the
second object ) (Am I running into an "inside/outside" test?... if so how
can I work around this?)

Bug #2: If I make the second object in the difference transparent, I get my
hole but I can't see any media through it.

Source code follows:
#include "colors.inc"

// Uncomment the following lines to see the bug
// (just do one at a time though)
//#declare BUG_NO_1 = 1;
//#declare BUG_NO_2 = 1;


camera { location <0, 2, -10> look_at <0, 0, 0> }

background { SkyBlue }

light_source { <0, 20, 0> color White }

light_source { <0, -20, 0> color White }

object

 sphere { <0, 2, 0> 2 }
 hollow on
 texture { pigment { Clear } }
 interior { media { emission color Scarlet } }
}

object

 sphere { <0, 2, 0>, 1 }
 texture { pigment { color White } }
}

object

 sphere { <0, -2, 0> 2 }
 hollow on
 texture { pigment { Clear } }
 interior { media { emission color NeonBlue } }
}

object {
 sphere { <0, -2, 0>, 1 }
 texture { pigment { color White } }
}


// Start bug #1
// The following does not cut a hole in the plane (or disc).
// It simply "punches that area down"
#ifdef (BUG_NO_1)
difference
{
 object { /* plane { y, 0 } */ disc { <0, 0, 0>, y, 1000 } }
 object { box { <5, 1, 5> <-5, -1, -5> } }
 texture { pigment { color Gray50 } }
}
// End bug #1
#end

#ifdef (BUG_NO_2)
// I can get around bug #1 as follows:
difference
{
 object { /* plane { y, 0 } */ disc { <0, 0, 0>, y, 1000 } }
 // fix the "punch down" by making the box "Clear"
 object { box { <5, 1, 5> <-5, -1, -5> } texture { pigment { color
Clear } } }
 texture { pigment { color Gray50 } }
}

// But note what happens to the halo/media on the blue sphere when we do
this
// It gets cut off when it crosses the plane
// End bug #2
#end

--
 Thomas Nelson  -  tda### [at] iocom  -  http://www.io.com/~tdark
--------------------------------------------------------------
Walkin' in line / With this lost shadow
Spot blind surprise / Garden from gallows
- Son Volt


Post a reply to this message

From: Nieminen Mika
Subject: Re: A bug with difference operations
Date: 17 Nov 1998 05:05:03
Message: <36514a4f.0@news.povray.org>
Thomas Nelson <tda### [at] siriuscom> wrote:
: Bug #1: When using a difference to try and cut a hole in a plane I instead
: end up "pushing it out" (no hole, just a depression in the shape of the
: second object ) (Am I running into an "inside/outside" test?... if so how
: can I work around this?)

  This is normal behaviour.
  You have to think about the plane as if it was a solid object. which
extends to the infinity below the plane, like an infinite floor. If you
cut a part of the floor away, you get just that: a depression in the floor.
Think it as digging sand on a beach -> the beach is a plane, and when you
dig, you are differencing something from the plane -> you get a hole, a
depression.
  Note that the keyword 'hollow' has nothing to do with this. I still think
that 'hollow' is not a good term for what it really means.
  And note also, that objects in povray are not truely solid, but only
surfaces. They just act like they were solid when used in CSG (and the
keyword 'hollow' has no meaning here).
  What you seem to want, is an infinitely thin plane, not a solid floor.
First you should attach the keyword 'hollow' to the plane, so that it will
act as a really hollow object (with fog etc). Note that it will not act as
a hollow object in CSG, just when calculating fog, etc.
  If you want to cut away a hole in the plane so that you can see through,
you can use the 'clipped_by' statement. For example

plane
{ x,0 hollow
  clipped_by { cylinder { -x,x,1 inverse } }
}

(note the 'inverse' keyword; 'clipped_by' works like 'intersection' but it
doesn't add the surface of the second object)

  The 'hollow' keyword also allows you to put media inside the plane.

-- 
                                                           - Warp. -


Post a reply to this message

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