chiark
/
gitweb
/
~ianmdlvl
/
reprap-play.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2675227
)
commitid.scad.pl: Provide %s_sz
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 15:54:12 +0000
(15:54 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 15:54:12 +0000
(15:54 +0000)
commitid.scad.pl
patch
|
blob
|
history
diff --git
a/commitid.scad.pl
b/commitid.scad.pl
index de1efa87586485c334880cd624607565d332ede4..e7aee601745ce94cfde957a4b9a11ab2d9909cbb 100755
(executable)
--- a/
commitid.scad.pl
+++ b/
commitid.scad.pl
@@
-90,6
+90,7
@@
sub gentextmodule ($@) {
p "module ${modb}_2D(){\n";
p " scale(Commitid__scale()){\n";
my $y = @lines;
+ my $cols = 1;
foreach my $line (@lines) {
$y--;
my $x = 0;
@@
-99,6
+100,7
@@
sub gentextmodule ($@) {
$x, $y, chrmodname $chr;
$x++;
}
+ $cols = $x if $x > $cols;
}
p " }\n";
p "}\n";
@@
-106,6
+108,8
@@
sub gentextmodule ($@) {
p " d=Commitid_depth();\n";
p " translate([0,0,-d]) linear_extrude(height=d*2) ${modb}_2D();\n";
p "}\n";
+ p sprintf "function %s_sz() = Commitid__scale() * 0.1 * [ %d, %d ];\n",
+ $modb, 2 * (@lines * 6 - 1), 2 * ($cols * 4 - 1);
}
our @demo;