diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index 3d0d56cdb..e7fe54623 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -645,25 +645,4 @@ sub combine_infill { } } -# Used by t/support.t and by GCode.pm to export support line width as a comment. -# To be removed. -sub support_material_flow { - my ($self, $role) = @_; - - $role //= FLOW_ROLE_SUPPORT_MATERIAL; - my $extruder = ($role == FLOW_ROLE_SUPPORT_MATERIAL) - ? $self->config->support_material_extruder - : $self->config->support_material_interface_extruder; - - # we use a bogus layer_height because we use the same flow for all - # support material layers - return Slic3r::Flow->new_from_width( - width => $self->config->support_material_extrusion_width || $self->config->extrusion_width, - role => $role, - nozzle_diameter => $self->print->config->nozzle_diameter->[$extruder-1] // $self->print->config->nozzle_diameter->[0], - layer_height => $self->config->layer_height, - bridge_flow_ratio => 0, - ); -} - 1; diff --git a/t/support.t b/t/support.t index 11945997c..e30571c09 100644 --- a/t/support.t +++ b/t/support.t @@ -12,6 +12,7 @@ BEGIN { use List::Util qw(first); use Slic3r; +use Slic3r::Flow ':roles'; use Slic3r::Geometry qw(epsilon scale); use Slic3r::Geometry::Clipper qw(diff); use Slic3r::Test; @@ -23,7 +24,14 @@ use Slic3r::Test; my $test = sub { my $print = Slic3r::Test::init_print('20mm_cube', config => $config); - my $flow = $print->print->objects->[0]->support_material_flow; + my $object_config = $print->print->objects->[0]->config; + my $flow = Slic3r::Flow->new_from_width( + width => $object_config->support_material_extrusion_width || $object_config->extrusion_width, + role => FLOW_ROLE_SUPPORT_MATERIAL, + nozzle_diameter => $print->config->nozzle_diameter->[$object_config->support_material_extruder-1] // $print->config->nozzle_diameter->[0], + layer_height => $object_config->layer_height, + bridge_flow_ratio => 0, + ); my $support = Slic3r::Print::SupportMaterial->new( object_config => $print->print->objects->[0]->config, print_config => $print->print->config,