POV-Ray : Newsgroups : povray.bugreports : Intersection causes quadric to disappear : Re: Intersection causes quadric to disappear Server Time
27 Oct 2021 04:54:12 EDT (-0400)
  Re: Intersection causes quadric to disappear  
From: Le Forgeron
Date: 29 Jul 2015 16:22:41
Message: <55b93611$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Le 28/07/2015 00:53, Cousin Ricky a écrit :
> On 2015-07-27 02:10 PM (-4), Le_Forgeron wrote:
>> Confirmed on Ubuntu 15.04 too.
> 
> I have opened task #331 on FlySpray.
> 

I have it... you of course had to choose the sole kind of quadric that
get "optimized" bounding box in 3.7 : paraboloid.
(the 3 axes are impacted)

Before (3.6.1):

> if ((A == 0.0) && (D != 0.0) && (E != 0.0) && (H != 0.0) && (J ==
> 0.0)) { /* Get radii for lower x value. */
> 
> x = ClipMin[X];
> 
> ry1 = sqrt(fabs(2.0 * D * x / E)); rz1 = sqrt(fabs(2.0 * D * x /
> H));
> 
> /* Get radii for upper x value. */
> 
> x = ClipMax[X];
> 
> ry2 = sqrt(fabs(2.0 * D * x / E)); rz2 = sqrt(fabs(2.0 * D * x /
> H));
> 
> ry = max(ry1, ry2); rz = max(rz1, rz2);
> 
> NewMin[Y] = -ry; NewMin[Z] = -rz; NewMax[Y] = ry; NewMax[Z] = rz; 
> }

After (3.7):

> if ((A == 0.0) && (D != 0.0) && (E * H > 0.0) && (J == 0.0)) { /*
> Get radii for lower x value. */
> 
> x = D * E < 0 ? max(0., ClipMin[X]) : ClipMin[X];
> 
> ry1 = sqrt(fabs(2.0 * D * x / E)); rz1 = sqrt(fabs(2.0 * D * x /
> H));
> 
> /* Get radii for upper x value. */
> 
> x = D * E > 0 ? min(0., ClipMax[X]) : ClipMax[X];
> 
> ry2 = sqrt(fabs(2.0 * D * x / E)); rz2 = sqrt(fabs(2.0 * D * x /
> H));
> 
> ry = max(ry1, ry2); rz = max(rz1, rz2);
> 
> if (D*E < 0) NewMin[X] = max(0., ClipMin[X]); NewMin[Y] = -ry; 
> NewMin[Z] = -rz; if (D*E > 0) NewMax[X] = min(0., ClipMax[X]); 
> NewMax[Y] = ry; NewMax[Z] = rz; }

The object has been translated to the origin, the 3.6 version only
reduced the "diameter" of the paraboloid. 3.7 is more ambitious... and
fails with a bounding box that has a null dimension.

When used alone, the paraboloid bounding box is ok in 3.7 (because the
evaluation of radius is above critical length, the bounding box is
reset to infinity, so tracing is fine.

But used in an intersection, the null bounding box is kept, due to the
other objects bounding box being smaller than infinity, and nothing is
traced.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iJwEAQEIAAYFAlW5NhAACgkQhKAm8mTpkW34pgP/ZuSHPbVrmsgbDO4K0xFW+hOi
XYTs4lkYTyNGa6eFQs3TWppbldNavyLtKI6eAjs7u/VrMT9NmsdXzva7Bc7iXx5H
GcvNUyRXVcY1mRLZegksJPxEVMsqFr7uviL728lHBFObnDdYZq2KhnBpqLL3ziJv
OYKtLplqwOQdp36Ph44=
=tCeX
-----END PGP SIGNATURE-----


Post a reply to this message

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