mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 05:07:51 -06:00
New seal_position option that replaces randomize_start, start_perimeters_at_concave_points and start_perimeters_at_non_overhang. The two latter options are now always on by default. A new "Aligned" seal position value has been added, that forces starting points to be aligned when not randomized. #1741 #925
This commit is contained in:
parent
c63bd8165d
commit
a3bd1b5302
17 changed files with 153 additions and 112 deletions
|
@ -1,4 +1,4 @@
|
|||
use Test::More tests => 10;
|
||||
use Test::More tests => 9;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
@ -85,28 +85,6 @@ use Slic3r::Test;
|
|||
ok !$has_outwards_move, 'move inwards after completing external loop';
|
||||
}
|
||||
|
||||
{
|
||||
$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;
|
||||
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
|
||||
my ($self, $cmd, $args, $info) = @_;
|
||||
|
||||
if ($info->{extruding} && $info->{dist_XY} > 0) {
|
||||
$cur_loop ||= [ [$self->X, $self->Y] ];
|
||||
push @$cur_loop, [ @$info{qw(new_X new_Y)} ];
|
||||
} else {
|
||||
if ($cur_loop) {
|
||||
$loop_starts_from_convex_point = 1
|
||||
if Slic3r::Geometry::angle3points(@$cur_loop[0,-1,1]) >= PI;
|
||||
$cur_loop = undef;
|
||||
}
|
||||
}
|
||||
});
|
||||
ok !$loop_starts_from_convex_point, 'avoid starting from convex points';
|
||||
}
|
||||
|
||||
{
|
||||
$config->set('perimeters', 1);
|
||||
$config->set('perimeter_speed', 77);
|
||||
|
@ -267,9 +245,9 @@ use Slic3r::Test;
|
|||
|
||||
{
|
||||
my $config = Slic3r::Config->new_from_defaults;
|
||||
$config->set('randomize_start', 1);
|
||||
$config->set('seal_position', 'random');
|
||||
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
|
||||
ok Slic3r::Test::gcode($print), 'successful generation of G-code with randomize_start option';
|
||||
ok Slic3r::Test::gcode($print), 'successful generation of G-code with seal_position = random';
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue