Skip to content

Instantly share code, notes, and snippets.

@fdb
Created October 11, 2018 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fdb/edb0e65caa8b1b2b99c0403e608ac3b6 to your computer and use it in GitHub Desktop.
Save fdb/edb0e65caa8b1b2b99c0403e608ac3b6 to your computer and use it in GitHub Desktop.
Keep Pushing — Paper.js Sketch
// Use in http://sketch.paperjs.org/
function rand(min, max) {
return min + Math.random() * (max - min);
}
var RADIUS = 400;
var circ = new Path.Circle({
position: view.center,
radius: RADIUS,
strokeColor: 'black',
strokeWidth: 2,
strokeJoin: 'round',
insert: false
});
for (var i = 0; i < 200; i += 1) {
var pt = view.center + new Point(RADIUS, 0);
pt = pt.rotate(rand(0, 360), view.center);
var c = new Path.Circle({
position: pt,
radius: rand(2, 5),
fillColor: 'blue',
insert: false
})
circ = circ.unite(c);
}
project.activeLayer.addChild(circ);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment