POV-Ray : Newsgroups : povray.bugreports : Epsilon in wrong direction in shapes3.inc Server Time
22 Dec 2024 06:17:31 EST (-0500)
  Epsilon in wrong direction in shapes3.inc (Message 1 to 2 of 2)  
From: Ard
Subject: Epsilon in wrong direction in shapes3.inc
Date: 2 Oct 2014 05:10:01
Message: <web.542d149f18cce87bb6820d7a0@news.povray.org>
If I'm reading it correctly, the Segment_of_* macros in shapes3.inc shave tiny
slices off the object as well as removing the pie-piece one expects.  They are
unnoticeably small, except maybe to us obsessives.

Here's a patch to Segment_of_CylinderRing():

--- shapes3.inc.orig    2014-10-02 21:53:08.933523600 +1300
+++ shapes3.inc 2014-10-02 21:53:06.189366100 +1300
@@ -174,11 +174,11 @@
   merge{
   #end // then use merge!

-   box { <-R_o+D,-D,0>,< R_o+D, H+D, R_o+D>
+   box { <-(R_o+D),-D,0>,< R_o+D, H+D, R_o+D>
          rotate<0,0,0>
        }// end of box

-   box { <-R_o+D,-D,-R_o+D>,< R_o+D, H+D,0>
+   box { <-(R_o+D),-D,-(R_o+D)>,< R_o+D, H+D,0>
          rotate<0,  Segment_Angle,0>
        }// end of box

It looks like other macros in shapes3 are affected similarly.

Great macros in there, by the way.


Post a reply to this message

From: Friedrich
Subject: Re: Epsilon in wrong direction in shapes3.inc
Date: 8 Oct 2014 05:05:16
Message: <5434fe4c$1@news.povray.org>
Am 02.10.2014 11:08, schrieb Ard:
> If I'm reading it correctly, the Segment_of_* macros in shapes3.inc shave tiny
> slices off the object as well as removing the pie-piece one expects.  They are
> unnoticeably small, except maybe to us obsessives.
>
> Here's a patch to Segment_of_CylinderRing():
>
> --- shapes3.inc.orig    2014-10-02 21:53:08.933523600 +1300
> +++ shapes3.inc 2014-10-02 21:53:06.189366100 +1300
> @@ -174,11 +174,11 @@
>     merge{
>     #end // then use merge!
>
> -   box { <-R_o+D,-D,0>,< R_o+D, H+D, R_o+D>
> +   box { <-(R_o+D),-D,0>,< R_o+D, H+D, R_o+D>
>            rotate<0,0,0>
>          }// end of box
>
> -   box { <-R_o+D,-D,-R_o+D>,< R_o+D, H+D,0>
> +   box { <-(R_o+D),-D,-(R_o+D)>,< R_o+D, H+D,0>
>            rotate<0,  Segment_Angle,0>
>          }// end of box
>
> It looks like other macros in shapes3 are affected similarly.
>
> Great macros in there, by the way.
Thank you very much!
>

Your right! "-R_o+D" should be replaced by "-(R_o+D)" or "-R_o-D".
Normally this error is only theoretical and not to see (much too
small!).
It not easy to make the problem visible, but I found
a trick by scaling down and up with extreme values:

//----------------------------------------------------------
#include "shapes3.inc"
#declare S = 100000; // scale for scaling down and up
#declare Rc = 1/S;
//---------------------------------------------------------
object{ Segment_of_CylinderRing( Rc, // major radius,
                                  Rc/2, // minor radius,
                                  Rc/2, // height H,
                                  300  // angle (in degrees)
                                ) //-------------------------
         pigment{ color rgb<0.6,1,0>}
         scale <1,1,1>*S
         rotate<0,90,0>
       } // end of object
//----------------------------------------------------------

I made an update of shapes3.inc and placed it on my homepage:
http://www.f-lohmueller.de/pov_tut/down/insert_a.htm

Note: Extreme scaling/sizes with macros that use the torus object
will surely cause similar problems too.
Because of the difficult caculations, torus is very sensitiv for
rounding errors - and every scaling can cause additional errors.
So the above method will show errors sometimes with a scale factor
of 1000 or less.

Friedrich
// home: http://www.f-lohmueller.de/


Post a reply to this message

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