{
const width = 500
const radius = 150
const n_lines = 6
const noise_xy_freq = 3
const radius_offset_scale = 25
const noise_z_freq = 1/200
const d = 2
const colors = ['rgba(240,240,0,.5)','rgba(240,0,240,.5)','rgba(0,240,240,.5)']
const lineWidth = 2
const n_segments = 1000
const noise = new SimplexNoise()
const ctx = DOM.context2d(width,width)
ctx.globalCompositeOperation = 'darken'
ctx.lineWidth = lineWidth
let t = 0
while (true){
t += 1
ctx.clearRect(0,0,width,width)
for (let j = 0; j < n_lines; j++){
ctx.beginPath()
ctx.strokeStyle = colors[j % colors.length]
for (let i = 0; i <= n_segments; i++){
let angle = i/n_segments * 2 * Math.PI
let x = Math.cos(angle)
let y = Math.sin(angle)
let k = angle - Math.PI
let noise_scale = Math.pow(Math.E, -(k * k) * d)
const noise_x_sample = x * noise_xy_freq
const noise_y_sample = y * noise_xy_freq
const noise_z_sample = t * noise_z_freq + (j * 100)
const noise_value = noise.noise3D(noise_x_sample,noise_y_sample, noise_z_sample)
const radius_offset = noise_value * radius_offset_scale * noise_scale
x = width/2 + (radius + radius_offset) * x
y = width/2 + (radius + radius_offset) * y
if (i == 0){
ctx.beginPath()
ctx.moveTo(x, y)
}
ctx.lineTo(x,y)
}
ctx.closePath()
ctx.stroke()
}
yield ctx.canvas
}
}