More constants, less strings => ess memory usage

This commit is contained in:
Alessandro Ranellucci 2012-05-19 15:40:11 +02:00
parent 8fe5d11624
commit aa9563f00b
10 changed files with 51 additions and 27 deletions

View file

@ -11,6 +11,7 @@ use Slic3r::Fill::Line;
use Slic3r::Fill::OctagramSpiral;
use Slic3r::Fill::PlanePath;
use Slic3r::Fill::Rectilinear;
use Slic3r::ExtrusionPath ':roles';
use Slic3r::Geometry qw(X Y scale shortest_path);
use Slic3r::Geometry::Clipper qw(union_ex diff_ex);
@ -165,7 +166,9 @@ sub make_fill {
paths => [
map Slic3r::ExtrusionPath->new(
polyline => Slic3r::Polyline->new(@$_),
role => ($is_bridge ? 'bridge' : $is_solid ? 'solid-fill' : 'fill'),
role => ($is_bridge ? EXTR_ROLE_BRIDGE
: $is_solid ? EXTR_ROLE_SOLIDFILL
: EXTR_ROLE_FILL),
depth_layers => $surface->depth_layers,
flow_spacing => $params->{flow_spacing},
), @paths,
@ -178,8 +181,8 @@ sub make_fill {
paths => [
map {
$_->isa('Slic3r::Polygon')
? Slic3r::ExtrusionLoop->new(polygon => $_, role => 'solid-fill')->split_at($_->[0])
: Slic3r::ExtrusionPath->new(polyline => $_, role => 'solid-fill')
? Slic3r::ExtrusionLoop->new(polygon => $_, role => EXTR_ROLE_SOLIDFILL)->split_at($_->[0])
: Slic3r::ExtrusionPath->new(polyline => $_, role => EXTR_ROLE_SOLIDFILL)
} @{$layer->thin_fills},
],
) if @{$layer->thin_fills};