mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-06-02 18:29:50 +08:00
Refactoring in toolpaths generation
This commit is contained in:
parent
8579ecceed
commit
a40fc1fe2c
@ -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 TBuffer::ERenderPrimitiveType::Point:
|
||||||
case EMoveType::Color_change:
|
|
||||||
case EMoveType::Pause_Print:
|
|
||||||
case EMoveType::Custom_GCode:
|
|
||||||
case EMoveType::Retract:
|
|
||||||
case EMoveType::Unretract:
|
|
||||||
{
|
{
|
||||||
add_as_point(curr, buffer, buffer_vertices, static_cast<unsigned int>(buffer_indices.size()) - 1, buffer_indices.back(), i);
|
add_as_point(curr, buffer, buffer_vertices, static_cast<unsigned int>(buffer_indices.size()) - 1, buffer_indices.back(), i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EMoveType::Extrude:
|
case TBuffer::ERenderPrimitiveType::Line:
|
||||||
{
|
|
||||||
add_as_solid(prev, curr, buffer, buffer_vertices, static_cast<unsigned int>(buffer_indices.size()) - 1, buffer_indices.back(), i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case EMoveType::Travel:
|
|
||||||
{
|
{
|
||||||
add_as_line(prev, curr, buffer, buffer_vertices, static_cast<unsigned int>(buffer_indices.size()) - 1, buffer_indices.back(), i);
|
add_as_line(prev, curr, buffer, buffer_vertices, static_cast<unsigned int>(buffer_indices.size()) - 1, buffer_indices.back(), i);
|
||||||
break;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user