chiark / gitweb /
commitid: Best: Check whether rotated version is better
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 21:35:27 +0000 (21:35 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 21:35:27 +0000 (21:35 +0000)
commitid.scad.pl

index a0c33e4121c6deac5ca8c3ba6f199462748d0cc3..d8a565d40c1ad23a1ea5357b06953913cb35d6d4 100755 (executable)
@@ -413,7 +413,9 @@ sub do_some_best ($$) {
                p ",max_sz[$xy]/sz_$form","[",(($xy xor $rot)+0),"]";
            }
            p ");\n";
                p ",max_sz[$xy]/sz_$form","[",(($xy xor $rot)+0),"]";
            }
            p ");\n";
-           push @do, " if (sc_$id >= 1.0) {\n";
+           push @do, " if (sc_$id >= 1.0";
+           push @do, " && sc_$id >= sc_${form}_r1" if !$rot;
+           push @do, ") {\n";
            push @do, "  scale(sc_$id)\n";
            push @do, "   rotate(90) translate([0,-sz_$form"."[1]])\n" if $rot;
            push @do, "   Commitid_${form}_2D();\n";
            push @do, "  scale(sc_$id)\n";
            push @do, "   rotate(90) translate([0,-sz_$form"."[1]])\n" if $rot;
            push @do, "   Commitid_${form}_2D();\n";