class Standard_TrapShapeRipples(common.ulb:TrapShape) {
public:
float func Iterate(complex pz)
float d
if @style == "Ring"
d = cabs(pz)
if d < @traporder
d = cos(d * (@trapfreq*#pi)) * sqr(1-d/@traporder)
else
d = 0
endif
elseif @style == "Grid"
d = cabs(pz)
if d < @traporder
d = (cos(real(pz)*(@trapfreq*#pi)) + cos(imag(pz)*(@trapfreq*#pi))) * sqr(1-d/@traporder) * 0.5
else
d = 0
endif
else ; Radial
d = atan2(pz)
float d2 = cabs(pz)
if d2 < @traporder
d = cos(4 * d * @trapfreq) * sqr(1-d2/@traporder)
else
d = 0
endif
endif
return d
endfunc
default:
title = "Ripples"
int param style
caption = "Style"
enum = "Ring" "Grid" "Radial"
default = 0
hint = "Chooses between various types of ripples."
endparam
float param traporder
caption = "Height"
default = 4
hint = "This is the height of the ripples."
endparam
float param trapfreq
caption = "Frequency"
default = 1
hint = "This is the frequency of the ripples."
endparam
}