返回列表 回复 发帖
3.jpg
1.jpg
2.jpg
我的UF作品:
7.jpg
6.jpg
Slope Sierpinski Triangle II(20140102).gsp (21.78 KB)
几何画板也不错,就是速度跟不上:

5.jpg (25.47 KB)

5.jpg

45# 榕坚
请问榕老师,画板造时,M集的等势圈将谢尔宾斯基陷阱遮住,如何处理?这个问题困挠了好久,我就是将M集用光滑作色也不能解决问题。
46# 柳烟


颜色调整尽量淡化掉等势圈。
47# 榕坚
淡化掉怕不成,因为等势圈遮住了谢尔宾斯基陷阱。我以前就弄过,弄来弄去,就象是UF中的这个效果:
4.jpg
如果加大阈值,将完全遮住作为陷阱的谢尔宾斯基三角形。
48# 柳烟


上图中我只用了et判断M集内部着黑色,其它地方与et无关。可以参考一下UF中
mt-sierpinski-trap {
; Mark Townsend, 15 Oct 1999
;
; iteration trap inserted by red williams 17 November 1999
;
init:
  trap_z = 0
  int iter = 0
  int frm_iter = 0
  int trap_iter = 0
  float dist = 0
  float min_dist = 1e30
  int res = 0
  int lowtrap = abs(round(real(@itrap) * #maxiter))
  int hightrap = abs(round(imag(@itrap) * #maxiter))
  if lowtrap > hightrap
    res = lowtrap
    lowtrap = hightrap
    hightrap = res
  endif
loop:
  w = (#z + @start) / (@scale + flip(@scale))
; Iterate the Sierpinski formula
  frm_iter = 0
  while frm_iter < @max_iterations
    if (imag(w) > 0.5)
      w = @a * real(w) + flip(@a * imag(w) -1)
    elseif (real(w) > 0.5)
      w = @a * real(w) -1 + flip(@a * imag(w))
    else
      w = @a * real(w) + flip(@a * imag(w))
    endif
    frm_iter = frm_iter + 1
  endwhile
  dist = cabs(@fn1(w))
  if dist < min_dist
    min_dist = dist
    trap_z = #z
    trap_iter = iter
  endif
  iter = iter + 1
final:
  if @coloring == 0
    #index = 0.001 * min_dist
  elseif @coloring == 1
    #index = cabs(trap_z)
  elseif @coloring == 2
    #index = 0.01 * trap_iter
  elseif @coloring == 3
    #index = abs(real(trap_z))
  elseif @coloring == 4
    #index = abs(imag(trap_z))
  elseif @coloring == 5
    float a = atan2(trap_z)
    if a < 0
      a = a + 2 * #pi
    endif
    a = 1 / (2 * #pi) * a
    #index = a
  endif  
  if !((#numiter >= lowtrap) && (#numiter <= hightrap))
    if @opt == 1
      #solid = true
    endif
  elseif (#numiter >= lowtrap) && (#numiter <= hightrap)
    if @opt == 0
      #solid = true
    endif
  endif
default:
  title = "Sierpinski Trap"
  param coloring
    caption = "Coloring"
    enum = "Distance" "Magnitude" "Iteration" "Real" "Imag" "Angle"
  endparam
  param a
    caption = "Parameter"
    default = 2.0
  endparam  
  param max_iterations
    caption = "Iterations"
    default = 10
  endparam  
  param start
    caption = "Offset"  
    default = (0,0)
  endparam  
  param @scale
    caption = "Scale"
    default = 1.0
  endparam
  param itrap
    caption = "Iter. trap limits"
    hint = "Between 0.0 and 1.0 (fraction of Maximum Iterations).\
            Real part is lower boundary of trap and Imaginary \
            part, the upper boundary.  Pixels between these limits \
            are colored according to Solid/Normal Choice."
    default = (0.0,1.0)
  endparam
  param opt
    caption = "Iter. trap mode"
    enum = "Solid" "Normal"
    default = 1
  endparam   
  func fn1
    caption = "Function"
    default = ident()
  endfunc  
}
用 dist着色
3.jpg
J集一个.gsp (18.59 KB)
这个J集造出埃舍儿盘一定好看,可惜,造不出。
返回列表