diff options
author | bubnikv <bubnikv@gmail.com> | 2016-10-21 17:53:42 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2016-10-21 17:53:42 +0300 |
commit | 1fb57e439ef61bf99f9f23c06bfc774935180f33 (patch) | |
tree | 22650f82ce29d63484c1e179c96be9e0752db7ef /lib | |
parent | 15d3e94a66f7be869a77171841fcfe1726f44c56 (diff) |
Defined the +-* operators on Pointf.
Removed the deprecated VibrationLimit feature.
Added triangle infill.
The Prusa3D fork of Slic3r has been marked as "Slic3r Prusa Edition"
with menus pointing to the prusa3d/slic3r github release page
and Prusa3D drivers downloads page.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Slic3r.pm | 2 | ||||
-rw-r--r-- | lib/Slic3r/Config.pm | 2 | ||||
-rw-r--r-- | lib/Slic3r/GCode/VibrationLimit.pm | 63 | ||||
-rw-r--r-- | lib/Slic3r/GUI.pm | 1 | ||||
-rw-r--r-- | lib/Slic3r/GUI/AboutDialog.pm | 3 | ||||
-rw-r--r-- | lib/Slic3r/GUI/MainFrame.pm | 18 | ||||
-rw-r--r-- | lib/Slic3r/GUI/Tab.pm | 3 | ||||
-rw-r--r-- | lib/Slic3r/Print/GCode.pm | 9 | ||||
-rw-r--r-- | lib/Slic3r/Print/Object.pm | 2 |
9 files changed, 19 insertions, 84 deletions
diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 77e45688e..b7c265c41 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -11,6 +11,7 @@ use warnings; require v5.10; our $VERSION = VERSION(); +our $FORK_NAME = FORK_NAME(); our $debug = 0; sub debugf { @@ -67,7 +68,6 @@ use Slic3r::GCode::MotionPlanner; use Slic3r::GCode::PressureRegulator; use Slic3r::GCode::Reader; use Slic3r::GCode::SpiralVase; -use Slic3r::GCode::VibrationLimit; use Slic3r::Geometry qw(PI); use Slic3r::Geometry::Clipper; use Slic3r::Layer; diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 9324c824a..b4cfaa5d9 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -12,7 +12,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 seal_position bed_size print_center g0); + randomize_start seal_position bed_size print_center g0 vibration_limit); # C++ Slic3r::PrintConfigDef exported as a Perl hash of hashes. # The C++ counterpart is a constant singleton. diff --git a/lib/Slic3r/GCode/VibrationLimit.pm b/lib/Slic3r/GCode/VibrationLimit.pm deleted file mode 100644 index 496d1e73a..000000000 --- a/lib/Slic3r/GCode/VibrationLimit.pm +++ /dev/null @@ -1,63 +0,0 @@ -package Slic3r::GCode::VibrationLimit; -use Moo; - -extends 'Slic3r::GCode::Reader'; - -has '_min_time' => (is => 'lazy'); -has '_last_dir' => (is => 'ro', default => sub { [0,0] }); -has '_dir_time' => (is => 'ro', default => sub { [0,0] }); - -# inspired by http://hydraraptor.blogspot.it/2010/12/frequency-limit.html - -use List::Util qw(max); - -sub _build__min_time { - my ($self) = @_; - return 1 / ($self->config->vibration_limit * 60); # in minutes -} - -sub process { - my $self = shift; - my ($gcode) = @_; - - my $new_gcode = ""; - $self->parse($gcode, sub { - my ($reader, $cmd, $args, $info) = @_; - - if ($cmd eq 'G1' && $info->{dist_XY} > 0) { - my $point = Slic3r::Pointf->new($args->{X} // $reader->X, $args->{Y} // $reader->Y); - my @dir = ( - ($point->x <=> $reader->X), - ($point->y <=> $reader->Y), #$ - ); - my $time = $info->{dist_XY} / ($args->{F} // $reader->F); # in minutes - - if ($time > 0) { - my @pause = (); - foreach my $axis (0..$#dir) { - if ($dir[$axis] != 0 && $self->_last_dir->[$axis] != $dir[$axis]) { - if ($self->_last_dir->[$axis] != 0) { - # this axis is changing direction: check whether we need to pause - if ($self->_dir_time->[$axis] < $self->_min_time) { - push @pause, ($self->_min_time - $self->_dir_time->[$axis]); - } - } - $self->_last_dir->[$axis] = $dir[$axis]; - $self->_dir_time->[$axis] = 0; - } - $self->_dir_time->[$axis] += $time; - } - - if (@pause) { - $new_gcode .= sprintf "G4 P%d\n", max(@pause) * 60 * 1000; - } - } - } - - $new_gcode .= $info->{raw} . "\n"; - }); - - return $new_gcode; -} - -1; diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index c95e9afbb..b91930870 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -90,6 +90,7 @@ sub OnInit { my ($self) = @_; $self->SetAppName('Slic3r'); + $self->SetAppDisplayName('Slic3r Prusa Edition'); Slic3r::debugf "wxWidgets version %s, Wx version %s\n", &Wx::wxVERSION_STRING, $Wx::VERSION; $self->{notifier} = Slic3r::GUI::Notifier->new; diff --git a/lib/Slic3r/GUI/AboutDialog.pm b/lib/Slic3r/GUI/AboutDialog.pm index 7b9625976..398fde97d 100644 --- a/lib/Slic3r/GUI/AboutDialog.pm +++ b/lib/Slic3r/GUI/AboutDialog.pm @@ -27,7 +27,7 @@ sub new { $hsizer->Add($vsizer, 1, wxEXPAND, 0); # title - my $title = Wx::StaticText->new($self, -1, 'Slic3r', wxDefaultPosition, wxDefaultSize); + my $title = Wx::StaticText->new($self, -1, $Slic3r::FORK_NAME, wxDefaultPosition, wxDefaultSize); my $title_font = Wx::SystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); $title_font->SetWeight(wxFONTWEIGHT_BOLD); $title_font->SetFamily(wxFONTFAMILY_ROMAN); @@ -47,6 +47,7 @@ sub new { '<html>' . '<body bgcolor="#ffffff" link="#808080">' . '<font color="#808080">' . + 'Copyright © 2016 Vojtech Bubnik, Prusa Research. <br />' . 'Copyright © 2011-2016 Alessandro Ranellucci. <br />' . '<a href="http://slic3r.org/">Slic3r</a> is licensed under the ' . '<a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU Affero General Public License, version 3</a>.' . diff --git a/lib/Slic3r/GUI/MainFrame.pm b/lib/Slic3r/GUI/MainFrame.pm index 6a367b807..3b7d7ef46 100644 --- a/lib/Slic3r/GUI/MainFrame.pm +++ b/lib/Slic3r/GUI/MainFrame.pm @@ -20,7 +20,7 @@ our $last_config; sub new { my ($class, %params) = @_; - my $self = $class->SUPER::new(undef, -1, 'Slic3r', wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE); + my $self = $class->SUPER::new(undef, -1, $Slic3r::FORK_NAME . ' - ' . $Slic3r::VERSION, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE); $self->SetIcon(Wx::Icon->new($Slic3r::var->("Slic3r_128px.png"), wxBITMAP_TYPE_PNG) ); # store input params @@ -37,7 +37,7 @@ sub new { # initialize status bar $self->{statusbar} = Slic3r::GUI::ProgressStatusBar->new($self, -1); - $self->{statusbar}->SetStatusText("Version $Slic3r::VERSION - Remember to check for updates at http://slic3r.org/"); + $self->{statusbar}->SetStatusText("Version $Slic3r::VERSION - Remember to check for updates at http://github.com/prusa3d/slic3r/releases"); $self->SetStatusBar($self->{statusbar}); $self->{loaded} = 1; @@ -294,13 +294,19 @@ sub _init_menubar { $self->config_wizard; }); $helpMenu->AppendSeparator(); + $self->_append_menu_item($helpMenu, "Prusa 3D Drivers", 'Open the Prusa3D drivers download page in your browser', sub { + Wx::LaunchDefaultBrowser('http://www.prusa3d.com/drivers/'); + }); + $self->_append_menu_item($helpMenu, "Prusa Edition Releases", 'Open the Prusa Edition releases page in your browser', sub { + Wx::LaunchDefaultBrowser('http://github.com/prusa3d/slic3r/releases'); + }); +# my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", 'Check for new Slic3r versions', sub { +# wxTheApp->check_version(1); +# }); +# $versioncheck->Enable(wxTheApp->have_version_check); $self->_append_menu_item($helpMenu, "Slic3r &Website", 'Open the Slic3r website in your browser', sub { Wx::LaunchDefaultBrowser('http://slic3r.org/'); }); - my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", 'Check for new Slic3r versions', sub { - wxTheApp->check_version(1); - }); - $versioncheck->Enable(wxTheApp->have_version_check); $self->_append_menu_item($helpMenu, "Slic3r &Manual", 'Open the Slic3r manual in your browser', sub { Wx::LaunchDefaultBrowser('http://manual.slic3r.org/'); }); diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 34fb2dabe..c05465664 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -1002,7 +1002,7 @@ sub build { gcode_flavor use_relative_e_distances serial_port serial_speed octoprint_host octoprint_apikey - use_firmware_retraction pressure_advance vibration_limit + use_firmware_retraction pressure_advance use_volumetric_e start_gcode end_gcode before_layer_gcode layer_gcode toolchange_gcode nozzle_diameter extruder_offset @@ -1208,7 +1208,6 @@ sub build { $optgroup->append_single_option_line('use_firmware_retraction'); $optgroup->append_single_option_line('use_volumetric_e'); $optgroup->append_single_option_line('pressure_advance'); - $optgroup->append_single_option_line('vibration_limit'); } } { diff --git a/lib/Slic3r/Print/GCode.pm b/lib/Slic3r/Print/GCode.pm index d39241949..d837a4637 100644 --- a/lib/Slic3r/Print/GCode.pm +++ b/lib/Slic3r/Print/GCode.pm @@ -7,7 +7,6 @@ has 'fh' => (is => 'ro', required => 1); has '_gcodegen' => (is => 'rw'); has '_cooling_buffer' => (is => 'rw'); has '_spiral_vase' => (is => 'rw'); -has '_vibration_limit' => (is => 'rw'); has '_arc_fitting' => (is => 'rw'); has '_pressure_regulator' => (is => 'rw'); has '_pressure_equalizer' => (is => 'rw'); @@ -109,9 +108,6 @@ sub BUILD { $self->_spiral_vase(Slic3r::GCode::SpiralVase->new(config => $self->config)) if $self->config->spiral_vase; - $self->_vibration_limit(Slic3r::GCode::VibrationLimit->new(config => $self->config)) - if $self->config->vibration_limit != 0; - $self->_arc_fitting(Slic3r::GCode::ArcFitting->new(config => $self->config)) if $self->config->gcode_arcs; @@ -664,11 +660,6 @@ sub filter { my ($self, $gcode, $flush) = @_; $flush //= 0; - # apply vibration limit if enabled; - # this injects pauses according to time (thus depends on actual speeds) - $gcode = $self->_vibration_limit->process($gcode) - if defined $self->_vibration_limit; - # apply pressure regulation if enabled; # this depends on actual speeds $gcode = $self->_pressure_regulator->process($gcode, $flush) diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index 17852a528..5ca29789c 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -685,7 +685,7 @@ sub _support_material { flow => $self->support_material_flow, interface_flow => $self->support_material_flow(FLOW_ROLE_SUPPORT_MATERIAL_INTERFACE), soluble_interface => ($self->config->support_material_contact_distance == 0), - ); + ); } } |