Merge branch 'master' into xs

This commit is contained in:
Alessandro Ranellucci 2013-07-06 11:38:40 +02:00
commit 28f8083ab7
7 changed files with 87 additions and 15 deletions

View File

@ -28,9 +28,15 @@ my %recommends = qw(
Growl::GNTP 0.15
XML::SAX::ExpatXS 0
);
# removed:
# Wx 0.9901
if ($ARGV[0] eq '--gui') {
%prereqs = qw(
Wx 0.9901
);
%recommends = qw(
Wx::GLCanvas 0
OpenGL 0
);
}
my $missing_prereqs = 0;
if ($ENV{SLIC3R_NO_AUTO}) {
@ -80,6 +86,9 @@ If it is installed in a non-standard location you can do:
EOF
if !$cpanm;
# make sure our cpanm is updated (old ones don't support the ~ syntax)
system $cpanm, 'App::cpanminus';
my %modules = (%prereqs, %recommends);
foreach my $module (sort keys %modules) {
my $version = $modules{$module};

View File

@ -6,7 +6,8 @@ use utf8;
use List::Util qw(first);
# cemetery of old config settings
our @Ignore = qw(duplicate_x duplicate_y multiply_x multiply_y support_material_tool acceleration);
our @Ignore = qw(duplicate_x duplicate_y multiply_x multiply_y support_material_tool acceleration
adjust_overhang_flow);
my $serialize_comma = sub { join ',', @{$_[0]} };
my $serialize_comma_bool = sub { join ',', map $_ // 0, @{$_[0]} };
@ -560,7 +561,7 @@ our $Options = {
default => 70,
},
'extra_perimeters' => {
label => 'Generate extra perimeters when needed',
label => 'Extra perimeters if needed',
tooltip => 'Add more perimeters when needed for avoiding gaps in sloping walls.',
cli => 'extra-perimeters!',
type => 'bool',
@ -573,6 +574,34 @@ our $Options = {
type => 'bool',
default => 0,
},
'start_perimeters_at_concave_points' => {
label => 'Concave points',
tooltip => 'Prefer to start perimeters at a concave point.',
cli => 'start-perimeters-at-concave-points!',
type => 'bool',
default => 0,
},
'start_perimeters_at_non_overhang' => {
label => 'Non-overhang points',
tooltip => 'Prefer to start perimeters at non-overhanging points.',
cli => 'start-perimeters-at-non-overhang!',
type => 'bool',
default => 0,
},
'thin_walls' => {
label => 'Detect thin walls',
tooltip => 'Detect single-width walls (parts where two extrusions don\'t fit and we need to collapse them into a single trace).',
cli => 'thin-walls!',
type => 'bool',
default => 1,
},
'overhangs' => {
label => 'Detect overhangs',
tooltip => 'Experimental option to adjust flow for overhangs (bridge flow will be used), to apply bridge speed to them and enable fan.',
cli => 'overhangs!',
type => 'bool',
default => 1,
},
'avoid_crossing_perimeters' => {
label => 'Avoid crossing perimeters',
tooltip => 'Optimize travel moves in order to minimize the crossing of perimeters. This is mostly useful with Bowden extruders which suffer from oozing. This feature slows down both the print and the G-code generation.',

View File

@ -155,9 +155,14 @@ sub extrude_loop {
# find candidate starting points
# start looking for concave vertices not being overhangs
my @concave = $loop->polygon->concave_points;
my @candidates = grep !Boost::Geometry::Utils::point_covered_by_multi_polygon($_, $self->_layer_overhangs),
@concave;
my @concave = ();
if ($Slic3r::Config->start_perimeters_at_concave_points) {
@concave = $loop->polygon->concave_points;
}
my @candidates = ();
if ($Slic3r::Config->start_perimeters_at_non_overhang) {
@candidates = grep !Boost::Geometry::Utils::point_covered_by_multi_polygon($_, $self->_layer_overhangs), @concave;
}
if (!@candidates) {
# if none, look for any concave vertex
@candidates = @concave;
@ -192,7 +197,7 @@ sub extrude_loop {
my @paths = ();
# detect overhanging/bridging perimeters
if ($extrusion_path->is_perimeter && @{$self->_layer_overhangs}) {
if ($Slic3r::Config->overhangs && $extrusion_path->is_perimeter && @{$self->_layer_overhangs}) {
# get non-overhang paths by subtracting overhangs from the loop
push @paths,
$extrusion_path->subtract_expolygons($self->_layer_overhangs);

View File

@ -398,7 +398,7 @@ sub build {
},
{
title => 'Vertical shells',
options => [qw(perimeters randomize_start extra_perimeters)],
options => [qw(perimeters spiral_vase)],
},
{
title => 'Horizontal shells',
@ -410,9 +410,23 @@ sub build {
},
],
},
{
title => 'Quality (slower slicing)',
options => [qw(extra_perimeters avoid_crossing_perimeters start_perimeters_at_concave_points start_perimeters_at_non_overhang thin_walls overhangs)],
lines => [
Slic3r::GUI::OptionsGroup->single_option_line('extra_perimeters'),
Slic3r::GUI::OptionsGroup->single_option_line('avoid_crossing_perimeters'),
{
label => 'Start perimeters at',
options => [qw(start_perimeters_at_concave_points start_perimeters_at_non_overhang)],
},
Slic3r::GUI::OptionsGroup->single_option_line('thin_walls'),
Slic3r::GUI::OptionsGroup->single_option_line('overhangs'),
],
},
{
title => 'Advanced',
options => [qw(avoid_crossing_perimeters external_perimeters_first spiral_vase)],
options => [qw(randomize_start external_perimeters_first)],
},
]);
@ -421,9 +435,13 @@ sub build {
title => 'Infill',
options => [qw(fill_density fill_pattern solid_fill_pattern)],
},
{
title => 'Reducing printing time',
options => [qw(infill_every_layers infill_only_where_needed)],
},
{
title => 'Advanced',
options => [qw(infill_every_layers infill_only_where_needed solid_infill_every_layers fill_angle
options => [qw(solid_infill_every_layers fill_angle
solid_infill_below_area only_retract_when_crossing_perimeters infill_first)],
},
]);

View File

@ -96,7 +96,7 @@ sub make_surfaces {
$self->slices([ _merge_loops($loops) ]);
# detect thin walls by offsetting slices by half extrusion inwards
{
if ($Slic3r::Config->thin_walls) {
my $width = $self->perimeter_flow->scaled_width;
my $diff = diff_ex(
[ map $_->p, @{$self->slices} ],

View File

@ -273,9 +273,7 @@ $j
home X axis [G28 X], disable motors [M84]).
--layer-gcode Load layer-change G-code from the supplied file (default: nothing).
--toolchange-gcode Load tool-change G-code from the supplied file (default: nothing).
--extra-perimeters Add more perimeters when needed (default: yes)
--randomize-start Randomize starting point across layers (default: yes)
--avoid-crossing-perimeters Optimize travel moves so that no perimeters are crossed (default: no)
--external-perimeters-first Reverse perimeter order. (default: no)
--spiral-vase Experimental option to raise Z gradually when printing single-walled vases
(default: no)
@ -289,6 +287,17 @@ $j
Only infill under ceilings (default: no)
--infill-first Make infill before perimeters (default: no)
Quality options (slower slicing):
--extra-perimeters Add more perimeters when needed (default: yes)
--avoid-crossing-perimeters Optimize travel moves so that no perimeters are crossed (default: no)
--start-perimeters-at-concave-points
Try to start perimeters at concave points if any (default: no)
--start-perimeters-at-non-overhang
Try to start perimeters at non-overhang points if any (default: no)
--thin-walls Detect single-width walls (default: yes)
--overhangs Experimental option to use bridge flow, speed and fan for overhangs
(default: yes)
Support material options:
--support-material Generate support material for overhangs
--support-material-threshold

View File

@ -73,6 +73,7 @@ use Slic3r::Test;
}
{
$config->set('start_perimeters_at_concave_points', 1);
my $print = Slic3r::Test::init_print('L', config => $config);
my $loop_starts_from_convex_point = 0;
my $cur_loop;
@ -102,6 +103,7 @@ use Slic3r::Test;
$config->set('fan_below_layer_time', 0);
$config->set('slowdown_below_layer_time', 0);
$config->set('bridge_fan_speed', 100);
$config->set('overhangs', 1);
my $print = Slic3r::Test::init_print('overhang', config => $config);
my %layer_speeds = (); # print Z => [ speeds ]
my $fan_speed = 0;