Only apply vibration limit to gaps fill while it's not very mature to work with long segments

This commit is contained in:
Alessandro Ranellucci 2012-11-21 19:00:43 +01:00
parent fc399d60e2
commit 8ae96a8868
3 changed files with 9 additions and 3 deletions

View file

@ -6,7 +6,7 @@ our @ISA = qw(Exporter);
our @EXPORT_OK = qw(EXTR_ROLE_PERIMETER EXTR_ROLE_SMALLPERIMETER EXTR_ROLE_EXTERNAL_PERIMETER our @EXPORT_OK = qw(EXTR_ROLE_PERIMETER EXTR_ROLE_SMALLPERIMETER EXTR_ROLE_EXTERNAL_PERIMETER
EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER
EXTR_ROLE_FILL EXTR_ROLE_SOLIDFILL EXTR_ROLE_TOPSOLIDFILL EXTR_ROLE_BRIDGE EXTR_ROLE_SKIRT EXTR_ROLE_FILL EXTR_ROLE_SOLIDFILL EXTR_ROLE_TOPSOLIDFILL EXTR_ROLE_BRIDGE EXTR_ROLE_SKIRT
EXTR_ROLE_SUPPORTMATERIAL); EXTR_ROLE_SUPPORTMATERIAL EXTR_ROLE_GAPFILL);
our %EXPORT_TAGS = (roles => \@EXPORT_OK); our %EXPORT_TAGS = (roles => \@EXPORT_OK);
use Slic3r::Geometry qw(PI X Y epsilon deg2rad rotate_points); use Slic3r::Geometry qw(PI X Y epsilon deg2rad rotate_points);
@ -33,6 +33,7 @@ use constant EXTR_ROLE_TOPSOLIDFILL => 6;
use constant EXTR_ROLE_BRIDGE => 7; use constant EXTR_ROLE_BRIDGE => 7;
use constant EXTR_ROLE_SKIRT => 8; use constant EXTR_ROLE_SKIRT => 8;
use constant EXTR_ROLE_SUPPORTMATERIAL => 9; use constant EXTR_ROLE_SUPPORTMATERIAL => 9;
use constant EXTR_ROLE_GAPFILL => 10;
use constant PACK_FMT => 'ffca*'; use constant PACK_FMT => 'ffca*';

View file

@ -26,6 +26,7 @@ has 'last_path' => (is => 'rw');
has 'dec' => (is => 'ro', default => sub { 3 } ); has 'dec' => (is => 'ro', default => sub { 3 } );
# used for vibration limit: # used for vibration limit:
has 'limit_frequency' => (is => 'rw', default => sub { 0 });
has 'last_dir' => (is => 'ro', default => sub { [0,0] }); has 'last_dir' => (is => 'ro', default => sub { [0,0] });
has 'segment_time' => (is => 'ro', default => sub { [ [0,0,0], [0,0,0] ] }); has 'segment_time' => (is => 'ro', default => sub { [ [0,0,0], [0,0,0] ] });
@ -51,6 +52,7 @@ my %role_speeds = (
&EXTR_ROLE_BRIDGE => 'bridge', &EXTR_ROLE_BRIDGE => 'bridge',
&EXTR_ROLE_SKIRT => 'perimeter', &EXTR_ROLE_SKIRT => 'perimeter',
&EXTR_ROLE_SUPPORTMATERIAL => 'perimeter', &EXTR_ROLE_SUPPORTMATERIAL => 'perimeter',
&EXTR_ROLE_GAPFILL => 'solid_infill',
); );
sub set_shift { sub set_shift {
@ -165,6 +167,9 @@ sub extrude_path {
} }
} }
# only apply vibration limiting to gap fill until the algorithm is more mature
$self->limit_frequency($path->role == EXTR_ROLE_GAPFILL);
# go to first point of extrusion path # go to first point of extrusion path
$self->speed('travel'); $self->speed('travel');
$gcode .= $self->G0($path->points->[0], undef, 0, "move to first $description point") $gcode .= $self->G0($path->points->[0], undef, 0, "move to first $description point")
@ -327,7 +332,7 @@ sub _G0_G1 {
$gcode .= sprintf " X%.${dec}f Y%.${dec}f", $gcode .= sprintf " X%.${dec}f Y%.${dec}f",
($point->x * &Slic3r::SCALING_FACTOR) + $self->shift_x - $self->extruder->extruder_offset->[X], ($point->x * &Slic3r::SCALING_FACTOR) + $self->shift_x - $self->extruder->extruder_offset->[X],
($point->y * &Slic3r::SCALING_FACTOR) + $self->shift_y - $self->extruder->extruder_offset->[Y]; #** ($point->y * &Slic3r::SCALING_FACTOR) + $self->shift_y - $self->extruder->extruder_offset->[Y]; #**
$speed_factor = $self->_limit_frequency($point); $speed_factor = $self->_limit_frequency($point) if $self->limit_frequency;
$self->last_pos($point->clone); $self->last_pos($point->clone);
} }
if (defined $z && (!defined $self->z || $z != $self->z)) { if (defined $z && (!defined $self->z || $z != $self->z)) {

View file

@ -283,7 +283,7 @@ sub make_perimeters {
} }
map Slic3r::ExtrusionPath->new( map Slic3r::ExtrusionPath->new(
polyline => Slic3r::Polyline->new(@$_), polyline => Slic3r::Polyline->new(@$_),
role => EXTR_ROLE_SOLIDFILL, role => EXTR_ROLE_GAPFILL,
height => $self->height, height => $self->height,
flow_spacing => $params->{flow_spacing}, flow_spacing => $params->{flow_spacing},
), @paths; ), @paths;