chiark / gitweb /
distort-stl: debugging
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 23 Nov 2018 23:19:17 +0000 (23:19 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 23 Nov 2018 23:19:17 +0000 (23:19 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
distort-stl

index 722e4fa..68b7e28 100755 (executable)
@@ -73,16 +73,23 @@ sub maybe_subdivide_triangle ($$$$) {
            foreach my $ci (0..2) {
                push @midp, 0.5 * ($t->[$ix][$ci] + $t->[$jx][$ci]);
            }
+
+           printf STDERR
+               " midp %11.6f,%11.6f,%11.6f\n",
+               @midp;
+
            # triangle i-j-k, splitting edge i-m
            # gives    i-m-k, k-m-j
            my $n = [ @$t ]; $n->[$ix] = \@midp;  $n->[3] = "$t->[3]a$ix$jx";
            unshift @$changed, $n;
 
+           printf STDERR "%s\n", sprintf_triangle $n;
+
            my $n = [ @$t ]; $n->[$jx] = \@midp;  $n->[3] = "$t->[3]b$ix$jx";
            unshift @$changed, $n;
-           printf STDERR
-               " midp %11.6f,%11.6f,%11.6f\n",
-               @midp;
+
+           printf STDERR "%s\n", sprintf_triangle $n;
+
            return;
        }
     }