mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-20 10:50:33 -07:00
More refactoring to GCode.pm: make writer() public and fix usage of Slic3r::GCode without a Slic3r::Layer object
This commit is contained in:
@@ -41,6 +41,26 @@ sub set_extruders {
|
||||
$self->multiple_extruders(max(@$extruder_ids) > 0);
|
||||
}
|
||||
|
||||
sub preamble {
|
||||
my ($self) = @_;
|
||||
|
||||
my $gcode = "";
|
||||
|
||||
if ($self->config->gcode_flavor ne 'makerware') {
|
||||
$gcode .= "G21 ; set units to millimeters\n";
|
||||
$gcode .= "G90 ; use absolute coordinates\n";
|
||||
}
|
||||
if ($self->config->gcode_flavor =~ /^(?:reprap|teacup)$/) {
|
||||
if ($self->config->use_relative_e_distances) {
|
||||
$gcode .= "M83 ; use relative distances for extrusion\n";
|
||||
} else {
|
||||
$gcode .= "M82 ; use absolute distances for extrusion\n";
|
||||
}
|
||||
$gcode .= $self->reset_e(1);
|
||||
}
|
||||
return $gcode;
|
||||
}
|
||||
|
||||
sub set_temperature {
|
||||
my ($self, $temperature, $wait, $tool) = @_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user