mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-08 06:24:01 -06:00
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.
This commit is contained in:
parent
15d3e94a66
commit
1fb57e439e
25 changed files with 148 additions and 237 deletions
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
|
@ -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;
|
||||
|
|
|
@ -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>.' .
|
||||
|
|
|
@ -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/');
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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),
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue