chiark / gitweb /
commitid: Best, initial sort-of-working implementation
[reprap-play.git] / commitid-best-test.scad.pl
diff --git a/commitid-best-test.scad.pl b/commitid-best-test.scad.pl
new file mode 100755 (executable)
index 0000000..73cfd8f
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+use strict;
+
+our @xm = qw(4.7 6.8 10 15 22 33 47 68 100);
+our @ym = qw(3.9 5.6 8.2 12 18 27 39 56);
+
+sub p { print @_ or die $!; }
+
+p "include <commitid.scad>\n";
+p "p = Commitid_pixelsz();\n";
+
+my $x = 0;
+foreach my $xm (@xm) {
+    my $y = 0;
+    foreach my $ym (@ym) {
+       p " translate([$x,$y] * p) {\n";
+       p "  difference(){\n";
+       p "   translate(-0.5*p*[1,1]) square([$xm+1,$ym+1]*p);\n";
+       p "   square([$xm,$ym]*p);\n";
+       p "  }\n";
+       p "  Commitid_BestCount_2D([$xm,$ym] * p);\n";
+       p " }\n";
+       $y += $ym + 2;
+    }
+    $x += $xm + 2;
+}