mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-31 20:51:12 -06:00
More incomplete work for Flow/Extruder refactoring
This commit is contained in:
parent
52ce6e4a7b
commit
8ed738d3f7
27 changed files with 250 additions and 233 deletions
|
|
@ -863,7 +863,7 @@ sub generate_support_material {
|
|||
return unless ($self->config->support_material || $self->config->raft_layers > 0)
|
||||
&& $self->layer_count >= 2;
|
||||
|
||||
my $first_layer_flow = Slic3r::Flow->new(
|
||||
my $first_layer_flow = Slic3r::Flow->new_from_width(
|
||||
width => ($self->config->first_layer_extrusion_width || $self->config->support_material_extrusion_width),
|
||||
role => FLOW_ROLE_SUPPORT_MATERIAL,
|
||||
nozzle_diameter => $self->print->config->nozzle_diameter->[ $self->config->support_material_extruder-1 ],
|
||||
|
|
@ -900,7 +900,7 @@ sub support_material_flow {
|
|||
|
||||
# we use a bogus layer_height because we use the same flow for all
|
||||
# support material layers
|
||||
return Slic3r::Flow->new(
|
||||
return Slic3r::Flow->new_from_width(
|
||||
width => $self->config->support_material_extrusion_width,
|
||||
role => $role,
|
||||
nozzle_diameter => $self->print->config->nozzle_diameter->[$extruder-1],
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ sub flow {
|
|||
}
|
||||
my $nozzle_diameter = $self->print->config->nozzle_diameter->[$extruder-1];
|
||||
|
||||
return Slic3r::Flow->new(
|
||||
return Slic3r::Flow->new_from_width(
|
||||
width => $config_width,
|
||||
role => $role,
|
||||
nozzle_diameter => $nozzle_diameter,
|
||||
|
|
|
|||
|
|
@ -500,10 +500,11 @@ sub generate_toolpaths {
|
|||
);
|
||||
|
||||
# transform loops into ExtrusionPath objects
|
||||
my $mm3_per_mm = $interface_flow->mm3_per_mm($layer->height);
|
||||
@loops = map Slic3r::ExtrusionPath->new(
|
||||
polyline => $_,
|
||||
role => EXTR_ROLE_SUPPORTMATERIAL,
|
||||
flow_spacing => $interface_flow->spacing,
|
||||
polyline => $_,
|
||||
role => EXTR_ROLE_SUPPORTMATERIAL,
|
||||
mm3_per_mm => $mm3_per_mm,
|
||||
), @loops;
|
||||
|
||||
$layer->support_interface_fills->append(@loops);
|
||||
|
|
@ -536,16 +537,16 @@ sub generate_toolpaths {
|
|||
foreach my $expolygon (@{union_ex($interface)}) {
|
||||
my ($params, @p) = $fillers{interface}->fill_surface(
|
||||
Slic3r::Surface->new(expolygon => $expolygon, surface_type => S_TYPE_INTERNAL),
|
||||
density => $interface_density,
|
||||
flow_spacing => $interface_flow->spacing,
|
||||
complete => 1,
|
||||
density => $interface_density,
|
||||
flow => $interface_flow,
|
||||
complete => 1,
|
||||
);
|
||||
my $mm3_per_mm = $params->{flow}->mm3_per_mm($layer->height);
|
||||
|
||||
push @paths, map Slic3r::ExtrusionPath->new(
|
||||
polyline => Slic3r::Polyline->new(@$_),
|
||||
role => EXTR_ROLE_SUPPORTMATERIAL,
|
||||
height => undef,
|
||||
flow_spacing => $params->{flow_spacing},
|
||||
polyline => Slic3r::Polyline->new(@$_),
|
||||
role => EXTR_ROLE_SUPPORTMATERIAL,
|
||||
mm3_per_mm => $mm3_per_mm,
|
||||
), @p;
|
||||
}
|
||||
|
||||
|
|
@ -556,8 +557,8 @@ sub generate_toolpaths {
|
|||
if (@$base) {
|
||||
my $filler = $fillers{support};
|
||||
$filler->angle($angles[ ($layer_id) % @angles ]);
|
||||
my $density = $support_density;
|
||||
my $flow_spacing = $flow->spacing;
|
||||
my $density = $support_density;
|
||||
my $base_flow = $flow;
|
||||
|
||||
# TODO: use offset2_ex()
|
||||
my $to_infill = union_ex($base, 1);
|
||||
|
|
@ -568,15 +569,15 @@ sub generate_toolpaths {
|
|||
$filler = $fillers{interface};
|
||||
$filler->angle($self->object_config->support_material_angle + 90);
|
||||
$density = 0.5;
|
||||
$flow_spacing = $self->first_layer_flow->spacing;
|
||||
$base_flow = $self->first_layer_flow;
|
||||
} else {
|
||||
# draw a perimeter all around support infill
|
||||
# TODO: use brim ordering algorithm
|
||||
my $mm3_per_mm = $flow->mm3_per_mm($layer->height);
|
||||
push @paths, map Slic3r::ExtrusionPath->new(
|
||||
polyline => $_->split_at_first_point,
|
||||
role => EXTR_ROLE_SUPPORTMATERIAL,
|
||||
height => undef,
|
||||
flow_spacing => $flow->spacing,
|
||||
polyline => $_->split_at_first_point,
|
||||
role => EXTR_ROLE_SUPPORTMATERIAL,
|
||||
mm3_per_mm => $mm3_per_mm,
|
||||
), map @$_, @$to_infill;
|
||||
|
||||
# TODO: use offset2_ex()
|
||||
|
|
@ -586,16 +587,16 @@ sub generate_toolpaths {
|
|||
foreach my $expolygon (@$to_infill) {
|
||||
my ($params, @p) = $filler->fill_surface(
|
||||
Slic3r::Surface->new(expolygon => $expolygon, surface_type => S_TYPE_INTERNAL),
|
||||
density => $density,
|
||||
flow_spacing => $flow_spacing,
|
||||
complete => 1,
|
||||
density => $density,
|
||||
flow => $base_flow,
|
||||
complete => 1,
|
||||
);
|
||||
my $mm3_per_mm = $params->{flow}->mm3_per_mm($layer->height);
|
||||
|
||||
push @paths, map Slic3r::ExtrusionPath->new(
|
||||
polyline => Slic3r::Polyline->new(@$_),
|
||||
role => EXTR_ROLE_SUPPORTMATERIAL,
|
||||
height => undef,
|
||||
flow_spacing => $params->{flow_spacing},
|
||||
polyline => Slic3r::Polyline->new(@$_),
|
||||
role => EXTR_ROLE_SUPPORTMATERIAL,
|
||||
mm3_per_mm => $mm3_per_mm,
|
||||
), @p;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue