Refactoring in toolpaths generation

This commit is contained in:
enricoturri1966 2020-09-17 08:46:27 +02:00
parent 8579ecceed
commit a40fc1fe2c

View File

@ -1213,29 +1213,23 @@ void GCodeViewer::load_toolpaths(const GCodeProcessor::Result& gcode_result)
}
}
switch (curr.type)
switch (buffer.render_primitive_type)
{
case EMoveType::Tool_change:
case EMoveType::Color_change:
case EMoveType::Pause_Print:
case EMoveType::Custom_GCode:
case EMoveType::Retract:
case EMoveType::Unretract:
case TBuffer::ERenderPrimitiveType::Point:
{
add_as_point(curr, buffer, buffer_vertices, static_cast<unsigned int>(buffer_indices.size()) - 1, buffer_indices.back(), i);
break;
}
case EMoveType::Extrude:
{
add_as_solid(prev, curr, buffer, buffer_vertices, static_cast<unsigned int>(buffer_indices.size()) - 1, buffer_indices.back(), i);
break;
}
case EMoveType::Travel:
case TBuffer::ERenderPrimitiveType::Line:
{
add_as_line(prev, curr, buffer, buffer_vertices, static_cast<unsigned int>(buffer_indices.size()) - 1, buffer_indices.back(), i);
break;
}
default: { break; }
case TBuffer::ERenderPrimitiveType::Triangle:
{
add_as_solid(prev, curr, buffer, buffer_vertices, static_cast<unsigned int>(buffer_indices.size()) - 1, buffer_indices.back(), i);
break;
}
}
}