Merge remote-tracking branch 'origin/master' into new_main_page_ui

This commit is contained in:
YuSanka 2018-05-15 09:44:11 +02:00
commit e78a885247
39 changed files with 7971 additions and 817 deletions

View File

@ -12,6 +12,7 @@ my %prereqs = qw(
ExtUtils::ParseXS 3.22 ExtUtils::ParseXS 3.22
ExtUtils::XSpp 0 ExtUtils::XSpp 0
ExtUtils::Typemaps 0 ExtUtils::Typemaps 0
ExtUtils::Typemaps::Basic 0
File::Basename 0 File::Basename 0
File::Spec 0 File::Spec 0
Getopt::Long 0 Getopt::Long 0

View File

@ -22,7 +22,6 @@ option(SLIC3R_STATIC "Compile Slic3r with static libraries (Boost, TBB, glew)
option(SLIC3R_GUI "Compile Slic3r with GUI components (OpenGL, wxWidgets)" 1) option(SLIC3R_GUI "Compile Slic3r with GUI components (OpenGL, wxWidgets)" 1)
option(SLIC3R_PRUSACONTROL "Compile Slic3r with the PrusaControl prject file format (requires wxWidgets base library)" 1) option(SLIC3R_PRUSACONTROL "Compile Slic3r with the PrusaControl prject file format (requires wxWidgets base library)" 1)
option(SLIC3R_PROFILE "Compile Slic3r with an invasive Shiny profiler" 0) option(SLIC3R_PROFILE "Compile Slic3r with an invasive Shiny profiler" 0)
option(SLIC3R_HAS_BROKEN_CROAK "Compile Slic3r for a broken Strawberry Perl 64bit" 0)
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1) option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
if (MSVC AND SLIC3R_MSVC_COMPILE_PARALLEL) if (MSVC AND SLIC3R_MSVC_COMPILE_PARALLEL)

View File

@ -679,8 +679,6 @@ sub select_view {
# Avoid gimball lock. # Avoid gimball lock.
$self->_stheta(GIMBALL_LOCK_THETA_MAX) if $self->_stheta > GIMBALL_LOCK_THETA_MAX; $self->_stheta(GIMBALL_LOCK_THETA_MAX) if $self->_stheta > GIMBALL_LOCK_THETA_MAX;
$self->_stheta(0) if $self->_stheta < 0; $self->_stheta(0) if $self->_stheta < 0;
# View everything.
$self->zoom_to_bounding_box($bb);
$self->on_viewport_changed->() if $self->on_viewport_changed; $self->on_viewport_changed->() if $self->on_viewport_changed;
$self->Refresh; $self->Refresh;
} }
@ -908,6 +906,9 @@ sub deselect_volumes {
sub select_volume { sub select_volume {
my ($self, $volume_idx) = @_; my ($self, $volume_idx) = @_;
return if ($volume_idx >= scalar(@{$self->volumes}));
$self->volumes->[$volume_idx]->set_selected(1) $self->volumes->[$volume_idx]->set_selected(1)
if $volume_idx != -1; if $volume_idx != -1;
} }

View File

@ -225,7 +225,13 @@ sub new {
$self->{btoolbar}->Add($self->{"btn_layer_editing"}); $self->{btoolbar}->Add($self->{"btn_layer_editing"});
} }
$self->{list} = Wx::ListView->new($self, -1, wxDefaultPosition, wxDefaultSize, ### Scrolled Window for info boxes
my $scrolled_window_sizer = Wx::BoxSizer->new(wxVERTICAL);
my $scrolled_window_panel = Wx::ScrolledWindow->new($self, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
$scrolled_window_panel->SetSizer($scrolled_window_sizer);
$scrolled_window_panel->SetScrollbars(1, 1, 1, 1);
$self->{list} = Wx::ListView->new($scrolled_window_panel, -1, wxDefaultPosition, wxDefaultSize,
wxLC_SINGLE_SEL | wxLC_REPORT | wxBORDER_SUNKEN | wxTAB_TRAVERSAL | wxWANTS_CHARS ); wxLC_SINGLE_SEL | wxLC_REPORT | wxBORDER_SUNKEN | wxTAB_TRAVERSAL | wxWANTS_CHARS );
$self->{list}->InsertColumn(0, L("Name"), wxLIST_FORMAT_LEFT, 145); $self->{list}->InsertColumn(0, L("Name"), wxLIST_FORMAT_LEFT, 145);
$self->{list}->InsertColumn(1, L("Copies"), wxLIST_FORMAT_CENTER, 45); $self->{list}->InsertColumn(1, L("Copies"), wxLIST_FORMAT_CENTER, 45);
@ -408,9 +414,9 @@ sub new {
my $object_info_sizer; my $object_info_sizer;
{ {
my $box = Wx::StaticBox->new($self, -1, L("Info")); my $box = Wx::StaticBox->new($scrolled_window_panel, -1, L("Info"));
$object_info_sizer = Wx::StaticBoxSizer->new($box, wxVERTICAL); $object_info_sizer = Wx::StaticBoxSizer->new($box, wxVERTICAL);
$object_info_sizer->SetMinSize([350,-1]); $object_info_sizer->SetMinSize([300,-1]);
my $grid_sizer = Wx::FlexGridSizer->new(3, 4, 5, 5); my $grid_sizer = Wx::FlexGridSizer->new(3, 4, 5, 5);
$grid_sizer->SetFlexibleDirection(wxHORIZONTAL); $grid_sizer->SetFlexibleDirection(wxHORIZONTAL);
$grid_sizer->AddGrowableCol(1, 1); $grid_sizer->AddGrowableCol(1, 1);
@ -426,14 +432,14 @@ sub new {
); );
while (my $field = shift @info) { while (my $field = shift @info) {
my $label = shift @info; my $label = shift @info;
my $text = Wx::StaticText->new($self, -1, "$label:", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT); my $text = Wx::StaticText->new($scrolled_window_panel, -1, "$label:", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
$text->SetFont($Slic3r::GUI::small_font); $text->SetFont($Slic3r::GUI::small_font);
$grid_sizer->Add($text, 0); $grid_sizer->Add($text, 0);
$self->{"object_info_$field"} = Wx::StaticText->new($self, -1, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT); $self->{"object_info_$field"} = Wx::StaticText->new($scrolled_window_panel, -1, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
$self->{"object_info_$field"}->SetFont($Slic3r::GUI::small_font); $self->{"object_info_$field"}->SetFont($Slic3r::GUI::small_font);
if ($field eq 'manifold') { if ($field eq 'manifold') {
$self->{object_info_manifold_warning_icon} = Wx::StaticBitmap->new($self, -1, Wx::Bitmap->new(Slic3r::var("error.png"), wxBITMAP_TYPE_PNG)); $self->{object_info_manifold_warning_icon} = Wx::StaticBitmap->new($scrolled_window_panel, -1, Wx::Bitmap->new(Slic3r::var("error.png"), wxBITMAP_TYPE_PNG));
$self->{object_info_manifold_warning_icon}->Hide; $self->{object_info_manifold_warning_icon}->Hide;
my $h_sizer = Wx::BoxSizer->new(wxHORIZONTAL); my $h_sizer = Wx::BoxSizer->new(wxHORIZONTAL);
@ -448,9 +454,9 @@ sub new {
my $print_info_sizer; my $print_info_sizer;
{ {
my $box = Wx::StaticBox->new($self, -1, L("Sliced Info")); my $box = Wx::StaticBox->new($scrolled_window_panel, -1, L("Sliced Info"));
$print_info_sizer = Wx::StaticBoxSizer->new($box, wxVERTICAL); $print_info_sizer = Wx::StaticBoxSizer->new($box, wxVERTICAL);
$print_info_sizer->SetMinSize([350,-1]); $print_info_sizer->SetMinSize([300,-1]);
my $grid_sizer = Wx::FlexGridSizer->new(2, 2, 5, 5); my $grid_sizer = Wx::FlexGridSizer->new(2, 2, 5, 5);
$grid_sizer->SetFlexibleDirection(wxHORIZONTAL); $grid_sizer->SetFlexibleDirection(wxHORIZONTAL);
$grid_sizer->AddGrowableCol(1, 1); $grid_sizer->AddGrowableCol(1, 1);
@ -465,11 +471,11 @@ sub new {
); );
while (my $field = shift @info) { while (my $field = shift @info) {
my $label = shift @info; my $label = shift @info;
my $text = Wx::StaticText->new($self, -1, "$label:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT); my $text = Wx::StaticText->new($scrolled_window_panel, -1, "$label:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
$text->SetFont($Slic3r::GUI::small_font); $text->SetFont($Slic3r::GUI::small_font);
$grid_sizer->Add($text, 0); $grid_sizer->Add($text, 0);
$self->{"print_info_$field"} = Wx::StaticText->new($self, -1, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT); $self->{"print_info_$field"} = Wx::StaticText->new($scrolled_window_panel, -1, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
$self->{"print_info_$field"}->SetFont($Slic3r::GUI::small_font); $self->{"print_info_$field"}->SetFont($Slic3r::GUI::small_font);
$grid_sizer->Add($self->{"print_info_$field"}, 0); $grid_sizer->Add($self->{"print_info_$field"}, 0);
} }
@ -484,19 +490,25 @@ sub new {
$buttons_sizer->Add($self->{btn_send_gcode}, 0, wxALIGN_RIGHT, 0); $buttons_sizer->Add($self->{btn_send_gcode}, 0, wxALIGN_RIGHT, 0);
$buttons_sizer->Add($self->{btn_export_gcode}, 0, wxALIGN_RIGHT, 0); $buttons_sizer->Add($self->{btn_export_gcode}, 0, wxALIGN_RIGHT, 0);
$scrolled_window_sizer->Add($self->{list}, 1, wxEXPAND, 5);
$scrolled_window_sizer->Add($object_info_sizer, 0, wxEXPAND, 0);
$scrolled_window_sizer->Add($print_info_sizer, 0, wxEXPAND, 0);
my $right_sizer = Wx::BoxSizer->new(wxVERTICAL); my $right_sizer = Wx::BoxSizer->new(wxVERTICAL);
$right_sizer->SetMinSize([-1, 600]); $right_sizer->SetMinSize([-1, 600]);
$right_sizer->Add($presets, 0, wxEXPAND | wxTOP, 10) if defined $presets; $right_sizer->Add($presets, 0, wxEXPAND | wxTOP, 10) if defined $presets;
$right_sizer->Add($frequently_changed_parameters_sizer, 0, wxEXPAND | wxTOP, 0) if defined $frequently_changed_parameters_sizer; $right_sizer->Add($frequently_changed_parameters_sizer, 0, wxEXPAND | wxTOP, 0) if defined $frequently_changed_parameters_sizer;
$right_sizer->Add($buttons_sizer, 0, wxEXPAND | wxBOTTOM, 5); $right_sizer->Add($buttons_sizer, 0, wxEXPAND | wxBOTTOM, 5);
$right_sizer->Add($self->{list}, 1, wxEXPAND, 5); $right_sizer->Add($scrolled_window_panel, 1, wxEXPAND | wxALL, 1);
$right_sizer->Add($object_info_sizer, 0, wxEXPAND, 0);
$right_sizer->Add($print_info_sizer, 0, wxEXPAND, 0);
# Callback for showing / hiding the print info box. # Callback for showing / hiding the print info box.
$self->{"print_info_box_show"} = sub { $self->{"print_info_box_show"} = sub {
if ($right_sizer->IsShown(5) != $_[0]) { # if ($right_sizer->IsShown(5) != $_[0]) {
$right_sizer->Show(5, $_[0]); # $right_sizer->Show(5, $_[0]);
$self->Layout # $self->Layout
# }
if ($scrolled_window_sizer->IsShown(2) != $_[0]) {
$scrolled_window_sizer->Show(2, $_[0]);
$scrolled_window_panel->Layout
} }
}; };
# Show the box initially, let it be shown after the slicing is finished. # Show the box initially, let it be shown after the slicing is finished.
@ -702,7 +714,7 @@ sub load_files {
. "Instead of considering them as multiple objects, should I consider\n" . "Instead of considering them as multiple objects, should I consider\n"
. "this file as a single object having multiple parts?\n"), . "this file as a single object having multiple parts?\n"),
L('Multi-part object detected'), wxICON_WARNING | wxYES | wxNO); L('Multi-part object detected'), wxICON_WARNING | wxYES | wxNO);
$model->convert_multipart_object if $dialog->ShowModal() == wxID_YES; $model->convert_multipart_object(scalar(@$nozzle_dmrs)) if $dialog->ShowModal() == wxID_YES;
} }
if ($one_by_one) { if ($one_by_one) {
@ -719,7 +731,7 @@ sub load_files {
. "Instead of considering them as multiple objects, should I consider\n" . "Instead of considering them as multiple objects, should I consider\n"
. "these files to represent a single object having multiple parts?\n"), . "these files to represent a single object having multiple parts?\n"),
L('Multi-part object detected'), wxICON_WARNING | wxYES | wxNO); L('Multi-part object detected'), wxICON_WARNING | wxYES | wxNO);
$new_model->convert_multipart_object if $dialog->ShowModal() == wxID_YES; $new_model->convert_multipart_object(scalar(@$nozzle_dmrs)) if $dialog->ShowModal() == wxID_YES;
push @obj_idx, $self->load_model_objects(@{$new_model->objects}); push @obj_idx, $self->load_model_objects(@{$new_model->objects});
} }
@ -1812,6 +1824,7 @@ sub list_item_deselected {
$self->select_object(undef); $self->select_object(undef);
$self->{canvas}->Refresh; $self->{canvas}->Refresh;
$self->{canvas3D}->deselect_volumes if $self->{canvas3D}; $self->{canvas3D}->deselect_volumes if $self->{canvas3D};
$self->{canvas3D}->Render if $self->{canvas3D};
} }
undef $self->{_lecursor}; undef $self->{_lecursor};
} }
@ -1824,6 +1837,7 @@ sub list_item_selected {
$self->select_object($obj_idx); $self->select_object($obj_idx);
$self->{canvas}->Refresh; $self->{canvas}->Refresh;
$self->{canvas3D}->update_volumes_selection if $self->{canvas3D}; $self->{canvas3D}->update_volumes_selection if $self->{canvas3D};
$self->{canvas3D}->Render if $self->{canvas3D};
undef $self->{_lecursor}; undef $self->{_lecursor};
} }

View File

@ -32,7 +32,7 @@ sub new {
$self->{on_instances_moved} = sub {}; $self->{on_instances_moved} = sub {};
$self->{on_wipe_tower_moved} = sub {}; $self->{on_wipe_tower_moved} = sub {};
$self->{objects_volumes_idxs} = (); $self->{objects_volumes_idxs} = [];
$self->on_select(sub { $self->on_select(sub {
my ($volume_idx) = @_; my ($volume_idx) = @_;
@ -188,8 +188,8 @@ sub update_volumes_selection {
foreach my $obj_idx (0..$#{$self->{model}->objects}) { foreach my $obj_idx (0..$#{$self->{model}->objects}) {
if ($self->{objects}[$obj_idx]->selected) { if ($self->{objects}[$obj_idx]->selected) {
my @volume_idxs = @{$self->{objects_volumes_idxs}[$obj_idx]}; my $volume_idxs = $self->{objects_volumes_idxs}->[$obj_idx];
$self->select_volume($_) for @volume_idxs; $self->select_volume($_) for @{$volume_idxs};
} }
} }
} }
@ -207,7 +207,7 @@ sub reload_scene {
$self->{reload_delayed} = 0; $self->{reload_delayed} = 0;
$self->{objects_volumes_idxs} = (); $self->{objects_volumes_idxs} = [];
foreach my $obj_idx (0..$#{$self->{model}->objects}) { foreach my $obj_idx (0..$#{$self->{model}->objects}) {
my @volume_idxs = $self->load_object($self->{model}, $self->{print}, $obj_idx); my @volume_idxs = $self->load_object($self->{model}, $self->{print}, $obj_idx);
push(@{$self->{objects_volumes_idxs}}, \@volume_idxs); push(@{$self->{objects_volumes_idxs}}, \@volume_idxs);

View File

@ -58,6 +58,13 @@ sub new {
[40,-1], wxALIGN_CENTRE_HORIZONTAL); [40,-1], wxALIGN_CENTRE_HORIZONTAL);
$z_label_high->SetFont($Slic3r::GUI::small_font); $z_label_high->SetFont($Slic3r::GUI::small_font);
my $z_label_low_idx = $self->{z_label_low_idx} = Wx::StaticText->new($self, -1, "", wxDefaultPosition,
[40,-1], wxALIGN_CENTRE_HORIZONTAL);
$z_label_low_idx->SetFont($Slic3r::GUI::small_font);
my $z_label_high_idx = $self->{z_label_high_idx} = Wx::StaticText->new($self, -1, "", wxDefaultPosition,
[40,-1], wxALIGN_CENTRE_HORIZONTAL);
$z_label_high_idx->SetFont($Slic3r::GUI::small_font);
$self->single_layer(0); $self->single_layer(0);
my $checkbox_singlelayer = $self->{checkbox_singlelayer} = Wx::CheckBox->new($self, -1, L("1 Layer")); my $checkbox_singlelayer = $self->{checkbox_singlelayer} = Wx::CheckBox->new($self, -1, L("1 Layer"));
@ -103,11 +110,13 @@ sub new {
my $hsizer = Wx::BoxSizer->new(wxHORIZONTAL); my $hsizer = Wx::BoxSizer->new(wxHORIZONTAL);
my $vsizer = Wx::BoxSizer->new(wxVERTICAL); my $vsizer = Wx::BoxSizer->new(wxVERTICAL);
my $vsizer_outer = Wx::BoxSizer->new(wxVERTICAL); my $vsizer_outer = Wx::BoxSizer->new(wxVERTICAL);
$vsizer->Add($slider_low, 3, 0, 0); $vsizer->Add($slider_low, 3, wxALIGN_CENTER_HORIZONTAL, 0);
$vsizer->Add($z_label_low, 0, 0, 0); $vsizer->Add($z_label_low_idx, 0, wxALIGN_CENTER_HORIZONTAL, 0);
$vsizer->Add($z_label_low, 0, wxALIGN_CENTER_HORIZONTAL, 0);
$hsizer->Add($vsizer, 0, wxEXPAND, 0); $hsizer->Add($vsizer, 0, wxEXPAND, 0);
$vsizer = Wx::BoxSizer->new(wxVERTICAL); $vsizer = Wx::BoxSizer->new(wxVERTICAL);
$vsizer->Add($slider_high, 3, 0, 0); $vsizer->Add($slider_high, 3, wxALIGN_CENTER_HORIZONTAL, 0);
$vsizer->Add($z_label_high_idx, 0, wxALIGN_CENTER_HORIZONTAL, 0);
$vsizer->Add($z_label_high, 0, 0, 0); $vsizer->Add($z_label_high, 0, 0, 0);
$hsizer->Add($vsizer, 0, wxEXPAND, 0); $hsizer->Add($vsizer, 0, wxEXPAND, 0);
$vsizer_outer->Add($hsizer, 3, wxALIGN_CENTER_HORIZONTAL, 0); $vsizer_outer->Add($hsizer, 3, wxALIGN_CENTER_HORIZONTAL, 0);
@ -325,6 +334,8 @@ sub load_print {
$self->slider_high->Hide; $self->slider_high->Hide;
$self->{z_label_low}->SetLabel(""); $self->{z_label_low}->SetLabel("");
$self->{z_label_high}->SetLabel(""); $self->{z_label_high}->SetLabel("");
$self->{z_label_low_idx}->SetLabel("");
$self->{z_label_high_idx}->SetLabel("");
$self->canvas->reset_legend_texture(); $self->canvas->reset_legend_texture();
$self->canvas->Refresh; # clears canvas $self->canvas->Refresh; # clears canvas
return; return;
@ -427,6 +438,10 @@ sub set_z_range
return if !$self->enabled; return if !$self->enabled;
$self->{z_label_low}->SetLabel(sprintf '%.2f', $z_low); $self->{z_label_low}->SetLabel(sprintf '%.2f', $z_low);
$self->{z_label_high}->SetLabel(sprintf '%.2f', $z_high); $self->{z_label_high}->SetLabel(sprintf '%.2f', $z_high);
my $z_idx_low = 1 + $self->slider_low->GetValue;
my $z_idx_high = 1 + $self->slider_high->GetValue;
$self->{z_label_low_idx}->SetLabel(sprintf '%d', $z_idx_low);
$self->{z_label_high_idx}->SetLabel(sprintf '%d', $z_idx_high);
$self->canvas->set_toolpaths_range($z_low - 1e-6, $z_high + 1e-6); $self->canvas->set_toolpaths_range($z_low - 1e-6, $z_high + 1e-6);
$self->canvas->Refresh if $self->IsShown; $self->canvas->Refresh if $self->IsShown;
} }

View File

@ -475,7 +475,8 @@ sub on_btn_split {
my $itemData = $self->get_selection; my $itemData = $self->get_selection;
if ($itemData && $itemData->{type} eq 'volume') { if ($itemData && $itemData->{type} eq 'volume') {
my $volume = $self->{model_object}->volumes->[$itemData->{volume_id}]; my $volume = $self->{model_object}->volumes->[$itemData->{volume_id}];
$self->{parts_changed} = 1 if $volume->split > 1; my $nozzle_dmrs = $self->GetParent->GetParent->GetParent->{config}->get('nozzle_diameter');
$self->{parts_changed} = 1 if $volume->split(scalar(@$nozzle_dmrs)) > 1;
} }
$self->_parts_changed; $self->_parts_changed;

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -214,7 +214,7 @@ msgstr "&Carica Gruppo di Configurazioni…"
#: c:\src\Slic3r\lib\Slic3r\GUI\MainFrame.pm:254 #: c:\src\Slic3r\lib\Slic3r\GUI\MainFrame.pm:254
msgid "&Load Config…\tCtrl+L" msgid "&Load Config…\tCtrl+L"
msgstr "Carica Configurazione…\tCtrl+&L" msgstr "&Carica Configurazione…\tCtrl+L"
#: c:\src\Slic3r\xs\src\slic3r\GUI\GUI.cpp:339 #: c:\src\Slic3r\xs\src\slic3r\GUI\GUI.cpp:339
msgid "&Localization" msgid "&Localization"
@ -1856,7 +1856,7 @@ msgstr "Aprire un modello"
#: c:\src\Slic3r\lib\Slic3r\GUI\MainFrame.pm:251 #: c:\src\Slic3r\lib\Slic3r\GUI\MainFrame.pm:251
msgid "Open STL/OBJ/AMF…\tCtrl+O" msgid "Open STL/OBJ/AMF…\tCtrl+O"
msgstr "Aprire un STL/OBJ/AMF… Ctrl+O" msgstr "Aprire un STL/OBJ/AMF… \tCtrl+O"
#: c:\src\Slic3r\lib\Slic3r\GUI\Plater.pm:2102 #: c:\src\Slic3r\lib\Slic3r\GUI\Plater.pm:2102
msgid "Open the 3D cutting tool" msgid "Open the 3D cutting tool"
@ -2003,7 +2003,7 @@ msgstr "Preferenze"
#: c:\src\Slic3r\lib\Slic3r\GUI\MainFrame.pm:299 #: c:\src\Slic3r\lib\Slic3r\GUI\MainFrame.pm:299
msgid "Preferences…\tCtrl+," msgid "Preferences…\tCtrl+,"
msgstr "Preferenze…Ctrl+," msgstr "Preferenze…\tCtrl+,"
#: C:\src\Slic3r\xs\src\libslic3r\PrintConfig.cpp:1171 #: C:\src\Slic3r\xs\src\libslic3r\PrintConfig.cpp:1171
msgid "Preferred direction of the seam" msgid "Preferred direction of the seam"
@ -2079,7 +2079,7 @@ msgstr "Versioni Prusa Edition"
#: c:\src\Slic3r\lib\Slic3r\GUI\MainFrame.pm:268 #: c:\src\Slic3r\lib\Slic3r\GUI\MainFrame.pm:268
msgid "Q&uick Slice…\tCtrl+U" msgid "Q&uick Slice…\tCtrl+U"
msgstr "Slice Rapido… \tCtrl+&U" msgstr "Slice &Rapido… \tCtrl+U"
#: c:\src\Slic3r\xs\src\slic3r\GUI\Tab.cpp:335 #: c:\src\Slic3r\xs\src\slic3r\GUI\Tab.cpp:335
msgid "Quality (slower slicing)" msgid "Quality (slower slicing)"

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1 +1,3 @@
0.1.2 Wipe tower changes
0.1.1 Minor print speed adjustments
0.1.0 Initial 0.1.0 Initial

View File

@ -5,7 +5,7 @@
name = Prusa Research name = Prusa Research
# Configuration version of this file. Config file will only be installed, if the config_version differs. # Configuration version of this file. Config file will only be installed, if the config_version differs.
# This means, the server may force the Slic3r configuration to be downgraded. # This means, the server may force the Slic3r configuration to be downgraded.
config_version = 0.1.0 config_version = 0.1.2
# Where to get the updates from? # Where to get the updates from?
config_update_url = https://raw.githubusercontent.com/prusa3d/Slic3r-settings/master/live/PrusaResearch/ config_update_url = https://raw.githubusercontent.com/prusa3d/Slic3r-settings/master/live/PrusaResearch/
@ -90,7 +90,7 @@ seam_position = nearest
skirts = 1 skirts = 1
skirt_distance = 2 skirt_distance = 2
skirt_height = 3 skirt_height = 3
small_perimeter_speed = 20 small_perimeter_speed = 25
solid_infill_below_area = 0 solid_infill_below_area = 0
solid_infill_every_layers = 0 solid_infill_every_layers = 0
solid_infill_extruder = 1 solid_infill_extruder = 1
@ -121,7 +121,8 @@ top_infill_extrusion_width = 0.45
top_solid_infill_speed = 40 top_solid_infill_speed = 40
travel_speed = 180 travel_speed = 180
wipe_tower = 1 wipe_tower = 1
wipe_tower_per_color_wipe = 20 wipe_tower_bridging = 10
wipe_tower_rotation_angle = 0
wipe_tower_width = 60 wipe_tower_width = 60
wipe_tower_x = 180 wipe_tower_x = 180
wipe_tower_y = 140 wipe_tower_y = 140
@ -179,7 +180,7 @@ gap_fill_speed = 20
infill_acceleration = 800 infill_acceleration = 800
infill_speed = 30 infill_speed = 30
max_print_speed = 80 max_print_speed = 80
small_perimeter_speed = 15 small_perimeter_speed = 20
solid_infill_speed = 30 solid_infill_speed = 30
support_material_extrusion_width = 0.3 support_material_extrusion_width = 0.3
support_material_spacing = 1.5 support_material_spacing = 1.5
@ -214,7 +215,7 @@ infill_speed = 20
max_print_speed = 100 max_print_speed = 100
perimeter_extrusion_width = 0 perimeter_extrusion_width = 0
perimeter_speed = 20 perimeter_speed = 20
small_perimeter_speed = 10 small_perimeter_speed = 15
solid_infill_extrusion_width = 0 solid_infill_extrusion_width = 0
solid_infill_speed = 20 solid_infill_speed = 20
support_material_speed = 20 support_material_speed = 20
@ -267,7 +268,7 @@ infill_acceleration = 1600
infill_speed = 40 infill_speed = 40
perimeter_acceleration = 600 perimeter_acceleration = 600
perimeter_speed = 25 perimeter_speed = 25
small_perimeter_speed = 10 small_perimeter_speed = 15
solid_infill_speed = 40 solid_infill_speed = 40
top_solid_infill_speed = 30 top_solid_infill_speed = 30
@ -340,7 +341,7 @@ infill_acceleration = 1600
infill_speed = 40 infill_speed = 40
perimeter_acceleration = 600 perimeter_acceleration = 600
perimeter_speed = 25 perimeter_speed = 25
small_perimeter_speed = 10 small_perimeter_speed = 15
solid_infill_speed = 40 solid_infill_speed = 40
support_material_extrusion_width = 0.2 support_material_extrusion_width = 0.2
top_solid_infill_speed = 30 top_solid_infill_speed = 30
@ -538,13 +539,17 @@ compatible_printers =
compatible_printers_condition = compatible_printers_condition =
end_filament_gcode = "; Filament-specific end gcode" end_filament_gcode = "; Filament-specific end gcode"
extrusion_multiplier = 1 extrusion_multiplier = 1
filament_loading_speed = 28
filament_unloading_speed = 90
filament_toolchange_delay = 0
filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6"
filament_cost = 0 filament_cost = 0
filament_density = 0 filament_density = 0
filament_diameter = 1.75 filament_diameter = 1.75
filament_notes = "" filament_notes = ""
filament_settings_id = filament_settings_id =
filament_soluble = 0 filament_soluble = 0
min_print_speed = 5 min_print_speed = 15
slowdown_below_layer_time = 20 slowdown_below_layer_time = 20
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}30{endif}; Filament gcode" start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}30{endif}; Filament gcode"
@ -591,6 +596,7 @@ fan_always_on = 0
fan_below_layer_time = 20 fan_below_layer_time = 20
filament_colour = #3A80CA filament_colour = #3A80CA
filament_max_volumetric_speed = 11 filament_max_volumetric_speed = 11
filament_ramming_parameters = "120 100 5.70968 6.03226 7 8.25806 9 9.19355 9.3871 9.77419 10.129 10.3226 10.4516 10.5161| 0.05 5.69677 0.45 6.15484 0.95 8.76774 1.45 9.20323 1.95 9.95806 2.45 10.3871 2.95 10.5677 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6"
filament_type = ABS filament_type = ABS
first_layer_bed_temperature = 100 first_layer_bed_temperature = 100
first_layer_temperature = 255 first_layer_temperature = 255
@ -637,7 +643,6 @@ first_layer_bed_temperature = 105
first_layer_temperature = 270 first_layer_temperature = 270
max_fan_speed = 20 max_fan_speed = 20
min_fan_speed = 10 min_fan_speed = 10
min_print_speed = 5
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}45{endif}; Filament gcode" start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}45{endif}; Filament gcode"
temperature = 270 temperature = 270
@ -651,7 +656,6 @@ extrusion_multiplier = 1.2
filament_colour = #804040 filament_colour = #804040
filament_max_volumetric_speed = 10 filament_max_volumetric_speed = 10
first_layer_temperature = 200 first_layer_temperature = 200
min_print_speed = 5
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}10{endif}; Filament gcode" start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}10{endif}; Filament gcode"
temperature = 200 temperature = 200
@ -763,6 +767,7 @@ fan_always_on = 0
filament_colour = #FFFFD7 filament_colour = #FFFFD7
filament_max_volumetric_speed = 10 filament_max_volumetric_speed = 10
filament_notes = "List of materials tested with standart PVA print settings for MK2:\n\nPrimaSelect PVA+\nICE FILAMENTS PVA 'NAUGHTY NATURAL'\nVerbatim BVOH" filament_notes = "List of materials tested with standart PVA print settings for MK2:\n\nPrimaSelect PVA+\nICE FILAMENTS PVA 'NAUGHTY NATURAL'\nVerbatim BVOH"
filament_ramming_parameters = "120 100 8.3871 8.6129 8.93548 9.22581 9.48387 9.70968 9.87097 10.0323 10.2258 10.4194 10.6452 10.8065| 0.05 8.34193 0.45 8.73548 0.95 9.34836 1.45 9.78385 1.95 10.0871 2.45 10.5161 2.95 10.8903 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6"
filament_soluble = 1 filament_soluble = 1
filament_type = PVA filament_type = PVA
first_layer_temperature = 195 first_layer_temperature = 195
@ -816,7 +821,6 @@ first_layer_bed_temperature = 60
first_layer_temperature = 240 first_layer_temperature = 240
max_fan_speed = 5 max_fan_speed = 5
min_fan_speed = 0 min_fan_speed = 0
min_print_speed = 5
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}10{endif}; Filament gcode" start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}10{endif}; Filament gcode"
temperature = 250 temperature = 250
@ -849,7 +853,6 @@ first_layer_bed_temperature = 60
first_layer_temperature = 215 first_layer_temperature = 215
max_fan_speed = 100 max_fan_speed = 100
min_fan_speed = 100 min_fan_speed = 100
min_print_speed = 15
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}10{endif}; Filament gcode" start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}10{endif}; Filament gcode"
temperature = 210 temperature = 210
@ -870,7 +873,6 @@ first_layer_bed_temperature = 100
first_layer_temperature = 220 first_layer_temperature = 220
max_fan_speed = 100 max_fan_speed = 100
min_fan_speed = 100 min_fan_speed = 100
min_print_speed = 15
start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}10{endif}; Filament gcode" start_filament_gcode = "M900 K{if printer_notes=~/.*PRINTER_HAS_BOWDEN.*/}200{else}10{endif}; Filament gcode"
temperature = 220 temperature = 220
@ -931,6 +933,9 @@ retract_lift_below = 199
retract_restart_extra = 0 retract_restart_extra = 0
retract_restart_extra_toolchange = 0 retract_restart_extra_toolchange = 0
retract_speed = 80 retract_speed = 80
parking_pos_retraction = 92
cooling_tube_length = 5
cooling_tube_retraction = 91.5
single_extruder_multi_material = 1 single_extruder_multi_material = 1
printer_model = MK2SMM printer_model = MK2SMM

View File

@ -475,10 +475,6 @@ if (SLIC3R_PROFILE)
add_definitions(-DSLIC3R_PROFILE) add_definitions(-DSLIC3R_PROFILE)
endif () endif ()
if (SLIC3R_HAS_BROKEN_CROAK)
target_compile_definitions(XS PRIVATE -DSLIC3R_HAS_BROKEN_CROAK)
endif ()
if (CMAKE_BUILD_TYPE MATCHES DEBUG) if (CMAKE_BUILD_TYPE MATCHES DEBUG)
target_compile_definitions(XS PRIVATE -DSLIC3R_DEBUG -DDEBUG -D_DEBUG) target_compile_definitions(XS PRIVATE -DSLIC3R_DEBUG -DDEBUG -D_DEBUG)
else () else ()

View File

@ -1287,6 +1287,10 @@ void GCode::process_layer(
m_wipe_tower->tool_change(*this, extruder_id, extruder_id == layer_tools.extruders.back()) : m_wipe_tower->tool_change(*this, extruder_id, extruder_id == layer_tools.extruders.back()) :
this->set_extruder(extruder_id); this->set_extruder(extruder_id);
// let analyzer tag generator aware of a role type change
if (m_enable_analyzer && layer_tools.has_wipe_tower && m_wipe_tower)
m_last_analyzer_extrusion_role = erWipeTower;
if (extrude_skirt) { if (extrude_skirt) {
auto loops_it = skirt_loops_per_extruder.find(extruder_id); auto loops_it = skirt_loops_per_extruder.find(extruder_id);
if (loops_it != skirt_loops_per_extruder.end()) { if (loops_it != skirt_loops_per_extruder.end()) {
@ -2170,7 +2174,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
double F = speed * 60; // convert mm/sec to mm/min double F = speed * 60; // convert mm/sec to mm/min
// extrude arc or line // extrude arc or line
if (m_enable_extrusion_role_markers || m_enable_analyzer) if (m_enable_extrusion_role_markers)
{ {
if (path.role() != m_last_extrusion_role) if (path.role() != m_last_extrusion_role)
{ {
@ -2181,18 +2185,20 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
sprintf(buf, ";_EXTRUSION_ROLE:%d\n", int(m_last_extrusion_role)); sprintf(buf, ";_EXTRUSION_ROLE:%d\n", int(m_last_extrusion_role));
gcode += buf; gcode += buf;
} }
if (m_enable_analyzer)
{
char buf[32];
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), int(m_last_extrusion_role));
gcode += buf;
}
} }
} }
// adds analyzer tags and updates analyzer's tracking data // adds analyzer tags and updates analyzer's tracking data
if (m_enable_analyzer) if (m_enable_analyzer)
{ {
if (path.role() != m_last_analyzer_extrusion_role)
{
m_last_analyzer_extrusion_role = path.role();
char buf[32];
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), int(m_last_analyzer_extrusion_role));
gcode += buf;
}
if (m_last_mm3_per_mm != path.mm3_per_mm) if (m_last_mm3_per_mm != path.mm3_per_mm)
{ {
m_last_mm3_per_mm = path.mm3_per_mm; m_last_mm3_per_mm = path.mm3_per_mm;
@ -2230,6 +2236,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
if (path.role() == erExternalPerimeter) if (path.role() == erExternalPerimeter)
comment += ";_EXTERNAL_PERIMETER"; comment += ";_EXTERNAL_PERIMETER";
} }
// F is mm per minute. // F is mm per minute.
gcode += m_writer.set_speed(F, "", comment); gcode += m_writer.set_speed(F, "", comment);
double path_length = 0.; double path_length = 0.;

View File

@ -121,6 +121,7 @@ public:
m_enable_cooling_markers(false), m_enable_cooling_markers(false),
m_enable_extrusion_role_markers(false), m_enable_extrusion_role_markers(false),
m_enable_analyzer(false), m_enable_analyzer(false),
m_last_analyzer_extrusion_role(erNone),
m_layer_count(0), m_layer_count(0),
m_layer_index(-1), m_layer_index(-1),
m_layer(nullptr), m_layer(nullptr),
@ -253,6 +254,7 @@ protected:
// Extended markers will be added during G-code generation. // Extended markers will be added during G-code generation.
// The G-code Analyzer will remove these comments from the final G-code. // The G-code Analyzer will remove these comments from the final G-code.
bool m_enable_analyzer; bool m_enable_analyzer;
ExtrusionRole m_last_analyzer_extrusion_role;
// How many times will change_layer() be called? // How many times will change_layer() be called?
// change_layer() will update the progress bar. // change_layer() will update the progress bar.
unsigned int m_layer_count; unsigned int m_layer_count;

View File

@ -536,7 +536,7 @@ float CoolingBuffer::calculate_layer_slowdown(std::vector<PerExtruderAdjustments
adj.time_total = adj.elapsed_time_total(); adj.time_total = adj.elapsed_time_total();
// Maximum time for this extruder, when all extrusion moves are slowed down to min_extrusion_speed. // Maximum time for this extruder, when all extrusion moves are slowed down to min_extrusion_speed.
adj.time_maximum = adj.maximum_time_after_slowdown(true); adj.time_maximum = adj.maximum_time_after_slowdown(true);
if (adj.cooling_slow_down_enabled) { if (adj.cooling_slow_down_enabled && adj.lines.size() > 0) {
by_slowdown_time.emplace_back(&adj); by_slowdown_time.emplace_back(&adj);
if (! m_cooling_logic_proportional) if (! m_cooling_logic_proportional)
// sorts the lines, also sets adj.time_non_adjustable // sorts the lines, also sets adj.time_non_adjustable

View File

@ -275,7 +275,7 @@ bool GCodePreviewData::empty() const
return extrusion.layers.empty() && travel.polylines.empty() && retraction.positions.empty() && unretraction.positions.empty(); return extrusion.layers.empty() && travel.polylines.empty() && retraction.positions.empty() && unretraction.positions.empty();
} }
const GCodePreviewData::Color& GCodePreviewData::get_extrusion_role_color(ExtrusionRole role) const GCodePreviewData::Color GCodePreviewData::get_extrusion_role_color(ExtrusionRole role) const
{ {
return extrusion.role_colors[role]; return extrusion.role_colors[role];
} }

View File

@ -187,7 +187,7 @@ public:
void reset(); void reset();
bool empty() const; bool empty() const;
const Color& get_extrusion_role_color(ExtrusionRole role) const; Color get_extrusion_role_color(ExtrusionRole role) const;
Color get_height_color(float height) const; Color get_height_color(float height) const;
Color get_width_color(float width) const; Color get_width_color(float width) const;
Color get_feedrate_color(float feedrate) const; Color get_feedrate_color(float feedrate) const;

View File

@ -126,6 +126,11 @@ public:
m_extrusions.emplace_back(WipeTower::Extrusion(WipeTower::xy(rot.x, rot.y), width, m_current_tool)); m_extrusions.emplace_back(WipeTower::Extrusion(WipeTower::xy(rot.x, rot.y), width, m_current_tool));
} }
// adds tag for analyzer
char buf[64];
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erWipeTower);
m_gcode += buf;
m_gcode += "G1"; m_gcode += "G1";
if (rot.x != rotated_current_pos.x) { if (rot.x != rotated_current_pos.x) {
m_gcode += set_format_X(rot.x); // Transform current position back to wipe tower coordinates (was updated by set_format_X) m_gcode += set_format_X(rot.x); // Transform current position back to wipe tower coordinates (was updated by set_format_X)
@ -488,11 +493,6 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime(
.travel(cleaning_box.ld, 7200) .travel(cleaning_box.ld, 7200)
.set_extruder_trimpot(750); // Increase the extruder driver current to allow fast ramming. .set_extruder_trimpot(750); // Increase the extruder driver current to allow fast ramming.
// adds tag for analyzer
char buf[32];
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erWipeTower);
writer.append(buf);
for (size_t idx_tool = 0; idx_tool < tools.size(); ++ idx_tool) { for (size_t idx_tool = 0; idx_tool < tools.size(); ++ idx_tool) {
unsigned int tool = tools[idx_tool]; unsigned int tool = tools[idx_tool];
m_left_to_right = true; m_left_to_right = true;
@ -585,12 +585,6 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
xy initial_position = cleaning_box.ld + WipeTower::xy(0.f,m_depth_traversed); xy initial_position = cleaning_box.ld + WipeTower::xy(0.f,m_depth_traversed);
writer.set_initial_position(initial_position); writer.set_initial_position(initial_position);
// adds tag for analyzer
char buf[32];
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erWipeTower);
writer.append(buf);
// Increase the extruder driver current to allow fast ramming. // Increase the extruder driver current to allow fast ramming.
writer.set_extruder_trimpot(750); writer.set_extruder_trimpot(750);
@ -658,11 +652,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::toolchange_Brim(bool sideOnly, flo
xy initial_position = wipeTower_box.lu - xy(m_perimeter_width * 6.f, 0); xy initial_position = wipeTower_box.lu - xy(m_perimeter_width * 6.f, 0);
writer.set_initial_position(initial_position); writer.set_initial_position(initial_position);
// adds tag for analyzer writer.extrude_explicit(wipeTower_box.ld - xy(m_perimeter_width * 6.f, 0), // Prime the extruder left of the wipe tower.
char buf[32];
sprintf(buf, ";%s%d\n", GCodeAnalyzer::Extrusion_Role_Tag.c_str(), erWipeTower);
writer.append(buf)
.extrude_explicit(wipeTower_box.ld - xy(m_perimeter_width * 6.f, 0), // Prime the extruder left of the wipe tower.
1.5f * m_extrusion_flow * (wipeTower_box.lu.y - wipeTower_box.ld.y), 2400); 1.5f * m_extrusion_flow * (wipeTower_box.lu.y - wipeTower_box.ld.y), 2400);
// The tool is supposed to be active and primed at the time when the wipe tower brim is extruded. // The tool is supposed to be active and primed at the time when the wipe tower brim is extruded.

View File

@ -404,7 +404,7 @@ bool Model::looks_like_multipart_object() const
return false; return false;
} }
void Model::convert_multipart_object() void Model::convert_multipart_object(unsigned int max_extruders)
{ {
if (this->objects.empty()) if (this->objects.empty())
return; return;
@ -421,7 +421,7 @@ void Model::convert_multipart_object()
if (new_v != nullptr) if (new_v != nullptr)
{ {
new_v->name = o->name; new_v->name = o->name;
new_v->config.set_deserialize("extruder", get_auto_extruder_id_as_string()); new_v->config.set_deserialize("extruder", get_auto_extruder_id_as_string(max_extruders));
} }
} }
@ -481,20 +481,20 @@ bool Model::fits_print_volume(const FullPrintConfig &config) const
return print_volume.contains(transformed_bounding_box()); return print_volume.contains(transformed_bounding_box());
} }
unsigned int Model::get_auto_extruder_id() unsigned int Model::get_auto_extruder_id(unsigned int max_extruders)
{ {
unsigned int id = s_auto_extruder_id; unsigned int id = s_auto_extruder_id;
if (++s_auto_extruder_id > 4) if (++s_auto_extruder_id > max_extruders)
reset_auto_extruder_id(); reset_auto_extruder_id();
return id; return id;
} }
std::string Model::get_auto_extruder_id_as_string() std::string Model::get_auto_extruder_id_as_string(unsigned int max_extruders)
{ {
char str_extruder[64]; char str_extruder[64];
sprintf(str_extruder, "%ud", get_auto_extruder_id()); sprintf(str_extruder, "%ud", get_auto_extruder_id(max_extruders));
return str_extruder; return str_extruder;
} }
@ -996,7 +996,7 @@ ModelMaterial* ModelVolume::assign_unique_material()
// Split this volume, append the result to the object owning this volume. // Split this volume, append the result to the object owning this volume.
// Return the number of volumes created from this one. // Return the number of volumes created from this one.
// This is useful to assign different materials to different volumes of an object. // This is useful to assign different materials to different volumes of an object.
size_t ModelVolume::split() size_t ModelVolume::split(unsigned int max_extruders)
{ {
TriangleMeshPtrs meshptrs = this->mesh.split(); TriangleMeshPtrs meshptrs = this->mesh.split();
if (meshptrs.size() <= 1) { if (meshptrs.size() <= 1) {
@ -1019,7 +1019,7 @@ size_t ModelVolume::split()
char str_idx[64]; char str_idx[64];
sprintf(str_idx, "_%d", idx + 1); sprintf(str_idx, "_%d", idx + 1);
this->object->volumes[ivolume]->name = name + str_idx; this->object->volumes[ivolume]->name = name + str_idx;
this->object->volumes[ivolume]->config.set_deserialize("extruder", Model::get_auto_extruder_id_as_string()); this->object->volumes[ivolume]->config.set_deserialize("extruder", Model::get_auto_extruder_id_as_string(max_extruders));
delete mesh; delete mesh;
++ idx; ++ idx;
} }

View File

@ -173,7 +173,7 @@ public:
// Split this volume, append the result to the object owning this volume. // Split this volume, append the result to the object owning this volume.
// Return the number of volumes created from this one. // Return the number of volumes created from this one.
// This is useful to assign different materials to different volumes of an object. // This is useful to assign different materials to different volumes of an object.
size_t split(); size_t split(unsigned int max_extruders);
ModelMaterial* assign_unique_material(); ModelMaterial* assign_unique_material();
@ -280,7 +280,7 @@ public:
void duplicate_objects_grid(size_t x, size_t y, coordf_t dist); void duplicate_objects_grid(size_t x, size_t y, coordf_t dist);
bool looks_like_multipart_object() const; bool looks_like_multipart_object() const;
void convert_multipart_object(); void convert_multipart_object(unsigned int max_extruders);
// Ensures that the min z of the model is not negative // Ensures that the min z of the model is not negative
void adjust_min_z(); void adjust_min_z();
@ -291,8 +291,8 @@ public:
void print_info() const { for (const ModelObject *o : this->objects) o->print_info(); } void print_info() const { for (const ModelObject *o : this->objects) o->print_info(); }
static unsigned int get_auto_extruder_id(); static unsigned int get_auto_extruder_id(unsigned int max_extruders);
static std::string get_auto_extruder_id_as_string(); static std::string get_auto_extruder_id_as_string(unsigned int max_extruders);
static void reset_auto_extruder_id(); static void reset_auto_extruder_id();
}; };

View File

@ -111,6 +111,7 @@ PrintConfigDef::PrintConfigDef()
"with cooling (use a fan) before tweaking this."); "with cooling (use a fan) before tweaking this.");
def->cli = "bridge-flow-ratio=f"; def->cli = "bridge-flow-ratio=f";
def->min = 0; def->min = 0;
def->max = 2;
def->default_value = new ConfigOptionFloat(1); def->default_value = new ConfigOptionFloat(1);
def = this->add("bridge_speed", coFloat); def = this->add("bridge_speed", coFloat);

View File

@ -51,9 +51,6 @@ TriangleMesh::TriangleMesh(const Pointf3s &points, const std::vector<Point3>& fa
for (int i = 0; i < stl.stats.number_of_facets; i++) { for (int i = 0; i < stl.stats.number_of_facets; i++) {
stl_facet facet; stl_facet facet;
facet.normal.x = 0;
facet.normal.y = 0;
facet.normal.z = 0;
const Pointf3& ref_f1 = points[facets[i].x]; const Pointf3& ref_f1 = points[facets[i].x];
facet.vertex[0].x = ref_f1.x; facet.vertex[0].x = ref_f1.x;
@ -73,6 +70,13 @@ TriangleMesh::TriangleMesh(const Pointf3s &points, const std::vector<Point3>& fa
facet.extra[0] = 0; facet.extra[0] = 0;
facet.extra[1] = 0; facet.extra[1] = 0;
float normal[3];
stl_calculate_normal(normal, &facet);
stl_normalize_vector(normal);
facet.normal.x = normal[0];
facet.normal.y = normal[1];
facet.normal.z = normal[2];
stl.facet_start[i] = facet; stl.facet_start[i] = facet;
} }
stl_get_size(&stl); stl_get_size(&stl);

View File

@ -84,6 +84,21 @@ inline T next_highest_power_of_2(T v)
return ++ v; return ++ v;
} }
class PerlCallback {
public:
PerlCallback(void *sv) : m_callback(nullptr) { this->register_callback(sv); }
PerlCallback() : m_callback(nullptr) {}
~PerlCallback() { this->deregister_callback(); }
void register_callback(void *sv);
void deregister_callback();
void call();
void call(int i);
void call(int i, int j);
// void call(const std::vector<int> &ints);
private:
void *m_callback;
};
} // namespace Slic3r } // namespace Slic3r
#endif // slic3r_Utils_hpp_ #endif // slic3r_Utils_hpp_

View File

@ -14,7 +14,7 @@
#include <boost/thread.hpp> #include <boost/thread.hpp>
#define SLIC3R_FORK_NAME "Slic3r Prusa Edition" #define SLIC3R_FORK_NAME "Slic3r Prusa Edition"
#define SLIC3R_VERSION "1.40.0" #define SLIC3R_VERSION "1.40.0-alpha"
#define SLIC3R_BUILD "UNKNOWN" #define SLIC3R_BUILD "UNKNOWN"
typedef int32_t coord_t; typedef int32_t coord_t;

View File

@ -1,3 +1,5 @@
#include "Utils.hpp"
#include <locale> #include <locale>
#include <ctime> #include <ctime>
@ -135,44 +137,6 @@ const std::string& data_dir()
} // namespace Slic3r } // namespace Slic3r
#ifdef SLIC3R_HAS_BROKEN_CROAK
// Some Strawberry Perl builds (mainly the latest 64bit builds) have a broken mechanism
// for emiting Perl exception after handling a C++ exception. Perl interpreter
// simply hangs. Better to show a message box in that case and stop the application.
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#include <Windows.h>
#endif
void confess_at(const char *file, int line, const char *func, const char *format, ...)
{
char dest[1024*8];
va_list argptr;
va_start(argptr, format);
vsprintf(dest, format, argptr);
va_end(argptr);
char filelinefunc[1024*8];
sprintf(filelinefunc, "\r\nin function: %s\r\nfile: %s\r\nline: %d\r\n", func, file, line);
strcat(dest, filelinefunc);
strcat(dest, "\r\n Closing the application.\r\n");
#ifdef WIN32
::MessageBoxA(NULL, dest, "Slic3r Prusa Edition", MB_OK | MB_ICONERROR);
#endif
// Give up.
printf(dest);
exit(-1);
}
#else
#include <xsinit.h> #include <xsinit.h>
void void
@ -202,7 +166,88 @@ confess_at(const char *file, int line, const char *func,
#endif #endif
} }
#endif void PerlCallback::register_callback(void *sv)
{
if (! SvROK((SV*)sv) || SvTYPE(SvRV((SV*)sv)) != SVt_PVCV)
croak("Not a Callback %_ for PerlFunction", (SV*)sv);
if (m_callback)
SvSetSV((SV*)m_callback, (SV*)sv);
else
m_callback = newSVsv((SV*)sv);
}
void PerlCallback::deregister_callback()
{
if (m_callback) {
sv_2mortal((SV*)m_callback);
m_callback = nullptr;
}
}
void PerlCallback::call()
{
if (! m_callback)
return;
dSP;
ENTER;
SAVETMPS;
PUSHMARK(SP);
PUTBACK;
perl_call_sv(SvRV((SV*)m_callback), G_DISCARD);
FREETMPS;
LEAVE;
}
void PerlCallback::call(int i)
{
if (! m_callback)
return;
dSP;
ENTER;
SAVETMPS;
PUSHMARK(SP);
XPUSHs(sv_2mortal(newSViv(i)));
PUTBACK;
perl_call_sv(SvRV((SV*)m_callback), G_DISCARD);
FREETMPS;
LEAVE;
}
void PerlCallback::call(int i, int j)
{
if (! m_callback)
return;
dSP;
ENTER;
SAVETMPS;
PUSHMARK(SP);
XPUSHs(sv_2mortal(newSViv(i)));
XPUSHs(sv_2mortal(newSViv(j)));
PUTBACK;
perl_call_sv(SvRV((SV*)m_callback), G_DISCARD);
FREETMPS;
LEAVE;
}
/*
void PerlCallback::call(const std::vector<int> &ints)
{
if (! m_callback)
return;
dSP;
ENTER;
SAVETMPS;
PUSHMARK(SP);
AV* av = newAV();
for (int i : ints)
av_push(av, newSViv(i));
XPUSHs(av);
PUTBACK;
perl_call_sv(SvRV((SV*)m_callback), G_DISCARD);
FREETMPS;
LEAVE;
}
*/
#ifdef WIN32 #ifdef WIN32
#ifndef NOMINMAX #ifndef NOMINMAX

View File

@ -443,10 +443,13 @@ std::vector<int> GLVolumeCollection::load_object(
int GLVolumeCollection::load_wipe_tower_preview( int GLVolumeCollection::load_wipe_tower_preview(
int obj_idx, float pos_x, float pos_y, float width, float depth, float height, float rotation_angle, bool use_VBOs) int obj_idx, float pos_x, float pos_y, float width, float depth, float height, float rotation_angle, bool use_VBOs)
{ {
float color[4] = { 1.0f, 1.0f, 0.0f, 0.5f }; float color[4] = { 0.5f, 0.5f, 0.0f, 0.5f };
this->volumes.emplace_back(new GLVolume(color)); this->volumes.emplace_back(new GLVolume(color));
GLVolume &v = *this->volumes.back(); GLVolume &v = *this->volumes.back();
if (height == 0.0f)
height = 0.1f;
auto mesh = make_cube(width, depth, height); auto mesh = make_cube(width, depth, height);
mesh.translate(-width / 2.f, -depth / 2.f, 0.f); mesh.translate(-width / 2.f, -depth / 2.f, 0.f);
Point origin_of_rotation(0.f, 0.f); Point origin_of_rotation(0.f, 0.f);
@ -2201,7 +2204,7 @@ void _3DScene::_load_gcode_extrusion_paths(const GCodePreviewData& preview_data,
return 0.0f; return 0.0f;
} }
static const GCodePreviewData::Color& path_color(const GCodePreviewData& data, const std::vector<float>& tool_colors, float value) static GCodePreviewData::Color path_color(const GCodePreviewData& data, const std::vector<float>& tool_colors, float value)
{ {
switch (data.extrusion.view_type) switch (data.extrusion.view_type)
{ {
@ -2217,7 +2220,7 @@ void _3DScene::_load_gcode_extrusion_paths(const GCodePreviewData& preview_data,
return data.get_volumetric_rate_color(value); return data.get_volumetric_rate_color(value);
case GCodePreviewData::Extrusion::Tool: case GCodePreviewData::Extrusion::Tool:
{ {
static GCodePreviewData::Color color; GCodePreviewData::Color color;
::memcpy((void*)color.rgba, (const void*)(tool_colors.data() + (unsigned int)value * 4), 4 * sizeof(float)); ::memcpy((void*)color.rgba, (const void*)(tool_colors.data() + (unsigned int)value * 4), 4 * sizeof(float));
return color; return color;
} }
@ -2254,7 +2257,6 @@ void _3DScene::_load_gcode_extrusion_paths(const GCodePreviewData& preview_data,
}; };
typedef std::vector<Filter> FiltersList; typedef std::vector<Filter> FiltersList;
size_t initial_volumes_count = volumes.volumes.size(); size_t initial_volumes_count = volumes.volumes.size();
// detects filters // detects filters
@ -2278,7 +2280,6 @@ void _3DScene::_load_gcode_extrusion_paths(const GCodePreviewData& preview_data,
for (Filter& filter : filters) for (Filter& filter : filters)
{ {
s_gcode_preview_volume_index.first_volumes.emplace_back(GCodePreviewVolumeIndex::Extrusion, (unsigned int)filter.role, (unsigned int)volumes.volumes.size()); s_gcode_preview_volume_index.first_volumes.emplace_back(GCodePreviewVolumeIndex::Extrusion, (unsigned int)filter.role, (unsigned int)volumes.volumes.size());
GLVolume* volume = new GLVolume(Helper::path_color(preview_data, tool_colors, filter.value).rgba); GLVolume* volume = new GLVolume(Helper::path_color(preview_data, tool_colors, filter.value).rgba);
if (volume != nullptr) if (volume != nullptr)
{ {

View File

@ -82,10 +82,8 @@ namespace Slic3r { namespace GUI {
return std::regex_match(string, regex_pattern); return std::regex_match(string, regex_pattern);
} }
// boost::any Field::get_value_by_opt_type(wxString& str)
void Field::get_value_by_opt_type(wxString& str) void Field::get_value_by_opt_type(wxString& str)
{ {
// boost::any m_value;
switch (m_opt.type){ switch (m_opt.type){
case coInt: case coInt:
m_value = wxAtoi(str); m_value = wxAtoi(str);
@ -96,8 +94,25 @@ namespace Slic3r { namespace GUI {
case coFloat:{ case coFloat:{
if (m_opt.type == coPercent && str.Last() == '%') if (m_opt.type == coPercent && str.Last() == '%')
str.RemoveLast(); str.RemoveLast();
else if (str.Last() == '%') {
wxString label = m_Label->GetLabel();
if (label.Last() == '\n') label.RemoveLast();
while (label.Last() == ' ') label.RemoveLast();
if (label.Last() == ':') label.RemoveLast();
show_error(m_parent, wxString::Format(_(L("%s doesn't support percentage")), label));
set_value(double_to_string(m_opt.min), true);
m_value = double(m_opt.min);
break;
}
double val; double val;
str.ToCDouble(&val); str.ToCDouble(&val);
if (m_opt.min > val && val > m_opt.max)
{
show_error(m_parent, _(L("Input value is out of range")));
if (m_opt.min > val) val = m_opt.min;
if (val > m_opt.max) val = m_opt.max;
set_value(double_to_string(val), true);
}
m_value = val; m_value = val;
break; } break; }
case coString: case coString:
@ -108,8 +123,6 @@ namespace Slic3r { namespace GUI {
default: default:
break; break;
} }
// return m_value;
} }
void TextCtrl::BUILD() { void TextCtrl::BUILD() {
@ -170,17 +183,32 @@ namespace Slic3r { namespace GUI {
//! to allow the default handling //! to allow the default handling
event.Skip(); event.Skip();
//! eliminating the g-code pop up text description //! eliminating the g-code pop up text description
temp->GetToolTip()->Enable(false); bool flag = false;
#ifdef __WXGTK__
// I have no idea why, but on GTK flag works in other way
flag = true;
#endif // __WXGTK__
temp->GetToolTip()->Enable(flag);
}), temp->GetId()); }), temp->GetId());
#if !defined(__WXGTK__)
temp->Bind(wxEVT_KILL_FOCUS, ([this, temp](wxEvent& e) temp->Bind(wxEVT_KILL_FOCUS, ([this, temp](wxEvent& e)
{ {
e.Skip();// on_kill_focus(e); e.Skip();// on_kill_focus(e);
temp->GetToolTip()->Enable(true); temp->GetToolTip()->Enable(true);
}), temp->GetId()); }), temp->GetId());
#endif // __WXGTK__
temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent) { on_change_field(); }), temp->GetId()); temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent) { on_change_field(); }), temp->GetId());
// select all text using Ctrl+A
temp->Bind(wxEVT_CHAR, ([temp](wxKeyEvent& event)
{
if (wxGetKeyState(wxKeyCode('A')) && wxGetKeyState(WXK_CONTROL))
temp->SetSelection(-1, -1); //select all
event.Skip();
}));
// recast as a wxWindow to fit the calling convention // recast as a wxWindow to fit the calling convention
window = dynamic_cast<wxWindow*>(temp); window = dynamic_cast<wxWindow*>(temp);
} }
@ -188,9 +216,9 @@ namespace Slic3r { namespace GUI {
boost::any& TextCtrl::get_value() boost::any& TextCtrl::get_value()
{ {
wxString ret_str = static_cast<wxTextCtrl*>(window)->GetValue(); wxString ret_str = static_cast<wxTextCtrl*>(window)->GetValue();
/*boost::any ret_val*/get_value_by_opt_type(ret_str); get_value_by_opt_type(ret_str);
return m_value;//ret_val; return m_value;
} }
void TextCtrl::enable() { dynamic_cast<wxTextCtrl*>(window)->Enable(); dynamic_cast<wxTextCtrl*>(window)->SetEditable(true); } void TextCtrl::enable() { dynamic_cast<wxTextCtrl*>(window)->Enable(); dynamic_cast<wxTextCtrl*>(window)->SetEditable(true); }

View File

@ -124,7 +124,6 @@ public:
virtual wxWindow* getWindow() { return nullptr; } virtual wxWindow* getWindow() { return nullptr; }
bool is_matched(const std::string& string, const std::string& pattern); bool is_matched(const std::string& string, const std::string& pattern);
// boost::any get_value_by_opt_type(wxString& str);
void get_value_by_opt_type(wxString& str); void get_value_by_opt_type(wxString& str);
/// Factory method for generating new derived classes. /// Factory method for generating new derived classes.

View File

@ -118,21 +118,34 @@ void OptionsGroup::append_line(const Line& line, wxStaticText** colored_Label/*
if (option_set.size() == 1 && label_width == 0 && option_set.front().opt.full_width && if (option_set.size() == 1 && label_width == 0 && option_set.front().opt.full_width &&
option_set.front().opt.sidetext.size() == 0 && option_set.front().side_widget == nullptr && option_set.front().opt.sidetext.size() == 0 && option_set.front().side_widget == nullptr &&
line.get_extra_widgets().size() == 0) { line.get_extra_widgets().size() == 0) {
wxSizer* tmp_sizer;
#ifdef __WXGTK__
tmp_sizer = new wxBoxSizer(wxVERTICAL);
m_panel->SetSizer(tmp_sizer);
m_panel->Layout();
#else
tmp_sizer = sizer;
#endif /* __WXGTK__ */
const auto& option = option_set.front(); const auto& option = option_set.front();
const auto& field = build_field(option); const auto& field = build_field(option);
auto btn_sizer = new wxBoxSizer(wxHORIZONTAL); auto btn_sizer = new wxBoxSizer(wxHORIZONTAL);
btn_sizer->Add(field->m_Undo_to_sys_btn); btn_sizer->Add(field->m_Undo_to_sys_btn);
btn_sizer->Add(field->m_Undo_btn); btn_sizer->Add(field->m_Undo_btn);
sizer->Add(btn_sizer, 0, wxEXPAND | wxALL, 0); tmp_sizer->Add(btn_sizer, 0, wxEXPAND | wxALL, 0);
if (is_window_field(field)) if (is_window_field(field))
sizer->Add(field->getWindow(), 0, wxEXPAND | wxALL, wxOSX ? 0 : 5); tmp_sizer->Add(field->getWindow(), 0, wxEXPAND | wxALL, wxOSX ? 0 : 5);
if (is_sizer_field(field)) if (is_sizer_field(field))
sizer->Add(field->getSizer(), 0, wxEXPAND | wxALL, wxOSX ? 0 : 5); tmp_sizer->Add(field->getSizer(), 0, wxEXPAND | wxALL, wxOSX ? 0 : 5);
return; return;
} }
auto grid_sizer = m_grid_sizer; auto grid_sizer = m_grid_sizer;
#ifdef __WXGTK__
m_panel->SetSizer(m_grid_sizer);
m_panel->Layout();
#endif /* __WXGTK__ */
// Build a label if we have it // Build a label if we have it
wxStaticText* label=nullptr; wxStaticText* label=nullptr;

View File

@ -138,8 +138,6 @@ public:
static_cast<wxFlexGridSizer*>(m_grid_sizer)->AddGrowableCol(label_width != 0); static_cast<wxFlexGridSizer*>(m_grid_sizer)->AddGrowableCol(label_width != 0);
#ifdef __WXGTK__ #ifdef __WXGTK__
m_panel = new wxPanel( _parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panel = new wxPanel( _parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panel->SetSizer(m_grid_sizer);
m_panel->Layout();
sizer->Fit(m_panel); sizer->Fit(m_panel);
sizer->Add(m_panel, 0, wxEXPAND | wxALL, wxOSX||!staticbox ? 0: 5); sizer->Add(m_panel, 0, wxEXPAND | wxALL, wxOSX||!staticbox ? 0: 5);
#else #else

View File

@ -2125,7 +2125,7 @@ void Tab::save_preset(std::string name /*= ""*/)
return; return;
} }
if (existing && (existing->is_external)) { if (existing && (existing->is_external)) {
show_error(this, _(L("Cannot overwrite an external."))); show_error(this, _(L("Cannot overwrite an external profile.")));
return; return;
} }
} }

View File

@ -195,15 +195,6 @@ SV* to_SV(TriangleMesh* THIS);
} }
#ifdef SLIC3R_HAS_BROKEN_CROAK
#undef croak
#ifdef _MSC_VER
#define croak(...) confess_at(__FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
#else
#define croak(...) confess_at(__FILE__, __LINE__, __func__, __VA_ARGS__)
#endif
#endif
// Defined in wxPerlIface.cpp // Defined in wxPerlIface.cpp
// Return a pointer to the associated wxWidgets object instance given by classname. // Return a pointer to the associated wxWidgets object instance given by classname.
extern void* wxPli_sv_2_object( pTHX_ SV* scalar, const char* classname ); extern void* wxPli_sv_2_object( pTHX_ SV* scalar, const char* classname );

View File

@ -6,16 +6,9 @@ use warnings;
use Slic3r::XS; use Slic3r::XS;
use Test::More tests => 1; use Test::More tests => 1;
if ($ENV{SLIC3R_HAS_BROKEN_CROAK})
{
ok 1, 'SLIC3R_HAS_BROKEN_CROAK set, croaks and confesses from a C++ code will lead to an application exit!';
}
else
{
eval { eval {
Slic3r::xspp_test_croak_hangs_on_strawberry(); Slic3r::xspp_test_croak_hangs_on_strawberry();
}; };
is $@, "xspp_test_croak_hangs_on_strawberry: exception catched\n", 'croak from inside a C++ exception delivered'; is $@, "xspp_test_croak_hangs_on_strawberry: exception catched\n", 'croak from inside a C++ exception delivered';
}
__END__ __END__

View File

@ -95,7 +95,7 @@
void duplicate_objects_grid(unsigned int x, unsigned int y, double dist); void duplicate_objects_grid(unsigned int x, unsigned int y, double dist);
bool looks_like_multipart_object() const; bool looks_like_multipart_object() const;
void convert_multipart_object(); void convert_multipart_object(unsigned int max_extruders);
void print_info() const; void print_info() const;
@ -346,7 +346,7 @@ ModelMaterial::attributes()
void set_modifier(bool modifier) void set_modifier(bool modifier)
%code%{ THIS->modifier = modifier; %}; %code%{ THIS->modifier = modifier; %};
size_t split(); size_t split(unsigned int max_extruders);
ModelMaterial* assign_unique_material(); ModelMaterial* assign_unique_material();
}; };