GCode Anayzer take in account extruder offsets
This commit is contained in:
parent
4f122fed70
commit
8a29ec2204
4 changed files with 51 additions and 1 deletions
src/libslic3r
|
@ -1,3 +1,4 @@
|
|||
#include "libslic3r.h"
|
||||
#include "GCode.hpp"
|
||||
#include "ExtrusionEntity.hpp"
|
||||
#include "EdgeGrid.hpp"
|
||||
|
@ -573,6 +574,17 @@ void GCode::_do_export(Print &print, FILE *file)
|
|||
|
||||
// resets analyzer
|
||||
m_analyzer.reset();
|
||||
#if ENABLE_ANALYZER_EXTRUDER_OFFSET
|
||||
// send extruder offset data to analyzer
|
||||
std::vector<Vec2d> extruder_offsets;
|
||||
for (unsigned int extruder_id : print.extruders())
|
||||
{
|
||||
extruder_offsets.push_back(print.config().extruder_offset.get_at(extruder_id));
|
||||
}
|
||||
|
||||
m_analyzer.set_extruder_offsets(extruder_offsets);
|
||||
#endif // ENABLE_ANALYZER_EXTRUDER_OFFSET
|
||||
|
||||
|
||||
// resets analyzer's tracking data
|
||||
m_last_mm3_per_mm = GCodeAnalyzer::Default_mm3_per_mm;
|
||||
|
@ -843,7 +855,9 @@ void GCode::_do_export(Print &print, FILE *file)
|
|||
for (unsigned int extruder_id : print.extruders()) {
|
||||
const Vec2d &extruder_offset = print.config().extruder_offset.get_at(extruder_id);
|
||||
Polygon s(outer_skirt);
|
||||
s.translate(Point::new_scale(- extruder_offset(0), - extruder_offset(1)));
|
||||
#if !ENABLE_ANALYZER_EXTRUDER_OFFSET
|
||||
s.translate(Point::new_scale(-extruder_offset(0), -extruder_offset(1)));
|
||||
#endif // !ENABLE_ANALYZER_EXTRUDER_OFFSET
|
||||
skirts.emplace_back(std::move(s));
|
||||
}
|
||||
m_ooze_prevention.enable = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue