Skip to content

Instantly share code, notes, and snippets.

@trych
Created June 8, 2018 23:02
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 trych/d5c94431582a789116cbee8d928a0811 to your computer and use it in GitHub Desktop.
Save trych/d5c94431582a789116cbee8d928a0811 to your computer and use it in GitHub Desktop.
A dotted circle in Processing. Note that the dotted line is only faked by drawing lines in the background color on top.
size(512, 512);
background(255);
strokeWeight(20);
translate(width / 2, height / 2);
ellipse(0, 0, 400, 400);
stroke(255);
for(int i = 0; i < 360; i += 360 / 20) {
rotate(radians(360 / 20));
line(0, 0, 210, 0);
}
@trych
Copy link
Author

trych commented Jun 8, 2018

dottedcircle

@jamesrobertparker
Copy link

int dx=0;
size(512, 512);
background(255);
strokeWeight(20);

translate(width / 2, height / 2);
ellipse(0, 0, 400, 400);
stroke(255);

for(int i = 0; i < 9; i += 1)
{
line (-dx, -400+dx, dx, 400+dx);
rotate (radians(20));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment