RepRapFlavorParser.py 862 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (c) 2018 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from . import FlavorParser
  4. class RepRapFlavorParser(FlavorParser.FlavorParser):
  5. """This parser is intended to interpret the RepRap Firmware g-code flavor."""
  6. def __init__(self):
  7. super().__init__()
  8. def _gCode90(self, position, params, path):
  9. """Set the absolute positioning
  10. RepRapFlavor code G90 sets position of X, Y, Z to absolute
  11. For absolute E, M82 is used
  12. """
  13. self._is_absolute_positioning = True
  14. return position
  15. def _gCode91(self, position, params, path):
  16. """Set the relative positioning
  17. RepRapFlavor code G91 sets position of X, Y, Z to relative
  18. For relative E, M83 is used
  19. """
  20. self._is_absolute_positioning = False
  21. return position