place.pl

place.pl is a small script I wrote, when I was making the second version of the bob-clock. It calculates the positions and rotation of the 60 LEDs and spits out commands that can be executed in Eagle to move the components.

You can download the script here

#!/usr/bin/perl
use constant PI=>4*atan2(1,1);

my $ofsx=110.0, $ofsy=110.0, $r=100.0;

for ($i=0;$i<60;$i++) {
  $a=((($i+45+30)%60)*-6)%360;
  print("rotate =R$a 'd$i'\n");
  $ar=PI/180.0*(((($i+45)%60)*-6)%360);
  $x=$ofsx+$r*cos($ar);
  $y=$ofsy+$r*sin($ar);
  printf("move 'd$i' (%.2f %.2f)\n",$x,$y);
}
Last updated: 2006.03.10