1234567891011121314151617 |
- (add-to-load-path (dirname (dirname (current-filename))))
- (use-modules (basket))
- (define (sierpinski x y z n)
- (if (= n 0)
- `((,x ,y ,z))
- (append
- (sierpinski x (vec-midpoint x y) (vec-midpoint x z) (1- n))
- (sierpinski y (vec-midpoint y x) (vec-midpoint y z) (1- n))
- (sierpinski z (vec-midpoint z x) (vec-midpoint z y) (1- n)))))
- (define image
- `(fill
- ,(sierpinski '(0.5 . 0) '(0 . 1) '(1 . 1) 8)))
- (render-cairo-png image 1024 (cadr (program-arguments)))
|