|
 |
On 6/5/25 20:21, Kenneth wrote:
> Hey, I think I solved these problems-- by using min (...).
Ah. Well done. :-) I believe in clamping the maximum value to <1.0 you
are avoiding the pattern{} clamping / wrapping which otherwise occurs at
values over >= approximately 1.0.
Where the f_torus() values would normally go to <0.0 at the surface the
values are probably still getting wrapped to multiple roots. The
clamping at <1.0 can also lead to complications should you end up
combining FnTorusWarp() with other functions - including other
placements of itself, depending of stuff. Lastly, in using the 0.01
threshold, the surface (in cyan blue in the images) is at a slightly
different position than the original f_torus() surface would have
otherwise been.
Lets see... We can use yuqk to get a look at the original FnTorusWarp()
values in the top row of the attached image using raw_wave over
triangle_wave. In the middle row I commented raw_wave number 1 and
uncommented your triangle wave (result matches v3.8 b2 in this case
too). The bottom row of the image is your result in v3.8 b2 without
either raw_wave, but the same defined -5 to +5 color_map{} - of which
only 0-1 portion is used.
All that said, when getting a usable result for whatever the image's
aims - it's all good, no matter the details! "If it sounds good, it is
good" :-)
Bill P.
//---
#version 3.8;
#version unofficial 3.8; // yuqk
global_settings { assumed_gamma 1 }
#include "functions.inc"
#declare FnTorusWarp = function {
pattern {
function { f_torus(x,y,z, 8.0,2.5) }
//raw_wave //Number 1
triangle_wave
scale 2
warp{ turbulence .5 omega .001 }
scale 1/2
}
}
plane { -z, 0
pigment {
function { FnTorusWarp(x,y,0) }
raw_wave // Number 2
color_map {
[-5.0 rgb <1,0,0>]
[-1e-2 rgb <0,0,0>]
[+1e-2 rgb <0,1,1>]
[+2e-2 rgb <0,1,1>]
[+3e-2 rgb <0,0,0>]
[+5.0 rgb <0,1,0>]
}
}
finish { emission 1 }
}
#declare Cam = camera {}
camera { Cam translate -20*z}
//---
Post a reply to this message
Attachments:
Download 'kennethtorusstory.png' (321 KB)
Preview of image 'kennethtorusstory.png'

|
 |