Gcode::Interpreter - Simulate Gcode-reading machines such as 3D printers, CNC mills etc.
use Gcode::Interpreter; $interpreter = Gcode::Interpreter->new(); $interpreter->parse_line('G1 X1.0 Y1.0 Z1.0 E1.0'); $position_ref = $interpreter->position(); $stats_ref = $interpreter->stats();
This module is an umbrella class for those below it. That is, apart from to provide a stub, this module really hands off the real work elsewhere.
At the moment, there is only one such sub-module, for the Ultimaker series of 3D printers. It's possible that other printer types, CNC machines and other Gcode-talkers could be added at a later date. If that happens, then it is likely that the specifics of this module will change to become a generic super-set of all the sub-modules.
For now, the constructor for this module returns a Gcode::Interpreter::Ultimaker object, which then provides the real implementation of the methods described below.
The constructor currently just returns a Gcode::Interpreter::Ultimaker object.
Takes a string argument that is the name of the sub-object. At present, if it's not 'Ultimaker' then the constructor die()s. If it's either missing or 'Ultimaker' then a Gcode::Interpreter::Ultimaker object is returned.
This is a stub method that just returns a reference to a list of four elements, each of which is 'undef'.
This is a stub method that just returns a reference to a hash with two keys, 'duration' and 'extruded', both of which have 'undef' values.
This is a stb method that takes a string argument and always returns false.
Gcode::Interpreter::Ultimaker
To install Gcode::Interpreter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gcode::Interpreter
CPAN shell
perl -MCPAN -e shell install Gcode::Interpreter
For more information on module installation, please visit the detailed CPAN module installation guide.