G12N

Chaotic spheres

Today I got lost in office work and many inspirations like this tweet by Yuan Chuan.

So I didn't find the time for a propper text. But I got a sketch of the day done.

Enjoy

Tiled LinesTiled LinesTiled LinesTiled Lines

Source code

import PropTypes from 'prop-types'
import React from 'react'
import random from 'canvas-sketch-util/random'

const Sketch19a03 = ({ radius, lines, padding }) => {
  const width = radius * 2 + padding * 2
  const height = radius * 2 + padding * 2

  const [x, y] = random.onCircle(radius)

  var d = `M ${x} ${y}`

  for (var step = 0; step < lines; step++) {
    const [x, y] = random.onCircle(radius)
    d += `L ${x} ${y}`
  }

  return (
    <svg
      viewBox={`${-radius - padding} ${-radius - padding} ${width} ${height}`}
    >
      <title>Tiled Lines</title>
      <path d={d} strokeWidth="1" stroke="#000" fill="none" />
    </svg>
  )
}

Sketch19a03.propTypes = {
  radius: PropTypes.number,
  lines: PropTypes.number,
  padding: PropTypes.number,
}

Sketch19a03.defaultProps = {
  radius: 200,
  lines: 800,
  padding: 10,
}

export default Sketch19a03