|
![](/i/fill.gif) |
"Tek" <tek### [at] evilsuperbrain com> wrote:
> That's a very different approach to what I'm doing. Though the results look
> nice.
For the more artistic matter, here are two different function blob macros of
mine. If you want to create a surface that is as smooth as possible, the
exponential blob is the right choice, but the final shape is hardly predictable,
so it's a bit of trial-and-error. The arctangent blob is less smooth, but it's
easier to handle, because the shapes do not change as much as in the first case.
The code:
// exponential blob
// fn_exp_blob (FUNCTION, FLOAT)
// fn_exp_blob_element (FUNCTION, FLOAT)
// [fn_exp_blob_element (FUNCTION, FLOAT)]
// ...
// fn_exp_blob_end ()
// param#2: threshold
#macro fn_exp_blob (fn_1, fn_th)
function {1 + fn_th - pow (fn_th, fn_1 (x, y, z))
#end
#macro fn_exp_blob_element (fn_1, fn_th)
- pow (fn_th, fn_1 (x, y, z))
#end
#macro fn_exp_blob_end ()
}
#end
// arctangent blob
// fn_atan_blob (FUNCTION, FLOAT)
// fn_atan_blob_element (FUNCTION, FLOAT)
// [fn_atan_blob_element (FUNCTION, FLOAT)]
// ...
// fn_atan_blob_end ()
// param#2: threshold
#macro fn_atan_blob (fn_1, fn_th)
function {(atan (fn_1 (x, y, z)/fn_th)
#end
#macro fn_atan_blob_element (fn_1, fn_th)
+ atan (fn_1 (x, y, z)/fn_th) - pi/2
#end
#macro fn_atan_blob_end ()
)/pi*2}
#end
You can use it like this:
#declare my_blob_function =
fn_exp_blob (function_1, threshold_1)
fn_exp_blob_element (function_2, threshold_2)
[fn_exp_blob_element (function_3, threshold_3)]
...
fn_exp_blob_end ()
Florian
Post a reply to this message
Attachments:
Download 'isosurface_blob.jpg' (120 KB)
Preview of image 'isosurface_blob.jpg'
![isosurface_blob.jpg](/povray.binaries.images/attachment/%3Cweb.4f54e9c4bc71efa9553e4e470%40news.povray.org%3E/isosurface_blob.jpg?preview=1)
|
![](/i/fill.gif) |