mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-16 14:15:59 +08:00
Adds Smoothieware flavor to Gcode, to avoid some weirdness in the new motion controls.
Avoids resetting extrusion axis after firmware retract (still resets after unretract) with smoothieware.
This commit is contained in:
parent
2230652218
commit
0673389009
@ -132,7 +132,7 @@ The author of the Silk icon set is Mark James.
|
|||||||
(default: 100,100)
|
(default: 100,100)
|
||||||
--z-offset Additional height in mm to add to vertical coordinates
|
--z-offset Additional height in mm to add to vertical coordinates
|
||||||
(+/-, default: 0)
|
(+/-, default: 0)
|
||||||
--gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/machinekit/no-extrusion,
|
--gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/machinekit/smoothie/no-extrusion,
|
||||||
default: reprap)
|
default: reprap)
|
||||||
--use-relative-e-distances Enable this to get relative E values (default: no)
|
--use-relative-e-distances Enable this to get relative E values (default: no)
|
||||||
--use-firmware-retraction Enable firmware-controlled retraction using G10/G11 (default: no)
|
--use-firmware-retraction Enable firmware-controlled retraction using G10/G11 (default: no)
|
||||||
|
@ -236,7 +236,7 @@ sub validate {
|
|||||||
if !first { $_ eq $self->gcode_flavor } @{$Options->{gcode_flavor}{values}};
|
if !first { $_ eq $self->gcode_flavor } @{$Options->{gcode_flavor}{values}};
|
||||||
|
|
||||||
die "--use-firmware-retraction is only supported by Marlin firmware\n"
|
die "--use-firmware-retraction is only supported by Marlin firmware\n"
|
||||||
if $self->use_firmware_retraction && $self->gcode_flavor ne 'reprap' && $self->gcode_flavor ne 'machinekit';
|
if $self->use_firmware_retraction && $self->gcode_flavor ne 'smoothie' && $self->gcode_flavor ne 'reprap' && $self->gcode_flavor ne 'machinekit';
|
||||||
|
|
||||||
die "--use-firmware-retraction is not compatible with --wipe\n"
|
die "--use-firmware-retraction is not compatible with --wipe\n"
|
||||||
if $self->use_firmware_retraction && first {$_} @{$self->wipe};
|
if $self->use_firmware_retraction && first {$_} @{$self->wipe};
|
||||||
|
@ -296,7 +296,7 @@ $j
|
|||||||
(default: 100,100)
|
(default: 100,100)
|
||||||
--z-offset Additional height in mm to add to vertical coordinates
|
--z-offset Additional height in mm to add to vertical coordinates
|
||||||
(+/-, default: $config->{z_offset})
|
(+/-, default: $config->{z_offset})
|
||||||
--gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/machinekit/no-extrusion,
|
--gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/machinekit/smoothie/no-extrusion,
|
||||||
default: $config->{gcode_flavor})
|
default: $config->{gcode_flavor})
|
||||||
--use-relative-e-distances Enable this to get relative E values (default: no)
|
--use-relative-e-distances Enable this to get relative E values (default: no)
|
||||||
--use-firmware-retraction Enable firmware-controlled retraction using G10/G11 (default: no)
|
--use-firmware-retraction Enable firmware-controlled retraction using G10/G11 (default: no)
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#define FLAVOR_IS(val) this->config.gcode_flavor == val
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
AvoidCrossingPerimeters::AvoidCrossingPerimeters()
|
AvoidCrossingPerimeters::AvoidCrossingPerimeters()
|
||||||
@ -700,7 +702,7 @@ GCode::retract(bool toolchange)
|
|||||||
methods even if we performed wipe, since this will ensure the entire retraction
|
methods even if we performed wipe, since this will ensure the entire retraction
|
||||||
length is honored in case wipe path was too short. */
|
length is honored in case wipe path was too short. */
|
||||||
gcode += toolchange ? this->writer.retract_for_toolchange() : this->writer.retract();
|
gcode += toolchange ? this->writer.retract_for_toolchange() : this->writer.retract();
|
||||||
|
if (!(FLAVOR_IS(gcfSmoothie) && this->config.use_firmware_retraction))
|
||||||
gcode += this->writer.reset_e();
|
gcode += this->writer.reset_e();
|
||||||
if (this->writer.extruder()->retract_length() > 0 || this->config.use_firmware_retraction)
|
if (this->writer.extruder()->retract_length() > 0 || this->config.use_firmware_retraction)
|
||||||
gcode += this->writer.lift();
|
gcode += this->writer.lift();
|
||||||
|
@ -54,7 +54,7 @@ GCodeWriter::preamble()
|
|||||||
gcode << "G21 ; set units to millimeters\n";
|
gcode << "G21 ; set units to millimeters\n";
|
||||||
gcode << "G90 ; use absolute coordinates\n";
|
gcode << "G90 ; use absolute coordinates\n";
|
||||||
}
|
}
|
||||||
if (FLAVOR_IS(gcfRepRap) || FLAVOR_IS(gcfTeacup)) {
|
if (FLAVOR_IS(gcfRepRap) || FLAVOR_IS(gcfTeacup) || FLAVOR_IS(gcfSmoothie)) {
|
||||||
if (this->config.use_relative_e_distances) {
|
if (this->config.use_relative_e_distances) {
|
||||||
gcode << "M83 ; use relative distances for extrusion\n";
|
gcode << "M83 ; use relative distances for extrusion\n";
|
||||||
} else {
|
} else {
|
||||||
|
@ -468,6 +468,7 @@ PrintConfigDef::PrintConfigDef()
|
|||||||
def->enum_values.push_back("sailfish");
|
def->enum_values.push_back("sailfish");
|
||||||
def->enum_values.push_back("mach3");
|
def->enum_values.push_back("mach3");
|
||||||
def->enum_values.push_back("machinekit");
|
def->enum_values.push_back("machinekit");
|
||||||
|
def->enum_values.push_back("smoothie");
|
||||||
def->enum_values.push_back("no-extrusion");
|
def->enum_values.push_back("no-extrusion");
|
||||||
def->enum_labels.push_back("RepRap (Marlin/Sprinter/Repetier)");
|
def->enum_labels.push_back("RepRap (Marlin/Sprinter/Repetier)");
|
||||||
def->enum_labels.push_back("Teacup");
|
def->enum_labels.push_back("Teacup");
|
||||||
@ -475,6 +476,7 @@ PrintConfigDef::PrintConfigDef()
|
|||||||
def->enum_labels.push_back("Sailfish (MakerBot)");
|
def->enum_labels.push_back("Sailfish (MakerBot)");
|
||||||
def->enum_labels.push_back("Mach3/LinuxCNC");
|
def->enum_labels.push_back("Mach3/LinuxCNC");
|
||||||
def->enum_labels.push_back("Machinekit");
|
def->enum_labels.push_back("Machinekit");
|
||||||
|
def->enum_labels.push_back("Smoothieware");
|
||||||
def->enum_labels.push_back("No extrusion");
|
def->enum_labels.push_back("No extrusion");
|
||||||
def->default_value = new ConfigOptionEnum<GCodeFlavor>(gcfRepRap);
|
def->default_value = new ConfigOptionEnum<GCodeFlavor>(gcfRepRap);
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
enum GCodeFlavor {
|
enum GCodeFlavor {
|
||||||
gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfMachinekit, gcfNoExtrusion,
|
gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfMachinekit, gcfNoExtrusion, gcfSmoothie,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum InfillPattern {
|
enum InfillPattern {
|
||||||
@ -34,6 +34,7 @@ template<> inline t_config_enum_values ConfigOptionEnum<GCodeFlavor>::get_enum_v
|
|||||||
keys_map["mach3"] = gcfMach3;
|
keys_map["mach3"] = gcfMach3;
|
||||||
keys_map["machinekit"] = gcfMachinekit;
|
keys_map["machinekit"] = gcfMachinekit;
|
||||||
keys_map["no-extrusion"] = gcfNoExtrusion;
|
keys_map["no-extrusion"] = gcfNoExtrusion;
|
||||||
|
keys_map["smoothie"] = gcfSmoothie;
|
||||||
return keys_map;
|
return keys_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user