forked from prusa3d/PrusaSlicer
-
Notifications
You must be signed in to change notification settings - Fork 0
Extrusion toolpaths colors
Alex Petsiuk edited this page Jul 17, 2023
·
7 revisions
GCodeProcessor.hpp
- Tech ENABLE_PREVIEW_LAYER_TIME - Implementation of coloring toolpaths…
- ENABLE_PREVIEW_LAYER_TIME -> Linear and logarithmic layer time visual…
- void GCodeViewer::refresh(const GCodeProcessorResult& gcode_result, const std::vectorstd::string& str_tool_colors){...}
- void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool keep_sequential_current_last) const {...}
- void GCodeViewer::render_legend(float& legend_height){...}
- case EViewType::Height: { color = m_extrusions.ranges.height.get_color_at(path.height); break; }
- case EViewType::Tool: { color = m_tool_colors[path.extruder_id]; break; }
- if (m_view_type == EViewType::Tool){...// calculate used filaments data}
- if (m_view_type == EViewType::FeatureType) append_headers({ _u8L(""), _u8L("Time"), _u8L("Percentage"), _u8L("Used filament") }, offsets);
- else if (m_view_type == EViewType::Tool) append_headers({ _u8L(""), _u8L("Used filament"), _u8L(""), _u8L("") }, offsets);
- case EViewType::Height: { append_range(m_extrusions.ranges.height, 3); break; }
- case EViewType::Tool: append_item(EItemType::Rect, m_tool_colors[extruder_id], _u8L("Extruder") + " " + std::to_string(extruder_id + 1), true, "", 0.0f, 0.0f, offsets, used_filaments_m[i], used_filaments_g[i]);
- case EViewType::Height: { color = m_extrusions.ranges.height.get_color_at(path.height); break; }
- case EViewType::ATCLayerBatching: { color = m_extrusions.ranges.atc_batching.get_color_at(132); break; }
ColorRGBA GCodeViewer::Extrusions::Range::get_color_at(float value, EType type) const
(GCodeViewer.hpp): Slic3r::GUI::GCodeViewer::Path. Struct Path is used to identify different toolpath sub-types inside an IBuffer.
GCode.cpp
- std::string GCode::extrude_perimeters(const Print &print, const std::vectorObjectByExtruder::Island::Region &by_region)
- std::string GCode::extrude_entity(const ExtrusionEntity &entity, const std::string_view description, double speed)
- std::string GCode::extrude_path(ExtrusionPath path, std::string_view description, double speed)
- std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view description, double speed)
inside _extrude():
// extrude arc or line
if (m_enable_extrusion_role_markers)
{
if (path.role() != m_last_extrusion_role)
{
m_last_extrusion_role = path.role();
if (m_enable_extrusion_role_markers)
{
char buf[32];
sprintf(buf, ";_EXTRUSION_ROLE:%d\n", int(m_last_extrusion_role));
gcode += buf;
}
}
}
GCodeProcessor.cpp
GUI_Preview.cpp
GCodeViewer.cpp
GCodeProcessor.hpp