Backport of 0bd3112b7a
(Reworked custom gcode toolpaths generation)
This commit is contained in:
parent
be36287aef
commit
201ecd65eb
2 changed files with 3 additions and 4 deletions
|
@ -1230,7 +1230,6 @@ void GCodeProcessor::reset()
|
|||
m_extra_loading_move = 0.f;
|
||||
m_extruded_last_z = 0.0f;
|
||||
m_first_layer_height = 0.0f;
|
||||
m_processing_start_custom_gcode = false;
|
||||
m_g1_line_id = 0;
|
||||
m_layer_id = 0;
|
||||
m_cp_color.reset();
|
||||
|
@ -1816,7 +1815,6 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
|
|||
set_extrusion_role(ExtrusionEntity::string_to_role(comment.substr(reserved_tag(ETags::Role).length())));
|
||||
if (m_extrusion_role == erExternalPerimeter)
|
||||
m_seams_detector.activate(true);
|
||||
m_processing_start_custom_gcode = (m_extrusion_role == erCustom && m_g1_line_id == 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2523,6 +2521,8 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
|||
|
||||
if (m_forced_height > 0.0f)
|
||||
m_height = m_forced_height;
|
||||
else if (m_layer_id == 0)
|
||||
m_height = (m_end_position[Z] <= double(m_first_layer_height)) ? m_end_position[Z] : m_first_layer_height;
|
||||
else {
|
||||
if (m_end_position[Z] > m_extruded_last_z + EPSILON)
|
||||
m_height = m_end_position[Z] - m_extruded_last_z;
|
||||
|
@ -3232,7 +3232,7 @@ void GCodeProcessor::store_move_vertex(EMoveType type)
|
|||
m_extruder_id,
|
||||
m_cp_color.current,
|
||||
#if ENABLE_Z_OFFSET_CORRECTION
|
||||
Vec3f(m_end_position[X], m_end_position[Y], m_processing_start_custom_gcode ? m_first_layer_height : m_end_position[Z] - m_z_offset) + m_extruder_offsets[m_extruder_id],
|
||||
Vec3f(m_end_position[X], m_end_position[Y], m_end_position[Z] - m_z_offset) + m_extruder_offsets[m_extruder_id],
|
||||
#else
|
||||
Vec3f(m_end_position[X], m_end_position[Y], m_processing_start_custom_gcode ? m_first_layer_height : m_end_position[Z]) + m_extruder_offsets[m_extruder_id],
|
||||
#endif // ENABLE_Z_OFFSET_CORRECTION
|
||||
|
|
|
@ -534,7 +534,6 @@ namespace Slic3r {
|
|||
float m_extra_loading_move;
|
||||
float m_extruded_last_z;
|
||||
float m_first_layer_height; // mm
|
||||
bool m_processing_start_custom_gcode;
|
||||
unsigned int m_g1_line_id;
|
||||
unsigned int m_layer_id;
|
||||
CpColor m_cp_color;
|
||||
|
|
Loading…
Reference in a new issue