$cellmap{$1} = $_;
}
my %chrpolys;
+ # $chrs{$chr}[$poly] = $poly
+ # $poly->{E} = [ "012345012345", ... ]
while (<DATA>) {
next unless m/\S/;
chomp;
die unless $f;
$f =~ s/\b\d/ sprintf '%05d', $col*2000 + $&*1025 /ge;
$f =~ s/\d\b/ sprintf '%05d', $row*2000 + $&*1025 /ge;
- push @{ $chrpolys{$chr} }, [ split / /, $f ];
+ push @{ $chrpolys{$chr} }, { E => [ split / /, $f ] };
} else {
die "$_ ?";
}
my $demo = '';
my $democols = 6;
foreach my $chr (sort keys %chrpolys) {
+ my $polys = $chrpolys{$chr};
my $mod = chrmodname $chr;
p "module $mod () {\n";
- foreach my $poly (@{ $chrpolys{$chr} }) {
+ foreach my $poly (@$polys) {
p " polygon([";
my $delim = "";
- foreach my $pt (@$poly) {
+ foreach my $pt (@{ $poly->{E} }) {
p $delim;
$pt =~ s{\d{5}}{$&,};
$pt =~ s{\b\d}{$&.}g;