mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
#3082 - Workaround to fix incorrect object position after applying gcode line G92 into custom gcode
This commit is contained in:
parent
28a6bd7c30
commit
2d610f9b84
2 changed files with 27 additions and 0 deletions
|
@ -285,6 +285,11 @@ void GCodeAnalyzer::_process_gcode_line(GCodeReader&, const GCodeReader::GCodeLi
|
||||||
_processM108orM135(line);
|
_processM108orM135(line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 132: // Recall stored home offsets
|
||||||
|
{
|
||||||
|
_processM132(line);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 401: // Repetier: Store x, y and z position
|
case 401: // Repetier: Store x, y and z position
|
||||||
{
|
{
|
||||||
_processM401(line);
|
_processM401(line);
|
||||||
|
@ -504,6 +509,25 @@ void GCodeAnalyzer::_processM108orM135(const GCodeReader::GCodeLine& line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GCodeAnalyzer::_processM132(const GCodeReader::GCodeLine& line)
|
||||||
|
{
|
||||||
|
// This command is used by Makerbot to load the current home position from EEPROM
|
||||||
|
// see: https://github.com/makerbot/s3g/blob/master/doc/GCodeProtocol.md
|
||||||
|
// Using this command to reset the axis origin to zero helps in fixing: https://github.com/prusa3d/PrusaSlicer/issues/3082
|
||||||
|
|
||||||
|
if (line.has_x())
|
||||||
|
_set_axis_origin(X, 0.0f);
|
||||||
|
|
||||||
|
if (line.has_y())
|
||||||
|
_set_axis_origin(Y, 0.0f);
|
||||||
|
|
||||||
|
if (line.has_z())
|
||||||
|
_set_axis_origin(Z, 0.0f);
|
||||||
|
|
||||||
|
if (line.has_e())
|
||||||
|
_set_axis_origin(E, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
void GCodeAnalyzer::_processM401(const GCodeReader::GCodeLine& line)
|
void GCodeAnalyzer::_processM401(const GCodeReader::GCodeLine& line)
|
||||||
{
|
{
|
||||||
if (m_gcode_flavor != gcfRepetier)
|
if (m_gcode_flavor != gcfRepetier)
|
||||||
|
|
|
@ -182,6 +182,9 @@ private:
|
||||||
// Set tool (MakerWare and Sailfish flavor)
|
// Set tool (MakerWare and Sailfish flavor)
|
||||||
void _processM108orM135(const GCodeReader::GCodeLine& line);
|
void _processM108orM135(const GCodeReader::GCodeLine& line);
|
||||||
|
|
||||||
|
// Recall stored home offsets
|
||||||
|
void _processM132(const GCodeReader::GCodeLine& line);
|
||||||
|
|
||||||
// Repetier: Store x, y and z position
|
// Repetier: Store x, y and z position
|
||||||
void _processM401(const GCodeReader::GCodeLine& line);
|
void _processM401(const GCodeReader::GCodeLine& line);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue