1643 Thorn

(meta linear-colour-space: 1)

(render)

(define
  coords1 [{[197.939 248.772] (gen/stray-2d from: [197.939 248.772] by: [5 5])}
           {[-215.425 216.750] (gen/stray-2d from: [-215.425 216.750] by: [5 5])}
           {[-54.486 -482.268] (gen/stray-2d from: [-54.486 -482.268] by: [5 5])}
           {[404.679 42.754] (gen/stray-2d from: [404.679 42.754] by: [5 5])}]

  coords2 [{[-122.680 244.652] (gen/stray-2d from: [-122.680 244.652] by: [5 5])}
           {[-365.528 -464.579] (gen/stray-2d from: [-365.528 -464.579] by: [5 5])}
           {[15.679 11.122] (gen/stray-2d from: [15.679 11.122] by: [5 5])}
           {[393.507 435.063] (gen/stray-2d from: [393.507 435.063] by: [5 5])}]

  coords3 [{[-95.378 -243.923] (gen/stray-2d from: [-95.378 -243.923] by: [5 5])}
           {[-144.800 -267.084] (gen/stray-2d from: [-144.800 -267.084] by: [5 5])}
           {[301.580 407.739] (gen/stray-2d from: [301.580 407.739] by: [5 5])}
           {[-461.750 430.848] (gen/stray-2d from: [-461.750 430.848] by: [5 5])}]


  col-fn-1 (col/build-procedural a: {[0.365 0.644 0.588] (gen/stray-3d from: [0.365 0.644 0.588] by: [0.1 0.1 0.1])}
                                 b: {[0.191 0.644 0.828] (gen/stray-3d from: [0.191 0.644 0.828] by: [0.1 0.1 0.1])}
                                 c: {[0.891 0.506 0.301] (gen/stray-3d from: [0.891 0.506 0.301] by: [0.1 0.1 0.1])}
                                 d: {[0.364 0.308 0.389] (gen/stray-3d from: [0.364 0.308 0.389] by: [0.1 0.1 0.1])}
                                 alpha: 0.08)
  col-fn-2 (col/build-procedural a: {[0.567 0.021 0.336] (gen/stray-3d from: [0.567 0.021 0.336] by: [0.1 0.1 0.1])}
                                 b: {[0.513 0.408 0.543] (gen/stray-3d from: [0.513 0.408 0.543] by: [0.1 0.1 0.1])}
                                 c: {[0.454 0.424 0.265] (gen/stray-3d from: [0.454 0.424 0.265] by: [0.1 0.1 0.1])}
                                 d: {[0.465 0.991 0.831] (gen/stray-3d from: [0.465 0.991 0.831] by: [0.1 0.1 0.1])}
                                 alpha: 0.08)
  col-fn-3 (col/build-procedural a: {[0.826 0.082 0.052] (gen/stray-3d from: [0.826 0.082 0.052] by: [0.1 0.1 0.1])}
                                 b: {[0.772 0.412 0.850] (gen/stray-3d from: [0.772 0.412 0.850] by: [0.1 0.1 0.1])}
                                 c: {[0.756 0.936 0.227] (gen/stray-3d from: [0.756 0.936 0.227] by: [0.1 0.1 0.1])}
                                 d: {[0.299 0.271 0.501] (gen/stray-3d from: [0.299 0.271 0.501] by: [0.1 0.1 0.1])}
                                 alpha: 0.08))

(fn (render)
  (wash colour: {(col/rgb r: 0.280 g: 0.696 b: 0.652 alpha: 0.749) (gen/col)})
  (on-matrix-stack
    (translate              vector: [(/ canvas/width 1) (/ canvas/height 2)])
    (scale                  scalar: 2)
    (repeat/rotate-mirrored fn: (address-of draw)
                            copies: {2 (gen/int min: 1 max: 3)})))

(fn (draw)
  (fence (t num: 200)
    (poly coords: [(interp/bezier t: t coords: coords1)
                   (interp/bezier t: t coords: coords2)
                   (interp/bezier t: t coords: coords3)]
          colours: [(col/value from: col-fn-1 t: t)
                    (col/value from: col-fn-2 t: t)
                    (col/value from: col-fn-3 t: t)])))

(fn (wash vol: 200
          line-width: 70
          line-segments: 5
          colour: (col/rgb r: 0.627 g: 0.627 b: 0.627 alpha: 0.4)
          seed: 272)
  (define
    w/3 (/ canvas/width 3)
    h/3 (/ canvas/height 3))
  (loop (d from: -20 to: 1020 inc: 20)
    (bezier tessellation: line-segments
            line-width: line-width
            coords: [[0            (wash-n x: 0            d: d seed: seed vol: vol)]
                     [w/3          (wash-n x: w/3          d: d seed: seed vol: vol)]
                     [(* w/3 2)    (wash-n x: (* w/3 2)    d: d seed: seed vol: vol)]
                     [canvas/width (wash-n x: canvas/width d: d seed: seed vol: vol)]]
            colour: colour)

    (bezier tessellation: line-segments
            line-width: line-width
            coords: [[(wash-n x: 0             d: d seed: seed vol: vol) 0]
                     [(wash-n x: h/3           d: d seed: seed vol: vol) h/3]
                     [(wash-n x: (* h/3 2)     d: d seed: seed vol: vol) (* h/3 2)]
                     [(wash-n x: canvas/height d: d seed: seed vol: vol) canvas/height]]
            colour: colour)))

(fn (wash-n x: 0 d: 0 seed: 0 vol: 1)
  (+ d (* vol (prng/perlin x: x y: d z: seed))))