Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2015-11-01 21:12:13 +0300
committerAlessandro Ranellucci <aar@cpan.org>2015-11-01 21:12:13 +0300
commit9b21ac877adb4f768fcfb268dfc3384dd6fb3efc (patch)
treec5525e2ebbd38bcd45b3c51f58853f056cd94a6d /utils
parente58c32bee87cd7b4286f46d1a897f06d9f24f871 (diff)
parent2811af349ae17230a525ddcf819b1ddffaa250c9 (diff)
Merge branch 'master' into sender
Conflicts: Build.PL lib/Slic3r.pm xs/MANIFEST xs/src/libslic3r/PrintConfig.hpp
Diffstat (limited to 'utils')
-rwxr-xr-xutils/post-processing/flowrate.pl20
1 files changed, 17 insertions, 3 deletions
diff --git a/utils/post-processing/flowrate.pl b/utils/post-processing/flowrate.pl
index 573597c4c..7aeef24dc 100755
--- a/utils/post-processing/flowrate.pl
+++ b/utils/post-processing/flowrate.pl
@@ -6,17 +6,28 @@
use strict;
use warnings;
+use constant PI => 3.141592653589793238;
+my @filament_diameter = split /,/, $ENV{SLIC3R_FILAMENT_DIAMETER};
+
my $E = 0;
-my ($X, $Y);
+my $T = 0;
+my ($X, $Y, $F);
while (<>) {
+ if (/^G1.*? F([0-9.]+)/) {
+ $F = $1;
+ }
if (/^G1 X([0-9.]+) Y([0-9.]+).*? E([0-9.]+)/) {
my ($x, $y, $e) = ($1, $2, $3);
my $e_length = $e - $E;
if ($e_length > 0 && defined $X && defined $Y) {
my $dist = sqrt( (($x-$X)**2) + (($y-$Y)**2) );
if ($dist > 0) {
- my $flowrate = sprintf '%.2f', $e_length / $dist;
- s/(\R+)/ ; XY dist = $dist ; E dist = $e_length ; E\/XY = $flowrate mm\/mm$1/;
+ my $mm_per_mm = $e_length / $dist; # dE/dXY
+ my $mm3_per_mm = ($filament_diameter[$T] ** 2) * PI/4 * $mm_per_mm;
+ my $vol_speed = $F/60 * $mm3_per_mm;
+ my $comment = sprintf ' ; dXY = %.3fmm ; dE = %.5fmm ; dE/XY = %.5fmm/mm; volspeed = %.5fmm^3/sec',
+ $dist, $e_length, $mm_per_mm, $vol_speed;
+ s/(\R+)/$comment$1/;
}
}
$E = $e;
@@ -33,6 +44,9 @@ while (<>) {
if (/^G92 E0/) {
$E = 0;
}
+ if (/^T(\d+)/) {
+ $T = $1;
+ }
print;
}