POV-Ray : Newsgroups : povray.newusers : CSG difference and 2D vectors Server Time
1 Jul 2024 03:34:31 EDT (-0400)
  CSG difference and 2D vectors (Message 1 to 4 of 4)  
From: Vincent Chevrier
Subject: CSG difference and 2D vectors
Date: 26 Mar 1999 18:15:49
Message: <36FC1532.6F427660@club-internet.fr>
Hi everybody,
I'm a new user to POV-Ray and finally decided myself to ask for answers
on problems I discovered these last days.

-  CSG operation : I first thought about the "CSG pitfall" but it seems
to be a different configuration. I've got a box which is cut in the top
half by two other boxes. Why is the bottom half hollowed below the
intersection of the two smaller boxes? Here is some code for
understanding (remove the comment to see the effect) :
#version 3.1;
#include "colors.inc"
global_settings { assumed_gamma 1.0 }
camera {
   location  <70.0, 150.0, 150.0>
   look_at   <0.0, 70.0, 60.0>
}
light_source {
   <1000, 1000, 500>
   color White
}
light_source {
   <1000, 1000, -500>
   color White
}

difference {
   box { <0, 0, 0>, <42, 100, 119> pigment { color Red } }
   box { <4, 82, -10>, <38, 110, 130> pigment { color Blue } }
   //box { <-10, 82, 2>, <50, 110, 117> pigment { color Green } }
}
union {         // Positions of the 3 boxes
   box { <0, 0, 0>, <42, 100, 119> pigment { color Red } }
   box { <4, 82, -10>, <38, 110, 130> pigment { color Blue } }
   box { <-10, 82, 2>, <50, 110, 117> pigment { color Green } }
   translate <-60, 0, 0>
}
The bad effect disappears if one of the two boxes is raised by a small
amount. (OK, but I would like to understand :-)

- The second question deals with 2D vectors. Why is vlength(2*u)
different from vlength(VectA), with VectA=2*u? (u=<1, 0>)

#declare vectA = 2*u;
#declare vectB = <2, 0>;
#debug concat(str(vlength(2*u),1,1), "  -  ", str(vlength(vectA),1,1),
"  -  ", str(vlength(vectB),1,1))

gives :    2.0  -  3.5  -  3.5

Thanks for any explanation...


Post a reply to this message

From: Spider
Subject: Re: CSG difference and 2D vectors
Date: 26 Mar 1999 18:55:05
Message: <36FC1D56.90A66014@bahnhof.se>
Vincent Chevrier wrote:
> 
> Hi everybody,
> I'm a new user to POV-Ray and finally decided myself to ask for answers
> on problems I discovered these last days.
> 
<snip the csg> 
well, actually, I think it is the dual surface error, or something...

> - The second question deals with 2D vectors. Why is vlength(2*u)
> different from vlength(VectA), with VectA=2*u? (u=<1, 0>)
2 is promoted to <2,2,2,2,2>, or was it <2,2,2> ?
 
> #declare vectA = 2*u;
> #declare vectB = <2, 0>;
> #debug concat(str(vlength(2*u),1,1), "  -  ", str(vlength(vectA),1,1),
> "  -  ", str(vlength(vectB),1,1))
> 
> gives :    2.0  -  3.5  -  3.5
> 
> Thanks for any explanation...

-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: CSG difference and 2D vectors
Date: 26 Mar 1999 22:10:55
Message: <36fc4c3f.0@news.povray.org>
In article <36FC1532.6F427660@club-internet.fr> , Vincent Chevrier 
<vch### [at] club-internetfr>  wrote:

> - The second question deals with 2D vectors. Why is vlength(2*u)
> different from vlength(VectA), with VectA=2*u? (u=<1, 0>)
>
> #declare vectA = 2*u;
> #declare vectB = <2, 0>;
> #debug concat(str(vlength(2*u),1,1), "  -  ", str(vlength(vectA),1,1),
> "  -  ", str(vlength(vectB),1,1))
>
> gives :    2.0  -  3.5  -  3.5

I suppose you are using the Windows version, right?  Then it is likely a
Windows POV-Ray bug because on the Mac this prints as expected: three times
2.0.


    Thorsten


____________________________________________________
Thorsten Froehlich
e-mail: pov### [at] csicom

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://www.povray.org and
http://ourworld.compuserve.com/homepages/povraymac/


Post a reply to this message

From: Spider
Subject: Re: CSG difference and 2D vectors
Date: 26 Mar 1999 22:22:54
Message: <36FC4E04.357E0FF0@bahnhof.se>
actually, on my win 3.1e it gives :
-nan - 2.0 - 2.0 
So I think my first reply was a bit hasty.



-- 
//Spider
        [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
What I can do and what I could do, I just don't know anymore
                "Marian"
        By: "Sisters Of Mercy"


Post a reply to this message

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