More work for refactoring Flow/Extruder

This commit is contained in:
Alessandro Ranellucci 2014-01-03 20:02:00 +01:00
parent 8ed738d3f7
commit a2cbb261cb
10 changed files with 48 additions and 21 deletions

View file

@ -43,9 +43,14 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ }
surface_type => S_TYPE_TOP,
expolygon => $expolygon,
);
my $flow = Slic3r::Flow->new(
width => 0.69,
spacing => 0.69,
nozzle_diameter => 0.50,
);
foreach my $angle (0, 45) {
$surface->expolygon->rotate(Slic3r::Geometry::deg2rad($angle), [0,0]);
my ($params, @paths) = $filler->fill_surface($surface, flow_spacing => 0.69, density => 0.4);
my ($params, @paths) = $filler->fill_surface($surface, flow => $flow, density => 0.4);
is scalar @paths, 1, 'one continuous path';
}
}
@ -62,14 +67,19 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ }
surface_type => S_TYPE_BOTTOM,
expolygon => $expolygon,
);
my $flow = Slic3r::Flow->new(
width => $flow_spacing,
spacing => $flow_spacing,
nozzle_diameter => $flow_spacing,
);
my ($params, @paths) = $filler->fill_surface(
$surface,
flow_spacing => $flow_spacing,
flow => $flow,
density => $density // 1,
);
# check whether any part was left uncovered
my @grown_paths = map @{Slic3r::Polyline->new(@$_)->grow(scale $params->{flow_spacing}/2)}, @paths;
my @grown_paths = map @{Slic3r::Polyline->new(@$_)->grow(scale $params->{flow}->spacing/2)}, @paths;
my $uncovered = diff_ex([ @$expolygon ], [ @grown_paths ], 1);
# ignore very small dots