added support Machinekit flavour GCode

This commit is contained in:
Alexander Rössler 2015-01-07 21:20:58 +01:00
parent 0d822f0ec2
commit d35226b889
6 changed files with 13 additions and 8 deletions

View File

@ -8,7 +8,7 @@ Slic3r [![Build Status](https://travis-ci.org/alexrj/Slic3r.png?branch=master)](
Slic3r takes 3D models (STL, OBJ, AMF) and converts them into G-code instructions for Slic3r takes 3D models (STL, OBJ, AMF) and converts them into G-code instructions for
3D printers. It's compatible with any modern printer based on the RepRap toolchain, 3D printers. It's compatible with any modern printer based on the RepRap toolchain,
including all those based on the Marlin, Sprinter and Repetier firmware. It also works including all those based on the Marlin, Sprinter and Repetier firmware. It also works
with Mach3 and LinuxCNC controllers. with Mach3, LinuxCNC and Machinekit controllers.
See the [project homepage](http://slic3r.org/) at slic3r.org and the See the [project homepage](http://slic3r.org/) at slic3r.org and the
[manual](http://manual.slic3r.org/) for more information. [manual](http://manual.slic3r.org/) for more information.
@ -30,7 +30,7 @@ Key features are:
* **multi-platform** (Linux/Mac/Win) and packaged as standalone-app with no dependencies required * **multi-platform** (Linux/Mac/Win) and packaged as standalone-app with no dependencies required
* complete **command-line interface** to use it with no GUI * complete **command-line interface** to use it with no GUI
* multi-material **(multiple extruders)** object printing * multi-material **(multiple extruders)** object printing
* multiple G-code flavors supported (RepRap, Makerbot, Mach3 etc.) * multiple G-code flavors supported (RepRap, Makerbot, Mach3, Machinekit etc.)
* ability to plate **multiple objects having distinct print settings** * ability to plate **multiple objects having distinct print settings**
* **multithread** processing * **multithread** processing
* **STL auto-repair** (tolerance for broken models) * **STL auto-repair** (tolerance for broken models)
@ -130,7 +130,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/no-extrusion, --gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/machinekit/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)

View File

@ -282,7 +282,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/no-extrusion, --gcode-flavor The type of G-code to generate (reprap/teacup/makerware/sailfish/mach3/machinekit/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)

View File

@ -22,7 +22,7 @@ _arguments -S \
'*--nozzle-diameter[specify nozzle diameter]:nozzle diameter in mm' \ '*--nozzle-diameter[specify nozzle diameter]:nozzle diameter in mm' \
'--print-center[specify print center coordinates]:print center coordinates in mm,mm' \ '--print-center[specify print center coordinates]:print center coordinates in mm,mm' \
'--z-offset[specify Z-axis offset]:Z-axis offset in mm' \ '--z-offset[specify Z-axis offset]:Z-axis offset in mm' \
'--gcode-flavor[specify the type of G-code to generate]:G-code flavor:(reprap teacup makerware sailfish mach3 no-extrusion)' \ '--gcode-flavor[specify the type of G-code to generate]:G-code flavor:(reprap teacup makerware sailfish mach3 machinekit no-extrusion)' \
'(--use-relative-e-distances --no-use-relative-e-distances)'--{no-,}use-relative-e-distances'[disable/enable relative E values]' \ '(--use-relative-e-distances --no-use-relative-e-distances)'--{no-,}use-relative-e-distances'[disable/enable relative E values]' \
'--extrusion-axis[specify letter associated with the extrusion axis]:extrusion axis letter' \ '--extrusion-axis[specify letter associated with the extrusion axis]:extrusion axis letter' \
'(--gcode-arcs --no-gcode-arcs)'--{no-,}gcode-arcs'[disable/enable G2/G3 commands for native arcs]' \ '(--gcode-arcs --no-gcode-arcs)'--{no-,}gcode-arcs'[disable/enable G2/G3 commands for native arcs]' \

View File

@ -380,12 +380,14 @@ PrintConfigDef::build_def() {
Options["gcode_flavor"].enum_values.push_back("makerware"); Options["gcode_flavor"].enum_values.push_back("makerware");
Options["gcode_flavor"].enum_values.push_back("sailfish"); Options["gcode_flavor"].enum_values.push_back("sailfish");
Options["gcode_flavor"].enum_values.push_back("mach3"); Options["gcode_flavor"].enum_values.push_back("mach3");
Options["gcode_flavor"].enum_values.push_back("machinekit");
Options["gcode_flavor"].enum_values.push_back("no-extrusion"); Options["gcode_flavor"].enum_values.push_back("no-extrusion");
Options["gcode_flavor"].enum_labels.push_back("RepRap (Marlin/Sprinter/Repetier)"); Options["gcode_flavor"].enum_labels.push_back("RepRap (Marlin/Sprinter/Repetier)");
Options["gcode_flavor"].enum_labels.push_back("Teacup"); Options["gcode_flavor"].enum_labels.push_back("Teacup");
Options["gcode_flavor"].enum_labels.push_back("MakerWare (MakerBot)"); Options["gcode_flavor"].enum_labels.push_back("MakerWare (MakerBot)");
Options["gcode_flavor"].enum_labels.push_back("Sailfish (MakerBot)"); Options["gcode_flavor"].enum_labels.push_back("Sailfish (MakerBot)");
Options["gcode_flavor"].enum_labels.push_back("Mach3/LinuxCNC"); Options["gcode_flavor"].enum_labels.push_back("Mach3/LinuxCNC");
Options["gcode_flavor"].enum_labels.push_back("Machinekit");
Options["gcode_flavor"].enum_labels.push_back("No extrusion"); Options["gcode_flavor"].enum_labels.push_back("No extrusion");
Options["infill_acceleration"].type = coFloat; Options["infill_acceleration"].type = coFloat;

View File

@ -6,7 +6,7 @@
namespace Slic3r { namespace Slic3r {
enum GCodeFlavor { enum GCodeFlavor {
gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfNoExtrusion, gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfMachinekit, gcfNoExtrusion,
}; };
enum InfillPattern { enum InfillPattern {
@ -29,6 +29,7 @@ template<> inline t_config_enum_values ConfigOptionEnum<GCodeFlavor>::get_enum_v
keys_map["makerware"] = gcfMakerWare; keys_map["makerware"] = gcfMakerWare;
keys_map["sailfish"] = gcfSailfish; keys_map["sailfish"] = gcfSailfish;
keys_map["mach3"] = gcfMach3; keys_map["mach3"] = gcfMach3;
keys_map["machinekit"] = gcfMachinekit;
keys_map["no-extrusion"] = gcfNoExtrusion; keys_map["no-extrusion"] = gcfNoExtrusion;
return keys_map; return keys_map;
} }
@ -410,7 +411,7 @@ class GCodeConfig : public virtual StaticPrintConfig
std::string get_extrusion_axis() const std::string get_extrusion_axis() const
{ {
if (this->gcode_flavor.value == gcfMach3) { if ((this->gcode_flavor.value == gcfMach3) || (this->gcode_flavor.value == gcfMachinekit)) {
return "A"; return "A";
} else if (this->gcode_flavor.value == gcfNoExtrusion) { } else if (this->gcode_flavor.value == gcfNoExtrusion) {
return ""; return "";

View File

@ -4,7 +4,7 @@ use strict;
use warnings; use warnings;
use Slic3r::XS; use Slic3r::XS;
use Test::More tests => 108; use Test::More tests => 110;
foreach my $config (Slic3r::Config->new, Slic3r::Config::Full->new) { foreach my $config (Slic3r::Config->new, Slic3r::Config::Full->new) {
$config->set('layer_height', 0.3); $config->set('layer_height', 0.3);
@ -51,6 +51,8 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Full->new) {
is $config->serialize('gcode_flavor'), 'teacup', 'serialize enum'; is $config->serialize('gcode_flavor'), 'teacup', 'serialize enum';
$config->set_deserialize('gcode_flavor', 'mach3'); $config->set_deserialize('gcode_flavor', 'mach3');
is $config->get('gcode_flavor'), 'mach3', 'deserialize enum (gcode_flavor)'; is $config->get('gcode_flavor'), 'mach3', 'deserialize enum (gcode_flavor)';
$config->set_deserialize('gcode_flavor', 'machinekit');
is $config->get('gcode_flavor'), 'machinekit', 'deserialize enum (gcode_flavor)';
$config->set_deserialize('fill_pattern', 'line'); $config->set_deserialize('fill_pattern', 'line');
is $config->get('fill_pattern'), 'line', 'deserialize enum (fill_pattern)'; is $config->get('fill_pattern'), 'line', 'deserialize enum (fill_pattern)';