diff --git a/README.md b/README.md index 13bd1300d..46c19db72 100644 --- a/README.md +++ b/README.md @@ -219,7 +219,7 @@ The author of the Silk icon set is Mark James. 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). - --seal-position Position of loop starting points (random/nearest/aligned, default: aligned). + --seam-position Position of loop starting points (random/nearest/aligned, default: aligned). --external-perimeters-first Reverse perimeter order. (default: no) --spiral-vase Experimental option to raise Z gradually when printing single-walled vases (default: no) diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 625e1f8fd..113d8ce74 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -9,7 +9,7 @@ use List::Util qw(first max); our @Ignore = qw(duplicate_x duplicate_y multiply_x multiply_y support_material_tool acceleration adjust_overhang_flow standby_temperature scale rotate duplicate duplicate_grid rotate scale duplicate_grid start_perimeters_at_concave_points start_perimeters_at_non_overhang - randomize_start); + randomize_start seal_position); our $Options = print_config_def(); @@ -142,7 +142,7 @@ sub _handle_legacy { $value = "$value"; # force update of the PV value, workaround for bug https://rt.cpan.org/Ticket/Display.html?id=94110 } if ($opt_key eq 'randomize_start' && $value) { - $opt_key = 'seal_position'; + $opt_key = 'seam_position'; $value = 'random'; } diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index 73a787d51..f085a3a3d 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -19,7 +19,7 @@ has '_layer_index' => (is => 'rw', default => sub {-1}); # just a counter has 'layer' => (is => 'rw'); has '_layer_islands' => (is => 'rw'); has '_upper_layer_islands' => (is => 'rw'); -has '_seal_position' => (is => 'ro', default => sub { {} }); # $object => pos +has '_seam_position' => (is => 'ro', default => sub { {} }); # $object => pos has 'shift_x' => (is => 'rw', default => sub {0} ); has 'shift_y' => (is => 'rw', default => sub {0} ); has 'z' => (is => 'rw'); @@ -156,7 +156,7 @@ sub extrude_loop { my $last_pos = $self->last_pos; if ($self->config->spiral_vase) { $loop->split_at($last_pos); - } elsif ($self->config->seal_position eq 'nearest' || $self->config->seal_position eq 'aligned') { + } elsif ($self->config->seam_position eq 'nearest' || $self->config->seam_position eq 'aligned') { my $polygon = $loop->polygon; my @candidates = @{$polygon->concave_points(PI*4/3)}; @candidates = @{$polygon->convex_points(PI*2/3)} if !@candidates; @@ -165,16 +165,16 @@ sub extrude_loop { my @non_overhang = grep !$loop->has_overhang_point($_), @candidates; @candidates = @non_overhang if @non_overhang; - if ($self->config->seal_position eq 'nearest') { + if ($self->config->seam_position eq 'nearest') { $loop->split_at_vertex($last_pos->nearest_point(\@candidates)); - } elsif ($self->config->seal_position eq 'aligned') { - if (defined $self->layer && defined $self->_seal_position->{$self->layer->object}) { - $last_pos = $self->_seal_position->{$self->layer->object}; + } elsif ($self->config->seam_position eq 'aligned') { + if (defined $self->layer && defined $self->_seam_position->{$self->layer->object}) { + $last_pos = $self->_seam_position->{$self->layer->object}; } - my $point = $self->_seal_position->{$self->layer->object} = $last_pos->nearest_point(\@candidates); + my $point = $self->_seam_position->{$self->layer->object} = $last_pos->nearest_point(\@candidates); $loop->split_at_vertex($point); } - } elsif ($self->config->seal_position eq 'random') { + } elsif ($self->config->seam_position eq 'random') { if ($loop->role == EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER) { my $polygon = $loop->polygon; my $centroid = $polygon->centroid; diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 1d4945f01..6cc637d71 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -427,7 +427,7 @@ sub build { }, { title => 'Advanced', - options => [qw(seal_position external_perimeters_first)], + options => [qw(seam_position external_perimeters_first)], }, ]); diff --git a/slic3r.pl b/slic3r.pl index aa3a43700..7a249043a 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -342,7 +342,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). - --seal-position Position of loop starting points (random/nearest/aligned, default: $config->{seal_position}). + --seam-position Position of loop starting points (random/nearest/aligned, default: $config->{seam_position}). --external-perimeters-first Reverse perimeter order. (default: no) --spiral-vase Experimental option to raise Z gradually when printing single-walled vases (default: no) diff --git a/t/perimeters.t b/t/perimeters.t index 239f80f2f..d432f480d 100644 --- a/t/perimeters.t +++ b/t/perimeters.t @@ -245,9 +245,9 @@ use Slic3r::Test; { my $config = Slic3r::Config->new_from_defaults; - $config->set('seal_position', 'random'); + $config->set('seam_position', 'random'); my $print = Slic3r::Test::init_print('20mm_cube', config => $config); - ok Slic3r::Test::gcode($print), 'successful generation of G-code with seal_position = random'; + ok Slic3r::Test::gcode($print), 'successful generation of G-code with seam_position = random'; } __END__ diff --git a/xs/src/PrintConfig.hpp b/xs/src/PrintConfig.hpp index 913d81de2..cd31d899b 100644 --- a/xs/src/PrintConfig.hpp +++ b/xs/src/PrintConfig.hpp @@ -18,7 +18,7 @@ enum SupportMaterialPattern { smpRectilinear, smpRectilinearGrid, smpHoneycomb, smpPillars, }; -enum SealPosition { +enum SeamPosition { spRandom, spNearest, spAligned }; @@ -54,7 +54,7 @@ template<> inline t_config_enum_values ConfigOptionEnum: return keys_map; } -template<> inline t_config_enum_values ConfigOptionEnum::get_enum_values() { +template<> inline t_config_enum_values ConfigOptionEnum::get_enum_values() { t_config_enum_values keys_map; keys_map["random"] = spRandom; keys_map["nearest"] = spNearest; @@ -651,18 +651,18 @@ class PrintConfigDef Options["retract_speed"].cli = "retract-speed=f@"; Options["retract_speed"].max = 1000; - Options["seal_position"].type = coEnum; - Options["seal_position"].label = "Seal position"; - Options["seal_position"].category = "Layers and perimeters"; - Options["seal_position"].tooltip = "Position of perimeters starting points."; - Options["seal_position"].cli = "seal-position=s"; - Options["seal_position"].enum_keys_map = ConfigOptionEnum::get_enum_values(); - Options["seal_position"].enum_values.push_back("random"); - Options["seal_position"].enum_values.push_back("nearest"); - Options["seal_position"].enum_values.push_back("aligned"); - Options["seal_position"].enum_labels.push_back("Random"); - Options["seal_position"].enum_labels.push_back("Nearest"); - Options["seal_position"].enum_labels.push_back("Aligned"); + Options["seam_position"].type = coEnum; + Options["seam_position"].label = "Seam position"; + Options["seam_position"].category = "Layers and perimeters"; + Options["seam_position"].tooltip = "Position of perimeters starting points."; + Options["seam_position"].cli = "seam-position=s"; + Options["seam_position"].enum_keys_map = ConfigOptionEnum::get_enum_values(); + Options["seam_position"].enum_values.push_back("random"); + Options["seam_position"].enum_values.push_back("nearest"); + Options["seam_position"].enum_values.push_back("aligned"); + Options["seam_position"].enum_labels.push_back("Random"); + Options["seam_position"].enum_labels.push_back("Nearest"); + Options["seam_position"].enum_labels.push_back("Aligned"); Options["skirt_distance"].type = coFloat; Options["skirt_distance"].label = "Distance from object"; @@ -1006,7 +1006,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig ConfigOptionBool interface_shells; ConfigOptionFloat layer_height; ConfigOptionInt raft_layers; - ConfigOptionEnum seal_position; + ConfigOptionEnum seam_position; ConfigOptionBool support_material; ConfigOptionInt support_material_angle; ConfigOptionInt support_material_enforce_layers; @@ -1031,7 +1031,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig this->interface_shells.value = false; this->layer_height.value = 0.4; this->raft_layers.value = 0; - this->seal_position.value = spAligned; + this->seam_position.value = spAligned; this->support_material.value = false; this->support_material_angle.value = 0; this->support_material_enforce_layers.value = 0; @@ -1057,7 +1057,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig if (opt_key == "interface_shells") return &this->interface_shells; if (opt_key == "layer_height") return &this->layer_height; if (opt_key == "raft_layers") return &this->raft_layers; - if (opt_key == "seal_position") return &this->seal_position; + if (opt_key == "seam_position") return &this->seam_position; if (opt_key == "support_material") return &this->support_material; if (opt_key == "support_material_angle") return &this->support_material_angle; if (opt_key == "support_material_enforce_layers") return &this->support_material_enforce_layers;