Add center of mass markers to Prepare and Preview (#16291)

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
Co-authored-by: Kris Austin <kris.austin@gmail.com>
This commit is contained in:
Ian Bassi
2026-10-09 16:48:48 -03:00
committed by GitHub
co-authored by Rodrigo Faselli Kris Austin
parent b5ef24e7ff
commit 0f3e8fbf27
22 changed files with 1781 additions and 77 deletions
+12
View File
@@ -1441,6 +1441,10 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
wxGetApp().plater()->schedule_background_process();
return;
}
m_plate_mass = gcode_result.plate_mass;
m_object_masses = gcode_result.object_masses;
m_body_masses = gcode_result.body_masses;
m_support_masses = gcode_result.support_masses;
// convert data from PrusaSlicer format to libvgcode format.
// Belt printers: when the designed (upright) view is active, back-transform
@@ -1876,6 +1880,10 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
void GCodeViewer::load_as_preview(libvgcode::GCodeInputData&& data)
{
m_loaded_as_preview = true;
m_plate_mass = {};
m_object_masses.clear();
m_body_masses.clear();
m_support_masses.clear();
m_move_type_counts.fill(0);
for (auto& move_type_times : m_move_type_times)
@@ -1955,6 +1963,10 @@ void GCodeViewer::reset()
m_move_type_distances.fill(0.0f);
m_print_statistics.reset();
m_custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
m_plate_mass = {};
m_object_masses.clear();
m_body_masses.clear();
m_support_masses.clear();
m_left_extruder_filament.clear();
m_right_extruder_filament.clear();
m_sequential_view.gcode_window.reset();