# =========================================================================== # # From: # # www.contextfreeart.org/gallery2/#design/4107 # # HEIGHT: 680 # WIDTH: 680 # # =========================================================================== #

startshape plant [ b .4] CF::Background = [h 40 sat .35 b -.8]

CF::Impure=1

depth=5 A1=22.5

shape plant {

loop 5 [x -.2..0.4 r  -5..10]
gras[s 5 z -10 sat 1 r 90]
mod [s .008 .005 r 90 hue 0 sat 0.7  x  -2.5 y -6  a -0.4]

}

shape gras { //Lindenmayergras X->F[+X]F+X

L(depth-1,2)[ r 0 h 110 ]

}

shape L(natural i, up) {

 if (i > 0 && up<=depth)
 { 
  leave[ h -40..40]
  L(i--1,up)[x 1 r  A1]    
  F1=.1..2.8
  leave[s F1 x  .8 h -40..40 ]
  L(i--1,up+1)[x (1+F1-.2)  r (-A1..-1.5*A1) z 1 b -.05 ]
  L(i--1,up+1)[x (1+F1-.2)  r (.1*A1..A1) z 1 b -.05 ]
}
 else {
  if (up>=depth)
  bloom[sat 1 b 1  s 4 h 220 x -.2]
 }

}

shape bloom {

leave [ r -25..0 h -70..-40 s .1 .5 a -.5] 
leave [h -50..-65  s .1 .5 a -.5 z 1]
leave[h -70..-40 r 20 s .1 .5 a -.5]

}

path leave {

MOVETO(0,0)
A=.2..0.4
CURVETO(1 , 0,   0.1.. 0.2, 0.012 .. 0.25,   0.6 .. 0.8 ,-0.05 ..0.08)
CURVETO(0,0,  0.2.. 0.5,-0.01 .. -0.2,   0.7..0.8, -0.01.. -0.14)
   CLOSEPOLY()
STROKE(.082,CF::IsoWidth+CF::RoundJoin)[b -.31]
FILL(CF::EvenOdd)[a 1 ]
CURVETO(1,0,  0.2.. 0.5, -0.01 .. 0.012,   0.7..0.8, -0.051.. 0.055)
STROKE(.004,CF::IsoWidth+CF::RoundJoin)[ b -0.6 ]

}

F(x1,y1)= mod((abs(x1)^0.7-abs(y1)^1.85),360)

vector2 P(X,Y)= let(S=1-1/(1.45*exp(((X/400)^2+(Y/400)^2)/0.25));X/S*4.5,Y/S*4.5)

shape mod {

loop row= -420, 420,.24 [  ]
loop col=-200, 200,.24 [  ] {
  p1=P(row,col)
  p1x=p1[0]
  p1y=p1[1] +cos(abs(col))*200
  SQUARE [s 4.5 y (abs(row)/100) h (-F(row,col)/5) x p1x p1y   b (2.9-F(row,col)/80)]
}

}

shape desk{

 loop 100 [b .02 y -.1] 
SQUARE[s 20 1 ]

}

path line(number x1, number y1, number height) {

MOVETO(x1 , y1)
CURVETO(x1, y1 + height, x1*1.5,  y1+ height/3, x1*2 , y1+ 2/3*height)
  STROKE(.04,CF::IsoWidth+CF::RoundJoin)[]

}

# runcfdg lindenmayergrassef2_pretty_flowers.cfdg