chiark / gitweb /
move into misc-data.pl: PA_Outercoast_Vertices Noorderzijlvest
[pandemic-rising-tide.git] / generate-board
index ac23f16a410caef949b85fe00831515bf7c0af6e..b48f8bc2d8be1018e544d6053644dfac09461114 100755 (executable)
@@ -272,7 +272,7 @@ sub adjust_sea() {
     next unless $occurs_m->($ei);
     #print STDERR " sea occurs_m $ei $poly->[$ei]{VxName}\n";
     next unless $occurs_m->($ei-1);
-    my $dleft = mkvec(-1000,0);
+    my $dleft = &mkvec(@{ $c{PA}{OuterCoastDelta} });
     foreach my $which (0,-1) {
       my $ej = ($ei +        $which + @$poly) % @$poly;
       my $ek = ($ei + +1 + 3*$which + @$poly) % @$poly;
@@ -281,9 +281,11 @@ sub adjust_sea() {
       my $dout = $$posk - $$posj;
       #print STDERR " sea adj j=$ej ",prvec($$posj)," $poly->[$ej]{VxName}\n";
       #print STDERR " sea adj k=$ek ",prvec($$posk)," $poly->[$ek]{VxName}\n";
-      if ($poly->[$ej]{VxName} =~ /Noorderzijlvest/) {
-       #print STDERR " sea adj extra\n";
-       $$posk = $$posj + 10 * mkvec(100,-50);
+      foreach my $paocv (@{ $c{PA_Outercoast_Vertices} }) {
+       if ($poly->[$ej]{VxName} =~ m{$paocv->{Re}}) {
+         #print STDERR " sea adj extra\n";
+         $$posk = $$posj + 10 * &mkvec(@{ $paocv->{PA} });
+       }
       }
       $$posj = $$posj + $dleft + $dout*10;
       $$posk = $$posk          + $dout*10;
@@ -583,7 +585,7 @@ sub some_edge_faces (@) {
   }
 }
 
-sub afsluitdijk ($$$) {
+sub dashedwithhs ($$$) {
   my ($inner, $comment, $colour) = @_;
   my ($adj) = grep { $_->{Name} eq $c{Sea} } @{ $region{$inner}{Adj} };
   my $dash = 20;
@@ -604,19 +606,21 @@ END
   one_hs($colour, $mid);
 }
 
-sub afsluitdijken() {
-  afsluitdijk(
-             $_->{Region},
+sub dashedwithhses() {
+  dashedwithhs(
+             $_->{Inner},
              $_->{Comment},
              $_->{Colour}
-            ) foreach @{ $c{DashedHsInners} };
+            ) foreach @{ $c{DashedHs} };
 }
 
 sub edge_faces() {
   some_edge_faces($region{$c{Sea}});
-  afsluitdijken();
+  dashedwithhses();
   some_edge_faces(grep {
-    $_->{Name} !~ m{^(?:L2?|NZ|ZZ)$}
+    my $n = $_->{Name};
+    $n !~ m{^$c{OuterfaceRe}$} &&
+    !grep { $n eq $_->{Inner} } @{ $c{DashedHs} }
   } values %region);
 }
 
@@ -877,7 +881,7 @@ sub dykes(){
   o("  } bind def\n");
   foreach my $rr (values %region) {
     next if $rr->{Special};
-    next if $rr->{Name} eq 'ZZ';
+    next if grep { $_->{Inner} eq $rr->{Name} } @{ $c{DashedHs} };
     next if $rr->{Colour} eq 'high';
     foreach my $adj (@{ $rr->{Adj} }) {
       my $neigh = $adj->{Name};