cameo/fped2stl.pl: hack: maintain decimal point across flipping

Since our regexps expect numbers to contain a decimal point, any result
that was an integer tripped the re-match after flipping. This hack works
around the problem by formatting the result such that it also has a decimal
point.
This commit is contained in:
Werner Almesberger 2013-12-06 19:07:30 -03:00
parent ff5b4a1ae8
commit 0fc785d3a1
1 changed files with 2 additions and 1 deletions

View File

@ -100,7 +100,8 @@ for $z (keys %s) {
undef $t;
for $s (split(/\n/, $s{$z})) {
if ($s =~ /^(-?[0-9]*\.[0-9]*)\s+(-?[0-9]*\.[0-9]*)/) {
$s = (($xmax+$xmin)/2-$1)." $2" if $flip_y;
$s = sprintf("%.6f", ($xmax+$xmin)/2-$1)." $2"
if $flip_y;
# re-scan, so that we can flip on both axes
die unless