POV-Ray : Newsgroups : povray.beta-test.binaries : Function / Pattern issues. New function f_eblob(). Server Time
26 Apr 2024 05:34:08 EDT (-0400)
  Function / Pattern issues. New function f_eblob(). (Message 1 to 1 of 1)  
From: William F Pokorny
Subject: Function / Pattern issues. New function f_eblob().
Date: 22 Nov 2019 10:36:12
Message: <5dd8006c$1@news.povray.org>
A new inbuilt 'f_eblob' function continuing work documented in the 
previous threads:

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

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

and

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


The idea of using exp() to blob has been around a long time in different 
forms. Maybe 15 years ago, give or take, Tor Olav posted the idea of 
using a 1/exp(S*T) form where the tightness (T) was specified for each 
function providing a value(S). I've used the method and in many 
situations it works - though the gradients tend to get quite high and I 
find myself always twiddling with the starting threshold values.

Of late working to better formulate a complete method in an inbuilt 
f_eblob function.  It's currently set up to be used something like:

#declare FnBlob00 = function (x,y,z,Mode,Tightness) {
   f_eblob(0.001,4,Mode,
   FnSph00(x,y,z),FnSph01(x,y,z),
   FnSph02(x,y,z),FnSph03(x,y,z),0,0,0,0,
   Tightness,Tightness,Tightness,Tightness,0,0,0,0)
}

where the arguments are:

1) +- offset between two 1/exp() evaluations which helps greatly with 
the gradients and provides a way to calculate and initial value to which 
the internal negative blobbing contributions are added. Finding 0.001 
perfectly fine so far.

2) The number of active incoming functions / shapes from 1-8.

3) The modes. 0 calculates a blobbed value from all the function input 
values and strengths. 1 calculates an all pairwise, most negative, 
interpolation to come up with pattern *_map values. The maps have a 
particular form - similar to the tiling patterns - and for the 4 
functions / shapes version it looks something like:

#declare ColorMap01 = color_map {
     [0.000000 ColorPositive]
     [0.142857 ColorFn00]
     [0.285714 ColorFn01]
     [0.285714 ColorFn00]
     [0.428571 ColorFn02]
     [0.428571 ColorFn00]
     [0.571429 ColorFn03]
     [0.571429 ColorFn01]
     [0.714286 ColorFn02]
     [0.714286 ColorFn01]
     [0.857143 ColorFn03]
     [0.857143 ColorFn02]
     [1.000000 ColorFn03]
}

A value of exactly 1.1 provides some debugging feedback by turning off 
interpolation where the function/shape is itself negative enough to 
overcome the internal threshold. Values >1.1 and <=6.0 currently do a 
poly_wave pow() type of interpolation.

4-11) Are the function value inputs.
12-19) Are the match tightness values >0.0 to 100.0.

The function f_eblob expects the incoming function/shape thresholds to 
be at 0.0 - which is usually true.

With reference to the attached image:

--- Row 1
A) Four spheres. Tightness set to 0 to see the original shapes.
B) at 7.5.
C) at 15.
D) at 30.

--- Row 2
E) Tightness at 10 and the isosurface enclosing box cutting a slice to 
show mode 1.0 (linear) color interpolation for the 4 spheres. There are 
discontinuities due the underlying pairwise pattern value interpolation.

F) Like E but using debug mode 1.1 to see where the original spheres are.

G) Mode set to 2.0 for poly_wave like interpolation extending the pair 
end point colors.

H) Mode set to 6.0. The >1.1 to 6.0 pow() interpolation minimizes the 
pairwise effects.

--- Row 3
I-J) Showing VarS / Tightness at 25.0 and 2,3,4,5 powers left to right. 
For many situations looks like the map value generation will work out 
OK. Anywhere the blobbing ends up more or less pairwise applied should 
be fine.

--- Row 4
M) Yes, negative tightness values can be used.

N) The tightness values need not be the same. The top and bottom spheres 
using 1/2 the left and right tightness.

O) The top and bottom using 2x the left and right tightness.

P) All values equal. Showing where spheres overlap the ordering for the 
map color is sorted by pairs. The red-green, most negative pair is 
evaluated first - though other pairings have the same negative values at 
some positions.

--- Row 5 (bottom row)
Showing various blobbing using f_rounded_box() instead of 'f_sphere()'.

Bill P.


Post a reply to this message


Attachments:
Download 'f_eblobstory.png' (236 KB)

Preview of image 'f_eblobstory.png'
f_eblobstory.png


 

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