sub TAU { M_PI * 2.0; }
sub MM2PT { 72.0 / 25.4; }
+our $mid;
+
# ----- region names from plag, incl. reverse mapping -----
our %prs2region;
gsl_vector_add($$pr->raw, $translate->raw) and confess;
gsl_vector_scale($$pr->raw, $scale) and confess;
});
+ $mid = $lims[1] - $lims[0];
}
sub adjust_nz() {
foreach my $v (@$poly) {
$v->{NZ_Occurs} = $occurs{$v->{VxName}};
}
- my $ei;
my $occurs_m = sub {
- my ($delta) = @_;
- $poly->[($ei+$delta+@$poly) % @$poly]{NZ_Occurs} > 1
+ my ($ei) = @_;
+ $poly->[($ei+@$poly) % @$poly]{NZ_Occurs} > 1
};
- for $ei (0..$#$poly) {
- next if $occurs_m->(0);
- next unless $occurs_m->(-1);
- next unless $occurs_m->(+1);
+ for my $ei (0..$#$poly) {
+ next if $occurs_m->($ei);
+ next unless $occurs_m->($ei-1);
+ next unless $occurs_m->($ei+1);
# adjust coord outwards
}
- for $ei (0..$#$poly) {
- next unless $occurs_m->(-1);
- next unless $occurs_m->(0);
- my $pos = \ $poly->{$ei}{Pos};
+ for my $ei (0..$#$poly) {
+ next unless $occurs_m->($ei-1);
+ next unless $occurs_m->($ei);
+ my $pos = \ $poly->[$ei]{Pos};
+ $$pos = $$pos*2 - $mid - Math::GSL::Vector->new([-1400,0]);
}
}
read_faces();
calculate_centres();
transform_coordinates();
+adjust_nz();
o("%!\n");
o(" 0.52 dup scale\n"); # xxx bodge