sub TAU () { M_PI * 2; }
-our $debug = $ENV{DISTORT_DEBUG};
+our $debug = $ENV{DISTORT_DEBUG} // 0 ;
my $ps = $ENV{DISTORT_PS};
if ($ps) {
printf STDERR "OK nok=%d nchanged=%d\n",
(scalar @$ok), (scalar @$changed)
if $debug;
+ print STDERR Dumper(\@$ok) if $debug>=2;
return;
}
my ($dummy,$ix,$jx) = @longest;
my $radius = $project_cylinder_radius;
my @ot;
- foreach my $p (@$t) {
+ foreach my $p (@$t[0..2]) {
my ($x,$y,$z) = @$p;
my $r = $radius - $y;
my $theta = $x / $radius;
-$r * cos($theta),
$z ];
}
+ push @ot, $t->[3].'P';
append_triangle \@ot;
}
foreach my $t (@$triangles) {
print " facet normal 0 0 0\n";
print " outer loop\n";
- die unless @$t==3;
- foreach my $p (@$t) {
+ die unless @$t==4;
+ foreach my $p (@$t[0..2]) {
die unless @$p==3;
print " vertex";
printf " %.18g", $_ foreach @$p;