Browse Source

updated some sketches with terser syntax

master
Inderjit Gill 5 months ago
parent
commit
2ebb24382d
2 changed files with 71 additions and 76 deletions
  1. +55
    -60
      server/static/seni/sketch/1924-hand-submission.seni
  2. +16
    -16
      server/static/seni/sketch/1926-skull-face.seni

+ 55
- 60
server/static/seni/sketch/1924-hand-submission.seni View File

@@ -1,6 +1,3 @@
(meta linear-colour-space: 1)


(define
texture "hand.png"
bmx (interp/build from: [0 canvas/width] to: [0 (bitmap/width from: texture)])
@@ -41,29 +38,29 @@

(fn (left-side x: 0 y: 0 w: 0 h: 0 colour: red strength: 1)
(define col (col/set-alpha value: strength
from: (col/set-e1 value: (* 100 strength)
from: (col/convert format: HSLuv from: colour))))
from: (col/set-e1 value: (* 100 strength)
from: (colour.col/convert format: HSLuv))))
(on-matrix-stack
(translate vector: [x y])
(rotate angle: (prng/value from: ra))
(left x: 0 y: 0 w: w h: h colour: col)
(rotate angle: (ra.prng/value))
(left x: 0 y: 0 w h colour: col)
(loop (i to: 3)
(scale scalar: sc)
(rotate angle: (prng/value from: ra))
(left x: 0 y: 0 w: w h: h colour: col))))
(rotate angle: (ra.prng/value))
(left x: 0 y: 0 w h colour: col))))

(fn (right-side x: 0 y: 0 w: 0 h: 0 colour: red strength: 1)
(define col (col/set-alpha value: strength
from: (col/set-e1 value: (* 100 strength)
from: (col/convert format: HSLuv from: colour))))
from: (col/set-e1 value: (* 100 strength)
from: (colour.col/convert format: HSLuv))))
(on-matrix-stack
(translate vector: [x y])
(rotate angle: (prng/value from: ra))
(right x: 0 y: 0 w: w h: h colour: col)
(rotate angle: (ra.prng/value))
(right x: 0 y: 0 w h colour: col)
(loop (i to: 3)
(scale scalar: sc)
(rotate angle: (prng/value from: ra))
(right x: 0 y: 0 w: w h: h colour: col))))
(rotate angle: (ra.prng/value))
(right x: 0 y: 0 w h colour: col))))

(fn (tri-lab alpha: 1)
(define
@@ -72,31 +69,25 @@
colour-scale {771 (gen/int min: 700 max: 900)}
colour-offset (prng/build min: -1 max: 1)
li (interp/build from: [0 1]
to: [{68 (gen/int min: 40 max: 120)}
{11 (gen/int min: 0 max: 70)}])
to: [{68 (gen/int min: 40 max: 120)} {11 (gen/int min: 0 max: 70)}])
rma (interp/build from: [0 canvas/width]
to: [{9 (gen/int min: -10 max: 30)}
{29 (gen/int min: -10 max: 30)}])
to: [{9 (gen/int min: -10 max: 30)} {29 (gen/int min: -10 max: 30)}])
rmb (interp/build from: [0 canvas/height]
to: [{96 (gen/int min: 60 max: 120)}
{8 (gen/int min: 0 max: 60)}]))
to: [{96 (gen/int min: 60 max: 120)} {8 (gen/int min: 0 max: 60)}]))

(loop (y from: 0 to: canvas/height inc: (* 2 h))
(loop (x from: 0 to: canvas/width inc: (* 4 w))
(define
col-bm (bitmap/value from: texture position: [(interp/value from: bmx t: x)
(interp/value from: bmy t: y)])
b (interp/value from: rmb t: (+ y (* (prng/value from: colour-offset) colour-scale)))
col-1 (col/lab l: (interp/value from: li t: (prng/value from: r))
a: (interp/value from: rma t: (+ x (* (prng/value from: colour-offset) colour-scale)))
b: b
alpha: alpha)
col-2 (col/lab l: (interp/value from: li t: (prng/value from: r))
a: (interp/value from: rma t: (+ x w (* (prng/value from: colour-offset) colour-scale)))
b: b
alpha: alpha))
(left-side x: x y: y w: w h: h colour: col-1 strength: (col/e0 from: col-bm))
(right-side x: (+ x w w) y: y w: w h: h colour: col-2 strength: (col/e0 from: col-bm)))))
col-bm (texture.bitmap/value position: [(bmx.interp/value t: x)
(bmy.interp/value t: y)])
strength (col-bm.col/e0)
l (li.interp/value t: (r.prng/value))
a (rma.interp/value t: (+ x (* (colour-offset.prng/value) colour-scale)))
b (rmb.interp/value t: (+ y (* (colour-offset.prng/value) colour-scale)))
col-1 (col/lab l a b alpha)
col-2 (col/lab l a b alpha))
(left-side x y w h colour: col-1 strength)
(right-side x: (+ x w w) y w h colour: col-2 strength))))

(fn (tri-hsl alpha: 1)
(define
@@ -112,15 +103,18 @@
(loop (y from: 0 to: canvas/height inc: (* 2 h))
(loop (x from: 0 to: canvas/width inc: (* 4 w))
(define
col-bm (bitmap/value from: texture position: [(interp/value from: bmx t: x)
(interp/value from: bmy t: y)])
b (interp/value from: fn-l t: (+ y (* (prng/value from: colour-offset) colour-scale)))
col-1 (col/hsl h: (interp/value from: fn-h t: (+ x (* (prng/value from: colour-offset) colour-scale)))
s: 1 l: b alpha: alpha)
col-2 (col/hsl h: (interp/value from: fn-h t: (+ x w (* (prng/value from: colour-offset) colour-scale)))
s: 1 l: b alpha: alpha))
(left-side x: x y: y w: w h: h colour: col-1 strength: (col/e0 from: col-bm))
(right-side x: (+ x w w) y: y w: w h: h colour: col-2 strength: (col/e0 from: col-bm)))))
col-bm (texture.bitmap/value position: [(bmx.interp/value t: x)
(bmy.interp/value t: y)])
strength (col-bm.col/e0)
s 1
l (fn-l.interp/value t: (+ y (* (colour-offset.prng/value) colour-scale)))

col-1 (col/hsl h: (fn-h.interp/value t: (+ x (* (colour-offset.prng/value) colour-scale)))
s l alpha)
col-2 (col/hsl h: (fn-h.interp/value t: (+ x w (* (colour-offset.prng/value) colour-scale)))
s l alpha))
(left-side x y w h colour: col-1 strength)
(right-side x: (+ x w w) y w h colour: col-2 strength))))


(fn (wash vol: 200
@@ -130,23 +124,24 @@
seed: 272)
(define
w/3 (/ canvas/width 3)
h/3 (/ canvas/height 3))
h/3 (/ canvas/height 3)
tessellation line-segments)
(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)))
(bezier tessellation
line-width
coords: [[0 (wash-n x: 0 d seed vol)]
[w/3 (wash-n x: w/3 d seed vol)]
[(* w/3 2) (wash-n x: (* w/3 2) d seed vol)]
[canvas/width (wash-n x: canvas/width d seed vol)]]
colour)
(bezier tessellation
line-width
coords: [[(wash-n x: 0 d seed vol) 0]
[(wash-n x: h/3 d seed vol) h/3]
[(wash-n x: (* h/3 2) d seed vol) (* h/3 2)]
[(wash-n x: canvas/height d seed vol) canvas/height]]
colour)))

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

+ 16
- 16
server/static/seni/sketch/1926-skull-face.seni View File

@@ -4,20 +4,20 @@
(address-of pass-1)])

(each (per-pixel-func from: per-pixel-funcs)
(bitmap/each from: texture
position: [500 500]
width: 1000
height: 1000
shuffle-seed: 321
fn: per-pixel-func))
(texture.bitmap/each position: [500 500]
width: 1000
height: 1000
shuffle-seed: 321
fn: per-pixel-func))

(fn (pass-0 colour: (col/rgb r: 0 g: 0 b: 0 alpha: 0) position: [100 100])
(define a (col/e0 from: colour)
(define
a (colour.col/e0)
angle (+ {6.37 (gen/stray from: 6.37 by: 2.00)} (* a math/PI)))
(line from: [(* {7.00 (gen/stray from: 7.00 by: 2.00)} (math/cos from: angle))
(* {12.00 (gen/stray from: 12.00 by: 2.00)} (math/sin from: angle))]
to: [(* {4.00 (gen/stray from: 4.00 by: 2.00)} (math/cos from: angle))
(* {-13.00 (gen/stray from: -13.00 by: 2.00)} (math/sin from: angle))]
(line from: [(* {7.00 (gen/stray from: 7.00 by: 2.00)} (angle.math/cos))
(* {12.00 (gen/stray from: 12.00 by: 2.00)} (angle.math/sin))]
to: [(* {4.00 (gen/stray from: 4.00 by: 2.00)} (angle.math/cos))
(* {-13.00 (gen/stray from: -13.00 by: 2.00)} (angle.math/sin))]
width: (- {12.50 (gen/stray from: 12.50 by: 2.00)} a)
brush: brush/d
brush-subtype: 1
@@ -25,12 +25,12 @@

(fn (pass-1 colour: (col/rgb r: 0 g: 0 b: 0 alpha: 0) position: [100 100])
(define
b (col/e2 from: colour)
b (colour.col/e2)
angle (+ {6.82 (gen/stray from: 6.82 by: 2)} (* b math/PI)))
(line from: [(* {14.00 (gen/stray from: 14.00 by: 2.00)} (math/cos from: angle))
(* {8.00 (gen/stray from: 8.00 by: 2.00)} (math/sin from: angle))]
to: [(* {10.00 (gen/stray from: 10.00 by: 2.00)} (math/cos from: angle))
(* {1.00 (gen/stray from: 1.00 by: 2.00)} (math/sin from: angle))]
(line from: [(* {14.00 (gen/stray from: 14.00 by: 2.00)} (angle.math/cos))
(* {8.00 (gen/stray from: 8.00 by: 2.00)} (angle.math/sin))]
to: [(* {10.00 (gen/stray from: 10.00 by: 2.00)} (angle.math/cos))
(* {1.00 (gen/stray from: 1.00 by: 2.00)} (angle.math/sin))]
width: (- {2.40 (gen/stray from: 2.40 by: 2.00)} b)
brush: brush/d
brush-subtype: 1

Loading…
Cancel
Save