Great stuff Matthias!
I only shortly dived into the script, it is clean and quite easy to understand!
What is clear is that very soon a favourite topic will be The Compression Function!
One that I use often for same purposes is : (a + b * tanh((x-a) / b))
Its trigonometric elegance is hard to beat: https://www.desmos.com/calculator/tl2aqicg25. I added yours too (( -1 / (( x - a ) / ( 1 - a ) +1 ) +1 ) * ( 1 - a ) + a
).
Nuke variant for those willing to try, it is a great utility function:
set cut_paste_input [stack 0]
version 12.1 v1
push $cut_paste_input
Expression {
expr0 "r > a_Floating_Point_Slider ? a_Floating_Point_Slider + b_Floating_Point_Slider * tanh((r - a_Floating_Point_Slider) / b_Floating_Point_Slider) : r"
expr1 "g > a_Floating_Point_Slider ? a_Floating_Point_Slider + b_Floating_Point_Slider * tanh((g - a_Floating_Point_Slider) / b_Floating_Point_Slider) : g"
expr2 "b > a_Floating_Point_Slider ? a_Floating_Point_Slider + b_Floating_Point_Slider * tanh((b - a_Floating_Point_Slider) / b_Floating_Point_Slider) : b"
name Compression_Expression1
selected true
xpos 3060
ypos 1087
addUserKnob {20 User}
addUserKnob {7 a_Floating_Point_Slider l a}
a_Floating_Point_Slider 0.76
addUserKnob {7 b_Floating_Point_Slider l b}
b_Floating_Point_Slider {{"1 - a_Floating_Point_Slider"}}
}
I noticed that 5 and 6 blow with the Grasshoper Cornell Box image, haven’t tried to figure out why yet:
Cheers,
Thomas