Faster algorithm for rectilinear fill

This commit is contained in:
Alessandro Ranellucci 2011-10-06 15:24:21 +02:00
parent 33d7b8c7cf
commit 1978a99416
10 changed files with 242 additions and 159 deletions

View file

@ -69,15 +69,11 @@ sub extrude {
my $gcode = "";
# reset extrusion distance counter
if (!$Slic3r::use_relative_e_distances) {
$self->extrusion_distance(0);
$gcode .= "G92 E0 ; reset extrusion distance\n";
}
# retract
if (Slic3r::Geometry::distance_between_points($self->last_pos, $path->points->[0]->p) * $Slic3r::resolution
>= $Slic3r::retract_before_travel) {
# retract if distance from previous position is greater or equal to the one
# specified by the user *and* to the maximum distance between infill lines
my $distance_from_last_pos = Slic3r::Geometry::distance_between_points($self->last_pos, $path->points->[0]->p) * $Slic3r::resolution;
if ($distance_from_last_pos >= $Slic3r::retract_before_travel
&& $distance_from_last_pos >= $Slic3r::flow_width / $Slic3r::fill_density) {
$gcode .= $self->retract;
}