POV-Ray : Newsgroups : povray.programming : csg bug ? Server Time
29 Jul 2024 10:23:05 EDT (-0400)
  csg bug ? (Message 1 to 6 of 6)  
From: Deneux Johann
Subject: csg bug ?
Date: 17 May 1998 14:05:15
Message: <355F26DB.30CB6D30@club-internet.fr>
Hello everybody. I have encountered a problem, what could even be a bug.

This is a CSG-problem. Try this little scene:


#include "colors.inc"

/* Prints a 'L' in a white pannel */
difference {
 // The panel
 box {<-1,-1,0.5>, <17,12,2>}
 // The 'L'
 union {
  box {<0,0,0>, <1,9,1>}
  box {<0,0,0>, <6,1,1>}

  pigment { color Red } // To see the L print
 }
 pigment { color White }
}

light_source {
 <8.5,5,-40>
 color White
 shadowless
}

// The camera looks into the 'L''s corner
camera {
 location <0.5,0.5,-2.5>
 direction z
 right x/3
 up y/3
}


Render it ... OK, if you encountered the same problem, you should see
that the corner isn't pretty.
It looks quite a 'snowy fog'.
I saw this problem with versions 3.00 (win95 version) and 3.02 (linux).
Sorry if this bug was known and corrected, but I just couldn't find any
BUG-list.

--
______________________________________________________

Page perso: http://www.club-internet.fr/perso/deneux


Post a reply to this message

From: Twyst
Subject: Re: csg bug ?
Date: 17 May 1998 19:12:37
Message: <6jnnl7$5dq$1@oz.aussie.org>
Deneux Johann wrote in message <355F26DB.30CB6D30@club-internet.fr>...
>Hello everybody. I have encountered a problem, what could even be a bug.
>
>This is a CSG-problem. Try this little scene:
>
>
>#include "colors.inc"
>
>/* Prints a 'L' in a white pannel */
>difference {
> // The panel
> box {<-1,-1,0.5>, <17,12,2>}
> // The 'L'
> union {
>  box {<0,0,0>, <1,9,1>}
>  box {<0,0,0>, <6,1,1>}

Here's your problem. Coincident surfaces. Pov-Ray can't decide which to
show.
Try this:

union

  box { <0,0,0>,<1,9,1>}
  box { <0,0,0>,<6,1,1.0001> }


That will solve the problem.

Twyst=====================================
pov-ray news, reviews and tutorials
http://twysted.net
e-mail: twy### [at] twystednet
==========================================


Post a reply to this message

From: DENEUX johann
Subject: Re: csg bug ?
Date: 18 May 1998 04:39:33
Message: <355FF3C5.30FC@univ-mulhouse.fr>
Twyst wrote:
> 
> Deneux Johann wrote in message <355F26DB.30CB6D30@club-internet.fr>...
> >Hello everybody. I have encountered a problem, what could even be a bug.
> >

> Try this:
> 
> union
> 
>   box { <0,0,0>,<1,9,1>}
>   box { <0,0,0>,<6,1,1.0001> }
> 
> That will solve the problem.

Thanks, but I know the 'coincident surface' problem. But the problem is
elsewere. I explain:
Here is a YZ view:


                         0   0.5     1     1.5   Z->
                             ______________
                         ____|_______     |          ^
O ---------------------> |   |      |     |          |
                         -----------      |          Y
                         ^   |____________| <-
                         |                    |
camera           _  part of L               panel


I hope it is understandable, but the best is to render the scene, and
view it under different points of view.
The coincidence problem appears at Z=1, because POV doesn't know whether
the ray will intersect with the first or the second box composing the L.
In fact, there is no problem, as both surfaces have the same textures
properties. Anyway, I tried your solution, and it didn't work.

The true problem is that POV detects some intersections at Z=0.5. He
shouldn't, as this point is INSIDE the L.

So, I think this may be a true bug, and not a 'known feature' ;-)
Does anybody have any ideas ?


Post a reply to this message

From: Michael Lundahl
Subject: Re: csg bug ?
Date: 18 May 1998 05:17:49
Message: <6joubt$6jq$1@oz.aussie.org>
Sorry, but I think twyst is right, it is a 
coinciding surface-problem, his solution is just not quite right. 
Try this:

 // The 'L'
 union {
  box {<0,0,0>, <1,9,1>}
  box {<0.00000001,0.00000001,0.00000001>, <6,1,0.99999999>}

I can't get the white snow-effect you described on my copy of POV
(x-povray 3.02 for UNIX) but I do get a coinciding curface problem, making
the corner itself completely white and the edges of the corner 
red-speckled. Very strange effect.

Best if luck :)

/Michael


Post a reply to this message

From: Deneux Johann
Subject: Re: csg bug ?
Date: 18 May 1998 15:08:09
Message: <35608719.75B413FA@club-internet.fr>
Michael Lundahl wrote:

> Sorry, but I think twyst is right, it is a
> coinciding surface-problem, his solution is just not quite right.

Yes he is.

> Try this:
>
>  // The 'L'
>  union {
>   box {<0,0,0>, <1,9,1>}
>   box {<0.00000001,0.00000001,0.00000001>, <6,1,0.99999999>}
>
> /Michael

 Thanks to you, I've noticed I made a mistake by describing the problem in my
answer to twyst. Indeed, the 'snow' doesn't appear at Z=0.5, as I was
thinking, but at Z=1, what is normal (this is not a bug, and will never be).
What is surprising is that I see a mixture of red and white points at Z=1.
Let's try to become POV:
"I launch a ray. Who does this ray intersect with ?
    1 It intersects with the bounding-box. We have to continue
    2 It intersects with the panel at Z=0.5. Mhh, this is in the L. I won't
keep this intersection
    3 It intersects with both L-boxes at Z=0. This is not in the panel. Won't
keep
    4a It intersects with the vertical box ( | part of the L ) at Z=1. Ok, I
keep it.
    4b It intersects with the horizontal box ( _ part of the L ) at Z=1. Ok,
I keep it.
    ...
I look for the nearest intersection..."
Here is the problem: both intersections are at the same location. So, will
the color be the first or the second box color ?
But there should'nt be any problem, as both colors are same. Where do the
white points come from ? This could eventually be the panel, if its bottom
had been at Z=1. But it's not the case.

                         0   0.5     1     1.5   Z->
                             ______________
                         ____|_______     |          ^
O ---------------------> |   |      |     |          |
                         -----------      |          Y
                         ^   |____________| <-
                         |                    |
camera           _  part of L               panel


Did I say something wrong ?
This is quite imortant. As you can guess, I'm making something a little bit
more complicated that a simple L. And the same problem appears at each corner
of my logo. I really would like not to have to put some 0.00000001,
0.999999999 everywhere. I should only have to be careful with using colors.

Sorry if my posts are a little bit long, but it is not easy to make clear
explanations (I'm not english and drawings are not easy to do in ascii !!!)

--
______________________________________________________

Page perso: http://www.club-internet.fr/perso/deneux


Post a reply to this message

From: Mike Hough
Subject: Re: csg bug ?
Date: 18 May 1998 17:41:54
Message: <3560AB22.299B97AA@aol.com>
I don't think there is anyway around it, but a super quick fix is:

#include "colors.inc"

/* Prints a 'L' in a white pannel */
difference {
 // The panel
 box {<-1,-1,0.5>, <17,12,2>}
 // The 'L'
 union {
  box {<0,0,0>, <1,9,1>}
  box {<1,0,0>, <6,1,1>}  //fix the coincidence surface

  pigment { color Red } // To see the L print
 }
 pigment { color White }
}

light_source {
 <8.5,5,-40>
 color White
 shadowless
}

// The camera looks into the 'L''s corner
camera {
 location <0.5,0.5,-2.5>
 direction z
 right x/3
 up y/3
}

Just don't have the objects in the union overlap the same space and you won't
have a problem.  The docs say that it is a numerical problem and makes no
distinction as to whether or not colors are the same.  I get the impression that
the problem is in POV finding surfaces and two surfaces occupying the same space
causes the background to show through, regardless of the color.

Deneux Johann wrote:

>     ...
> I look for the nearest intersection..."
> Here is the problem: both intersections are at the same location. So, will
> the color be the first or the second box color ?
> But there should'nt be any problem, as both colors are same. Where do the
> white points come from ? This could eventually be the panel, if its bottom
> had been at Z=1. But it's not the case.
>


Post a reply to this message

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