POV-Ray : Newsgroups : povray.beta-test.binaries : Function / pattern issues. New inbuilt f_elliptical_sphrswp(). : Function / pattern issues. New inbuilt f_elliptical_sphrswp(). Server Time
28 Apr 2024 20:34:34 EDT (-0400)
  Function / pattern issues. New inbuilt f_elliptical_sphrswp().  
From: William F Pokorny
Date: 13 Jun 2020 15:32:09
Message: <5ee529b9$1@news.povray.org>
<---------------------- References. Twelve previous posts

http://news.povray.org/povray.beta-test.binaries/thread/%3C5ee4b9e3%40news.povray.org%3E/

and

http://news.povray.org/povray.beta-test.binaries/thread/%3C5ee4dc4b%241%40news.povray.org%3E/


To povr adding new f_elliptical_sphrswp(). As Cousin_Ricky has 
mentioned, it is not a match for an elliptical torus (supertoroid 1,1 
asymmetric a,b), but probably something useful. See attached images.

Of note the implementation is testing out a torus pre-filter - my f_dual 
idea to improve isosurface performance. Idea works for performance, but 
it introduces a gradient change away from the surface so there are 
always max gradient warnings. The actual gradient to use is always 
around 1.0 for the sweep itself. So, need to figure out smarter max 
gradient determination (near roots); Create a warning on/off option for 
isosurfaces(1) - or do both.

(2) - IIRC. Megapov had a warning on/off thingy.

#declare angleStart = 153;
#declare angleArc   = -137;

#declare Iso98 = isosurface {
     function {
         f_elliptical_sphrswp(x,y,z,ax,bz,r,angleStart,angleArc,0)
     }
...

#declare Pig00 = pigment {
     function {
         f_elliptical_sphrswp(x,y,z,ax,bz,r,angleStart,angleArc,1)
      }


f_elliptical_sphrswp()
----------------------
Parameters: x, y, z

Six extra parameter required:

1. The traditional a multiplier of the x axis.

2. The traditional b multiplier of the z axis.

3. The minor radius, r.

4. The starting angle. 0 to 360.

5. The arc angle from the start angle. -360 to 360.

6. 0 = sweep with optimization. 1 = return 0 to 1 map value matched to 
angular rotation of arc.  2 = skip up front in torus filter. (e.g. Using 
sweep values for map control)

Notes. Like the f_torus() function the f_elliptical_sphrswp() sits 
around the y axis at the origin.  In other words, it is sitting in the 
x,z plane.  Angles and directional angles are left handed about y.

With respect to isosurfaces; Gradients are decent, but due the internal 
method of calculation, performance is somewhat volatile. Larger r values 
tend to run more slowly. Rays more orthogonal to the y axis are slower - 
sometimes slower than a parametric representation.

The function is close to that of an elliptical torus - supertoroid with 
e1,e2 at 1.0 (spherical) and asymmetric x,z axis values.  Also this 
method has start and end points - arcs - there is less continuity / 
smoothness at the cap spheres than elsewhere in each arc.

Bill P.


Post a reply to this message


Attachments:
Download 'storyellipsphswp.jpg' (63 KB) Download 'storysupertoroidtoesweep.jpg' (35 KB)

Preview of image 'storyellipsphswp.jpg'
storyellipsphswp.jpg

Preview of image 'storysupertoroidtoesweep.jpg'
storysupertoroidtoesweep.jpg


 

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