mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 11:52:05 +00:00
Extract set_nozzle_diameter()
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Slic3r {
|
||||
auto& writer = mp_gcodegen->writer();
|
||||
std::stringstream gcode;
|
||||
const double lw = 0.48;
|
||||
Flow line_flow = Flow(lw, 0.2, mp_gcodegen->config().nozzle_diameter.get_at(0));
|
||||
Flow line_flow = Flow(lw, 0.2, m_nozzle_diameter);
|
||||
const double len = m_digit_len;
|
||||
const double gap = lw / 2.0;
|
||||
|
||||
@@ -228,8 +228,8 @@ namespace Slic3r {
|
||||
|
||||
std::string calib_pressure_advance_line::print_pa_lines(double start_x, double start_y, double start_pa, double step_pa, int num) {
|
||||
auto& writer = mp_gcodegen->writer();
|
||||
Flow line_flow = Flow(m_line_width, 0.2, mp_gcodegen->config().nozzle_diameter.get_at(0));
|
||||
Flow thin_line_flow = Flow(0.44, 0.2, mp_gcodegen->config().nozzle_diameter.get_at(0));
|
||||
Flow line_flow = Flow(m_line_width, 0.2, m_nozzle_diameter);
|
||||
Flow thin_line_flow = Flow(0.44, 0.2, m_nozzle_diameter);
|
||||
const double e_calib = line_flow.mm3_per_mm() / 2.40528; // filament_mm/extrusion_mm
|
||||
const double e = thin_line_flow.mm3_per_mm() / 2.40528; // filament_mm/extrusion_mm
|
||||
|
||||
@@ -371,7 +371,7 @@ namespace Slic3r {
|
||||
auto& config = mp_gcodegen.config();
|
||||
auto& writer = mp_gcodegen.writer();
|
||||
|
||||
Flow line_flow = Flow(line_width, layer_height, config.nozzle_diameter.get_at(0));
|
||||
Flow line_flow = Flow(line_width, layer_height, m_nozzle_diameter);
|
||||
const double filament_area = M_PI * std::pow(config.filament_diameter.value / 2, 2);
|
||||
const double e_per_mm = line_flow.mm3_per_mm() / filament_area * config.print_flow_ratio;
|
||||
|
||||
|
||||
@@ -33,6 +33,10 @@ public:
|
||||
Horizontal = 0,
|
||||
Vertical
|
||||
};
|
||||
|
||||
void set_nozzle_diameter() {
|
||||
m_nozzle_diameter = mp_gcodegen->config().nozzle_diameter.get_at(0);
|
||||
}
|
||||
private:
|
||||
std::string move_to(Vec2d pt, std::string comment = std::string());
|
||||
std::string convert_number_to_string(double num);
|
||||
@@ -44,6 +48,7 @@ private:
|
||||
private:
|
||||
GCode* mp_gcodegen;
|
||||
double m_digit_len {2};
|
||||
double m_nozzle_diameter;
|
||||
int m_max_number_length {5};
|
||||
double m_number_spacing {3.0};
|
||||
}
|
||||
@@ -82,8 +87,8 @@ class calib_pressure_advance_pattern: public calib_pressure_advance
|
||||
|
||||
double to_radians(double degrees) { return degrees * (M_PI / 180); }
|
||||
|
||||
double line_width() { return mp_gcodegen->config().nozzle_diameter.get_at(0) * m_line_ratio / 100; };
|
||||
double line_width_anchor() { return mp_gcodegen->config().nozzle_diameter.get_at(0) * m_anchor_layer_line_ratio / 100; };
|
||||
double line_width() { return m_nozzle_diameter * m_line_ratio / 100; };
|
||||
double line_width_anchor() { return m_nozzle_diameter * m_anchor_layer_line_ratio / 100; };
|
||||
|
||||
// from slic3r documentation: spacing = extrusion_width - layer_height * (1 - PI/4)
|
||||
double line_spacing() { return line_width() - mp_gcodegen->config().layer_height.value * (1 - M_PI / 4); };
|
||||
|
||||
Reference in New Issue
Block a user