chiark / gitweb /
distort-stl: slight rework to make debug output better
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 23 Nov 2018 20:09:58 +0000 (20:09 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 23 Nov 2018 20:09:58 +0000 (20:09 +0000)
Calculation ordering changed but answers should be the same.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
distort-stl

index bdbdd49..6dcd23c 100755 (executable)
@@ -68,9 +68,8 @@ sub maybe_subdivide_triangle ($$$$) {
            }
            # triangle i-j-k, splitting edge i-m
            # gives    i-m-k, k-m-j
-           push @$changed,
-               [ $t->[$ix], \@midp, $t->[$kx] ],
-               [ $t->[$kx], \@midp, $t->[$jx] ];
+           my $n = [ @$t ]; $n->[$ix] = \@midp; unshift @$changed, $n;
+           my $n = [ @$t ]; $n->[$jx] = \@midp; unshift @$changed, $n;
            return;
        }
     }