Source file: /~heha/ewa/igr.zip/Winkelskale.ulp

// Maße in mm
// Wegen zentrierter Texte ist das nix für Eagle4
// Wegen Dimension-Layer-only funktioniert's auch mit der Freeware-Version
string c;
c+="change layer 20;";
c+="set wire_bend 0;";
c+="wire 0 (-124 -124) (124 124) (-124 -124);";		// Quadrat außen
c+="circle 0.001 (0 0) (50 0);";			// Loch innen
c+="set wire_bend 2;";
c+="";

real radius=117;

void strich(real angle, real len, int t) {
 real arad=radius;	// Außenradius
 if (t<0) arad-=1;
 real irad=radius-len;	// Innenradius
 angle*=PI/180;
 string s;
 sprintf(s,"wire 0 (%f %f) (%f %f);",
   arad*sin(angle),
   arad*cos(angle),
   irad*sin(angle),
   irad*cos(angle));
 c+=s;
 if (t>=0) {
  arad+=1;
  sprintf(s,"change size 1.7;change align center right;text '%d' R%d (%f %f);",
    t,
    270-t,
    arad*sin(angle),
    arad*cos(angle));
  c+=s;
 }
}

void text(int angle, real r, real size) {
 real a=angle*PI/180;
 string s;
 sprintf(s,"change size %f;change align bottom center;text '%d' R%d (%f %f);",
   size,
   angle,
   180-angle,
   r*sin(a),
   r*cos(a));
 c+=s;
}

// Zehntelgrad
for (int i=0; i<360; i++) {
 int l=10;
 if (i%90==0) l=60;
 else if (i%30==0) {l=30; text(i,80,6);}	// 30° (aber nicht bei 90°)
 else if (i%10==0) {l=20; text(i,90,4);}	// 10°
 else if (i%5==0) l=15;
 strich(i,l,i);
 strich(i+0.25,5,-1);
 strich(i+0.5,7,-1);
 strich(i+0.75,5,-1);
}

c+="change size 4;change align top right;text '1440 Strich; 0,25°' R0 (115 115);";
c+="change size 2;change align bottom right;text 'Erstellt in Eagle mit Winkelskale.ulp' (115 -115);";

exit(c);
Detected encoding: ANSI (CP1252)4
Wrong umlauts? - Assume file is ANSI (CP1252) encoded