Guest User

Untitled

a guest
May 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.93 KB | None | 0 0
  1. diff --git a/lib/Slic3r/Extruder.pm b/lib/Slic3r/Extruder.pm
  2. index 35f6a3d..7090cb4 100644
  3. --- a/lib/Slic3r/Extruder.pm
  4. +++ b/lib/Slic3r/Extruder.pm
  5. @@ -94,7 +94,9 @@ sub extrude_loop {
  6.  sub extrude_path {
  7.      my $self = shift;
  8.      my ($path, $description, $recursive) = @_;
  9. -    
  10. +    my ($old_desc, $old_rate);
  11. +    my $line_count = 0;
  12. +
  13.      $path->merge_continuous_lines;
  14.      
  15.      # detect arcs
  16. @@ -156,12 +158,36 @@ sub extrude_path {
  17.              : $path->role eq 'bridge'           ? $self->bridge_speed
  18.              : die "Unknown role: " . $path->role
  19.      );
  20. +
  21. +
  22. +    $old_desc = $description;
  23. +    $old_rate = $self->print_feed_rate;
  24. +    $line_count = 0;
  25.      if ($path->isa('Slic3r::ExtrusionPath::Arc')) {
  26.          $gcode .= $self->G2_G3($path->points->[-1], $path->orientation,
  27.              $path->center, $e * $path->length, $description);
  28.      } else {
  29.          foreach my $line ($path->lines) {
  30. +            $line_count++;
  31. +            # anti vibration
  32. +            if ($path->role =~ /fill/)
  33. +            {
  34. +
  35. +                my $distance_from_last_pos = $self->last_pos->distance_to($line->b) * $Slic3r::resolution;
  36. +                if ($distance_from_last_pos < 2)
  37. +                {
  38. +                    $self->print_feed_rate( ($old_rate * 0.5) );
  39. +                    #$description = sprintf "anti vibration. path line:  %d, %.4f, %.4f", $line_count, $line->length, $e;
  40. +                    $description = $old_desc . sprintf " path line: %d, %s, %.10f ", $line_count, $distance_from_last_pos, $e;
  41. +
  42. +                } else {
  43. +                    $self->print_feed_rate( $old_rate );
  44. +                    $description = $old_desc . sprintf " path line: %d, %s, %.10f ", $line_count, $distance_from_last_pos, $e;
  45. +                }
  46. +            }
  47. +            if ($e > 0) {
  48.              $gcode .= $self->G1($line->b, undef, $e * $line->length, $description);
  49. +            }
  50.          }
  51.      }
  52. :
Add Comment
Please, Sign In to add comment