chiark / gitweb /
dyke proc
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 Mar 2019 17:36:51 +0000 (17:36 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 Mar 2019 17:36:51 +0000 (17:36 +0000)
generate-board

index f15a5d4b728daefc5046dc082004f385111ffb61..80320f202817db5f4aa89c547a754e5a6e33394f 100755 (executable)
@@ -552,6 +552,14 @@ sub dykes(){
   my $lw = $edge_lw * 0.50;
   my $l2 = $l/2;
   my $w2 = $w/2;
+  o("  /dyke {\n");
+  o("    newpath -$l2 -$w2 moveto\n");
+  o("             $l2 -$w2 lineto\n");
+  o("             $l2  $w2 lineto\n");
+  o("            -$l2  $w2 lineto closepath\n");
+  o("    gsave 0.50 setgray fill grestore\n");
+  o("    gsave 0.00 setgray $lw setlinewidth stroke grestore\n");
+  o("  } bind def\n");
   foreach my $rr (values %region) {
     next if $rr->{Special};
     next if $rr->{Colour} eq 'high';
@@ -566,12 +574,7 @@ sub dykes(){
       o("  gsave\n");
       o("    ", psvec( 0.5 * ($ends[0] + $ends[1]) )," translate\n");
       o("    ", ($angle * 360 / TAU), " rotate\n");
-      o("    newpath -$l2 -$w2 moveto\n");
-      o("             $l2 -$w2 lineto\n");
-      o("             $l2  $w2 lineto\n");
-      o("            -$l2  $w2 lineto closepath\n");
-      o("    gsave 0.50 setgray fill grestore\n");
-      o("    gsave 0.00 setgray $lw setlinewidth stroke grestore\n");
+      o("    dyke\n");
       o("  grestore\n");
     }
   }