reb
Class REB_TrapShapeLiar

Object
  extended by common:Generic
      extended by common:TrapShape
          extended by reb:REB_TrapShapeLiar

class 
TrapShape:REB_TrapShapeLiar

This shape uses the Liar formula of Chuck Ebbert. It is a texture shape.


Ultra Fractal Source

Toggle UF Source Code Display

 class REB_TrapShapeLiar(common.ulb:TrapShape) {
  ; This shape uses the Liar formula of Chuck Ebbert. It is a texture shape. <br>
  public:
    import "common.ulb"
 
 ; Constructor
    func REB_TrapShapeLiar(Generic pparent)
      TrapShape.TrapShape(pparent)
    endfunc
    
   ; Call this for each iteration being trapped.
    float func Iterate(complex pz)
     TrapShape.Iterate(pz)
     int sgn = 1
     if @sgn
       sgn = -1
     endif
     float x = real(pz)*@s
      float y = imag(pz)*@s
      float pxx = 0
      int att_iter = 0
 
      while att_iter < @max_att_iterations
        pxx = x
        if @liartype == 0
          if real(x + flip(pz)) < (@h1)
            x = @h2 - abs(y-x)
            y = abs(@h3 - pxx - y)
          endif
        elseif @liartype == 1
          if imag(x + flip(pz)) < (@h1)
            x = @h2 - abs(y-x)
            y = abs(@h3 - pxx - y)
          endif
        else
          if cabs(x + flip(pz)) < (@h1)
            x = @h2 - abs(y-x)
            y = abs(@h3 - pxx - y)
          endif
        endif
        att_iter = att_iter + 1
      endwhile
      m_LastZ = (x + sgn*flip(y))
      float d = @distscale*|pz-(x + sgn*flip(y))|
      return d
    endfunc
    
  default:
    title = "Liar"
   int param v_trapshapeliar
     caption = "Version (Trap Shape Liar)"
     default = 101
     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_trapshapeliar < 101
   endparam
    
    param liartype
      caption = "Liar type"
      default = 0
      enum = "real" "imag" "abs"
    endparam
    float param h1
      caption = "Liar 1"
      default = 1
    endparam
    float param h2
      caption = "Liar 2"
      default = 1
    endparam
    float param h3
      caption = "Liar 3"
      default = 1
    endparam
    float param distscale
      caption = "Distance scale"
      default = 1
    endparam
    float param s
      caption = "Attractor scale"
      default = 0.05
    endparam
    int param max_att_iterations
      caption = "Attractor iterations"
      default = 20
    endparam
    bool param sgn
      caption = "Conjugate transform"
      default = false
    endparam
  }
 


Constructor Summary
REB_TrapShapeLiar()
           
REB_TrapShapeLiar(Generic pparent)
          Constructor
 
Method Summary
 float Iterate(complex pz)
          Call this for each iteration being trapped.
 
Methods inherited from class common:TrapShape
GetColorChannel, GetTextureValue, GetTransformedPoint, Init, IterateSilent, SetThreshold
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

REB_TrapShapeLiar

public REB_TrapShapeLiar(Generic pparent)
Constructor


REB_TrapShapeLiar

public REB_TrapShapeLiar()
Method Detail

Iterate

public float Iterate(complex pz)
Call this for each iteration being trapped.

Overrides:
Iterate in class TrapShape