gcode_reader.emulate.machines.small_scale_am

Classes

DesktopAM

Base class for desktop AM machines with Marlin Firmware

RepRap

RepRap desktop AM

Module Contents

class gcode_reader.emulate.machines.small_scale_am.DesktopAM(extrusion_type=machine_options.REL_EXTRUSION, **kwargs)[source]

Bases: gcode_reader.emulate.machine.Machine

Base class for desktop AM machines with Marlin Firmware

Initializes a new Machine instance.

Parameters:
  • tools (Tuple[Tool, ...], optional) – A tuple of Tool instances for the machine to use. Defaults to None.

  • parser (GcodeParser, optional) – An instance of a GcodeParser. Defaults to a new GcodeParser().

  • exporter (GcodeExporter, optional) – An instance of a GcodeExporter. Defaults to a new GcodeExporter().

  • **options – Keyword arguments passed to the constructor of the machine’s MachineOptions type.

gcode_file_to_operation(filepath: str, operation_type=AdditiveOperation)[source]

Parses a G-code file and returns a processed Operation.

This method uses the machine’s configured parser to read a G-code file into a list of commands, wraps them in the specified operation_type, and then processes the operation to populate its process data.

Parameters:
  • filepath (str) – The path to the G-code file.

  • operation_type (type, optional) – The class of Operation to create (e.g., Operation, AdditiveOperation). Defaults to Operation.

Returns:

A new, processed Operation instance.

Return type:

Operation

Raises:

ValueError – If operation_type is not a valid subclass of Operation.

property relative_extrusion: bool
class gcode_reader.emulate.machines.small_scale_am.RepRap(**kwargs)[source]

Bases: DesktopAM

RepRap desktop AM

Initializes a new Machine instance.

Parameters:
  • tools (Tuple[Tool, ...], optional) – A tuple of Tool instances for the machine to use. Defaults to None.

  • parser (GcodeParser, optional) – An instance of a GcodeParser. Defaults to a new GcodeParser().

  • exporter (GcodeExporter, optional) – An instance of a GcodeExporter. Defaults to a new GcodeExporter().

  • **options – Keyword arguments passed to the constructor of the machine’s MachineOptions type.

options