POV-Ray : Newsgroups : povray.advanced-users : Paraboloid with thickness : Re: Paraboloid with thickness Server Time29 Feb 2024 22:54:24 EST (-0500)
 Re: Paraboloid with thickness
 From: Cousin Ricky Date: 28 Jan 2021 21:13:16 Message: <60136f3c\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#60136f3c%241%40news.povray.org",
"dateCreated": "2021-01-29T02:13:16+00:00",
"datePublished": "2021-01-29T02:13:16+00:00",
"author": {
"@type": "Person",
"name": "Cousin Ricky"
}
}
On 2021-01-26 3:56 AM (-4), Mike Horvath wrote:
> How would I create a paraboloid with thickness N?
>
> I'm guessing I need need to create an offset surface of some sort. Does
> it need to be an isosurface?

My immediate thought was that this is a job for the quadric primitive.
Alas, after two days of weird results, it became clear that the quadric
has bounding pathologies, even in POV-Ray 3.8.  I knew there was a bug
in 3.7's quadric--in fact, I discovered it; but whatever was done to fix
it hasn't completely resolved the bounding issues.

However, I found that poly { 2 } does not have these problems.

The following code creates a paraboloid with the apex downward, apex at
the origin, radius R, height H, and wall thickness T:

----------[BEGIN CODE]----------
// parameters
#declare R = ;
#declare H = ;
#declare T = ;

// derived
#declare A = H / pow (R, 2);
#declare T1 = (2 * H * T) / (sqrt (1 + pow (2 * H / R, 2)) * R);
#declare A1 = (H - T) / pow (R - T1, 2);

intersection
{ cylinder { 0, H * y, R }
poly { 2, <A, 0, 0, 0, 0, 0, -1, A, 0, 0> }
poly { 2, <-A1, 0, 0, 0, 0, 0, 1, -A1, 0, -T> }
}
-----------[END CODE]-----------

T1 is the horizontal component of the wall thickness at height H.  It
was derived by taking the derivative of the parabola in the x-y plane at
x and plugging it into the Pythagorean equation.

One thing I noticed about BayashiPascal's code is that the contained_by
box is much larger than the paraboloid.  All that extra volume slows
down the rendering of the isosurface, so you’ll want to tighten that up.
By using box { <-R, -_thickness / 2, -R>, <R, 5, R> } where R = sqrt
(5 + _thickness / 2), I was able to reduce the max_gradient to 6.4 and
cut 1/3 off the render time.
```