New option to customize support material extrusion width
This commit is contained in:
parent
f9f2361acb
commit
80501d5b3c
@ -237,6 +237,8 @@ The author is Alessandro Ranellucci.
|
||||
Set a different extrusion width for perimeters
|
||||
--infill-extrusion-width
|
||||
Set a different extrusion width for infill
|
||||
--support-material-extrusion-width
|
||||
Set a different extrusion width for support material
|
||||
--bridge-flow-ratio Multiplier for extrusion when bridging (> 0, default: 1)
|
||||
|
||||
|
||||
|
@ -111,12 +111,14 @@ our $extrusion_width = 0;
|
||||
our $first_layer_extrusion_width = 0;
|
||||
our $perimeters_extrusion_width = 0;
|
||||
our $infill_extrusion_width = 0;
|
||||
our $support_material_extrusion_width = 0;
|
||||
our $bridge_flow_ratio = 1;
|
||||
our $overlap_factor = 0.5;
|
||||
our $flow;
|
||||
our $first_layer_flow;
|
||||
our $perimeters_flow;
|
||||
our $infill_flow;
|
||||
our $support_material_flow;
|
||||
|
||||
# print options
|
||||
our $perimeters = 3;
|
||||
|
@ -245,6 +245,11 @@ our $Options = {
|
||||
cli => 'infill-extrusion-width=s',
|
||||
type => 'f',
|
||||
},
|
||||
'support_material_extrusion_width' => {
|
||||
label => 'Support material extrusion width (mm or % or 0 for default)',
|
||||
cli => 'support-material-extrusion-width=s',
|
||||
type => 'f',
|
||||
},
|
||||
'bridge_flow_ratio' => {
|
||||
label => 'Bridge flow ratio',
|
||||
cli => 'bridge-flow-ratio=f',
|
||||
@ -698,8 +703,10 @@ sub validate {
|
||||
width => $Slic3r::first_layer_extrusion_width,
|
||||
);
|
||||
}
|
||||
$Slic3r::perimeters_flow = $Slic3r::extruders->[0]->make_flow(width => $Slic3r::perimeters_extrusion_width || $Slic3r::extrusion_width);
|
||||
$Slic3r::infill_flow = $Slic3r::extruders->[0]->make_flow(width => $Slic3r::infill_extrusion_width || $Slic3r::extrusion_width);
|
||||
$Slic3r::perimeters_flow = $Slic3r::extruders->[0]->make_flow(width => $Slic3r::perimeters_extrusion_width || $Slic3r::extrusion_width);
|
||||
$Slic3r::infill_flow = $Slic3r::extruders->[0]->make_flow(width => $Slic3r::infill_extrusion_width || $Slic3r::extrusion_width);
|
||||
$Slic3r::support_material_flow = $Slic3r::extruders->[ $Slic3r::support_material_extruder ]
|
||||
->make_flow(width => $Slic3r::support_material_extrusion_width || $Slic3r::extrusion_width);
|
||||
|
||||
Slic3r::debugf "Default flow width = %s, spacing = %s, min_spacing = %s\n",
|
||||
$Slic3r::flow->width, $Slic3r::flow->spacing, $Slic3r::flow->min_spacing;
|
||||
|
@ -71,7 +71,7 @@ sub new {
|
||||
},
|
||||
extrusion => {
|
||||
title => 'Extrusion',
|
||||
options => [qw(extrusion_width first_layer_extrusion_width perimeters_extrusion_width infill_extrusion_width bridge_flow_ratio)],
|
||||
options => [qw(extrusion_width first_layer_extrusion_width perimeters_extrusion_width infill_extrusion_width support_material_extrusion_width bridge_flow_ratio)],
|
||||
},
|
||||
output => {
|
||||
title => 'Output',
|
||||
@ -117,7 +117,7 @@ sub new {
|
||||
$make_tab->([qw(cooling notes)]),
|
||||
$make_tab->([qw(printer filament)], [qw(print_speed speed)]),
|
||||
$make_tab->([qw(gcode)]),
|
||||
$make_tab->([qw(extrusion sequential_printing)], [qw(output other)]),
|
||||
$make_tab->([qw(extrusion)], [qw(output other sequential_printing)]),
|
||||
);
|
||||
|
||||
$tabpanel->AddPage(Slic3r::GUI::Plater->new($tabpanel), "Plater");
|
||||
|
@ -490,7 +490,7 @@ sub generate_support_material {
|
||||
|
||||
my $threshold_rad = deg2rad($Slic3r::support_material_threshold + 1); # +1 makes the threshold inclusive
|
||||
my $overhang_width = $threshold_rad == 0 ? undef : scale $Slic3r::layer_height * ((cos $threshold_rad) / (sin $threshold_rad));
|
||||
my $distance_from_object = 1.5 * scale $Slic3r::flow->width;
|
||||
my $distance_from_object = 1.5 * scale $Slic3r::support_material_flow->width;
|
||||
|
||||
# determine support regions in each layer (for upper layers)
|
||||
Slic3r::debugf "Detecting regions\n";
|
||||
@ -514,7 +514,7 @@ sub generate_support_material {
|
||||
[ map @$_, @current_support_regions ],
|
||||
[ map @$_, map $_->expolygon->offset_ex($distance_from_object), @{$layer->slices} ],
|
||||
);
|
||||
$_->simplify(scale $layer->flow->spacing * 2) for @{$layers{$i}};
|
||||
$_->simplify(scale $layer->support_material_flow->spacing * 2) for @{$layers{$i}};
|
||||
|
||||
# step 2: get layer overhangs and put them into queue for adding support inside lower layers
|
||||
# we need an angle threshold for this
|
||||
@ -536,7 +536,7 @@ sub generate_support_material {
|
||||
my $support_patterns = []; # in case we want cross-hatching
|
||||
{
|
||||
# 0.5 makes sure the paths don't get clipped externally when applying them to layers
|
||||
my @support_material_areas = map $_->offset_ex(- 0.5 * scale $Slic3r::flow->width),
|
||||
my @support_material_areas = map $_->offset_ex(- 0.5 * scale $Slic3r::support_material_flow->width),
|
||||
@{union_ex([ map $_->contour, map @$_, values %layers ])};
|
||||
|
||||
my $fill = Slic3r::Fill->new(print => $params{print});
|
||||
@ -547,8 +547,8 @@ sub generate_support_material {
|
||||
foreach my $expolygon (@support_material_areas) {
|
||||
my @paths = $filler->fill_surface(
|
||||
Slic3r::Surface->new(expolygon => $expolygon),
|
||||
density => $Slic3r::flow->spacing / $Slic3r::support_material_spacing,
|
||||
flow_spacing => $Slic3r::flow->spacing,
|
||||
density => $Slic3r::support_material_flow->spacing / $Slic3r::support_material_spacing,
|
||||
flow_spacing => $Slic3r::support_material_flow->spacing,
|
||||
);
|
||||
my $params = shift @paths;
|
||||
|
||||
|
@ -282,6 +282,8 @@ $j
|
||||
Set a different extrusion width for perimeters
|
||||
--infill-extrusion-width
|
||||
Set a different extrusion width for infill
|
||||
--support-material-extrusion-width
|
||||
Set a different extrusion width for support material
|
||||
--bridge-flow-ratio Multiplier for extrusion when bridging (> 0, default: $Slic3r::bridge_flow_ratio)
|
||||
|
||||
EOF
|
||||
|
Loading…
Reference in New Issue
Block a user