reb
Class REB_SpokesNRings
Object
common:Generic
common:TrapShape
reb:REB_SpokesNRings
class
- TrapShape:REB_SpokesNRings
This trap creates rings and spokes shapes.
It can also be used as a texture
Ultra Fractal Source
Toggle UF Source Code Display
class REB_SpokesNRings(common.ulb:TrapShape) {
; This trap creates rings and spokes shapes. <br>
; It can also be used as a texture
;
public:
import "common.ulb"
; constructor
func REB_SpokesNRings(Generic pparent)
TrapShape.TrapShape(pparent)
endfunc
; call for each iterated point
float func Iterate(complex pz)
TrapShape.Iterate(pz)
float dist = cabs(pz)
float theta = atan2(pz)
if theta < 0
theta = theta + 2*#pi
endif
if theta > 2*#pi
theta = 2*#pi
endif
float wedge = 2*#pi/@spokes
float swidth = @swidth
if swidth >= wedge
swidth = wedge
endif
if @type == "Spokes"
if @spiralize
if (theta+@twist*dist) % wedge < (theta+@twist*dist+swidth) % wedge
dist = 1e20
pz = (1e20,1e20)
endif
else
if theta % wedge < (theta+swidth) % wedge
dist = 1e20
pz = (1e20,1e20)
endif
endif
elseif @type == "Rings"
if dist % (1/@dens) < (dist+0.5*@rwidth/@dens) % (1/@dens)
dist = 1e20
pz = (1e20,1e20)
endif
endif
m_lastZ = pz
return dist
endfunc
protected:
default:
title = "Spokes N Rings"
int param v_spokesnrings
caption = "Version (Trap Shape Spokes N Rings)"
default = 100
hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used."
visible = @v_spokesnrings < 100
endparam
param type
caption = "Trap Type"
default = 0
enum = "Spokes" "Rings"
endparam
int param spokes
caption = "# of Spokes"
default = 5
visible = @type == "Spokes"
endparam
float param swidth
caption = "Spoke thickness"
default = 1
visible = @type == "Spokes"
endparam
bool param spiralize
caption = "Spiral spokes"
default = false
visible = @type == "Spokes"
endparam
float param twist
caption = "Amount of twist"
default = 1
visible = @type == "Spokes" && @spiralize
endparam
float param dens
caption = "Ring density"
default = 20
visible = @type == "Rings"
endparam
float param rwidth
caption = "Ring thickness"
default = 1
visible = @type == "Rings"
endparam
}
Methods inherited from class Object |
|
REB_SpokesNRings
public REB_SpokesNRings(Generic pparent)
- constructor
REB_SpokesNRings
public REB_SpokesNRings()
Iterate
public float Iterate(complex pz)
- call for each iterated point
- Overrides:
Iterate
in class TrapShape