mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-29 22:02:10 +00:00
Use cube primitive as positioning handle
This commit is contained in:
@@ -1869,7 +1869,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||||||
if (this->m_objsWithBrim.empty() && this->m_objSupportsWithBrim.empty()) m_brim_done = true;
|
if (this->m_objsWithBrim.empty() && this->m_objSupportsWithBrim.empty()) m_brim_done = true;
|
||||||
|
|
||||||
if (print.calib_params().mode == CalibMode::Calib_PA_Pattern) {
|
if (print.calib_params().mode == CalibMode::Calib_PA_Pattern) {
|
||||||
CalibPressureAdvancePattern pa_pattern(print.calib_params(), this);
|
const double max_layer_z = CalibPressureAdvancePatternPlate(print.calib_params()).max_layer_z();
|
||||||
|
BoundingBoxf bbox_print;
|
||||||
|
for (const PrintObject* obj : print.objects()) {
|
||||||
|
bbox_print.merge(get_print_object_extrusions_extents(*obj, max_layer_z));
|
||||||
|
}
|
||||||
|
const Vec2d starting_point(bbox_print.min.x(), bbox_print.max.y());
|
||||||
|
|
||||||
|
CalibPressureAdvancePattern pa_pattern(print.calib_params(), this, starting_point);
|
||||||
|
|
||||||
Model updated_model = print.model();
|
Model updated_model = print.model();
|
||||||
updated_model.plates_custom_gcodes[print.model().curr_plate_index] = pa_pattern.generate_gcodes();
|
updated_model.plates_custom_gcodes[print.model().curr_plate_index] = pa_pattern.generate_gcodes();
|
||||||
|
|||||||
@@ -6,12 +6,9 @@
|
|||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
CalibPressureAdvance::CalibPressureAdvance(GCode* gcodegen) :
|
CalibPressureAdvance::CalibPressureAdvance(GCode* gcodegen) :
|
||||||
mp_gcodegen(gcodegen)
|
mp_gcodegen(gcodegen),
|
||||||
{
|
m_nozzle_diameter(gcodegen->config().nozzle_diameter.get_at(0))
|
||||||
if (gcodegen != nullptr) {
|
{ };
|
||||||
m_nozzle_diameter = gcodegen->config().nozzle_diameter.get_at(0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
bool CalibPressureAdvance::is_delta() const
|
bool CalibPressureAdvance::is_delta() const
|
||||||
{
|
{
|
||||||
@@ -335,32 +332,17 @@ void CalibPressureAdvanceLine::delta_modify_start(double& startx, double& starty
|
|||||||
starty = -(count * m_space_y) / 2;
|
starty = -(count * m_space_y) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
PatternSettings::PatternSettings(const CalibPressureAdvancePattern& cpap) {
|
PatternSettings::PatternSettings(const CalibPressureAdvancePattern* cpap) :
|
||||||
anchor_line_width = cpap.line_width_anchor();
|
anchor_line_width(cpap->line_width_anchor()),
|
||||||
anchor_perimeters = cpap.anchor_perimeters();
|
anchor_perimeters(cpap->anchor_perimeters()),
|
||||||
encroachment = cpap.encroachment();
|
encroachment(cpap->encroachment()),
|
||||||
first_layer_height = cpap.height_first_layer();
|
first_layer_height(cpap->height_first_layer()),
|
||||||
first_layer_speed = cpap.speed_adjust(cpap.speed_first_layer());
|
first_layer_speed(cpap->speed_adjust(cpap->speed_first_layer())),
|
||||||
layer_height = cpap.height_layer();
|
layer_height(cpap->height_layer()),
|
||||||
line_width = cpap.line_width();
|
line_width(cpap->line_width()),
|
||||||
perim_speed = cpap.speed_adjust(cpap.speed_perimeter());
|
perim_speed(cpap->speed_adjust(cpap->speed_perimeter()))
|
||||||
}
|
|
||||||
|
|
||||||
CalibPressureAdvancePattern::CalibPressureAdvancePattern(const Calib_Params& params) :
|
|
||||||
CalibPressureAdvancePattern(params, nullptr)
|
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
CalibPressureAdvancePattern::CalibPressureAdvancePattern(const Calib_Params& params, GCode* gcodegen) :
|
|
||||||
CalibPressureAdvance(gcodegen),
|
|
||||||
m_start_pa(params.start),
|
|
||||||
m_end_pa(params.end),
|
|
||||||
m_step_pa(params.step)
|
|
||||||
{
|
|
||||||
this->m_draw_digit_mode = DrawDigitMode::Bottom_To_Top;
|
|
||||||
this->m_line_width = line_width();
|
|
||||||
this->m_height_layer = 0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomGCode::Info CalibPressureAdvancePattern::generate_gcodes()
|
CustomGCode::Info CalibPressureAdvancePattern::generate_gcodes()
|
||||||
{
|
{
|
||||||
assert(mp_gcodegen != nullptr);
|
assert(mp_gcodegen != nullptr);
|
||||||
@@ -368,15 +350,13 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_gcodes()
|
|||||||
std::stringstream gcode;
|
std::stringstream gcode;
|
||||||
GCodeWriter& writer = mp_gcodegen->writer();
|
GCodeWriter& writer = mp_gcodegen->writer();
|
||||||
|
|
||||||
gcode << writer.travel_to_xyz(
|
gcode << "; start pressure advance pattern for layer\n";
|
||||||
Vec3d(pattern_start_x(), pattern_start_y(), m_height_first_layer),
|
|
||||||
"Move to start position"
|
|
||||||
);
|
|
||||||
|
|
||||||
|
gcode << move_to(Vec2d(pattern_start_x(), pattern_start_y()), "Move to start XY position");
|
||||||
|
gcode << writer.travel_to_z(m_height_first_layer, "Move to start Z position");
|
||||||
gcode << writer.set_pressure_advance(m_start_pa);
|
gcode << writer.set_pressure_advance(m_start_pa);
|
||||||
|
|
||||||
const PatternSettings pattern_settings(*this);
|
const DrawBoxOptArgs default_box_opt_args(m_pattern_settings);
|
||||||
const DrawBoxOptArgs default_box_opt_args(pattern_settings);
|
|
||||||
|
|
||||||
// create anchor frame
|
// create anchor frame
|
||||||
gcode << draw_box(
|
gcode << draw_box(
|
||||||
@@ -400,19 +380,21 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_gcodes()
|
|||||||
);
|
);
|
||||||
|
|
||||||
std::vector<CustomGCode::Item> gcode_items;
|
std::vector<CustomGCode::Item> gcode_items;
|
||||||
|
const DrawLineOptArgs default_line_opt_args(m_pattern_settings);
|
||||||
const DrawLineOptArgs default_line_opt_args(pattern_settings);
|
|
||||||
const int num_patterns = get_num_patterns(); // "cache" for use in loops
|
const int num_patterns = get_num_patterns(); // "cache" for use in loops
|
||||||
|
|
||||||
// draw pressure advance pattern
|
// draw pressure advance pattern
|
||||||
for (int i = 0; i < m_num_layers; ++i) {
|
for (int i = 0; i < m_num_layers; ++i) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
|
gcode << "; end pressure advance pattern for layer\n";
|
||||||
CustomGCode::Item item;
|
CustomGCode::Item item;
|
||||||
item.print_z = i == 1 ? m_height_first_layer : m_height_layer;
|
item.print_z = m_height_first_layer + (i - 1) * m_height_layer;
|
||||||
item.type = CustomGCode::Type::Custom;
|
item.type = CustomGCode::Type::Custom;
|
||||||
item.extra = gcode.str();
|
item.extra = gcode.str();
|
||||||
gcode_items.push_back(item);
|
gcode_items.push_back(item);
|
||||||
|
|
||||||
gcode = std::stringstream(); // reset for next layer contents
|
gcode = std::stringstream(); // reset for next layer contents
|
||||||
|
gcode << "; start pressure advance pattern for layer\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// // line numbering
|
// // line numbering
|
||||||
@@ -509,14 +491,13 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_gcodes()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set pressure advance back to start value
|
|
||||||
gcode << writer.set_pressure_advance(m_start_pa);
|
gcode << writer.set_pressure_advance(m_start_pa);
|
||||||
|
gcode << "; end pressure advance pattern for layer\n";
|
||||||
|
|
||||||
CustomGCode::Item item;
|
CustomGCode::Item item;
|
||||||
item.print_z = m_height_layer;
|
item.print_z = max_layer_z();
|
||||||
item.type = CustomGCode::Type::Custom;
|
item.type = CustomGCode::Type::Custom;
|
||||||
item.extra = gcode.str();
|
item.extra = gcode.str();
|
||||||
|
|
||||||
gcode_items.push_back(item);
|
gcode_items.push_back(item);
|
||||||
|
|
||||||
CustomGCode::Info info;
|
CustomGCode::Info info;
|
||||||
@@ -528,6 +509,8 @@ CustomGCode::Info CalibPressureAdvancePattern::generate_gcodes()
|
|||||||
|
|
||||||
std::string CalibPressureAdvancePattern::draw_line(double to_x, double to_y, DrawLineOptArgs opt_args)
|
std::string CalibPressureAdvancePattern::draw_line(double to_x, double to_y, DrawLineOptArgs opt_args)
|
||||||
{
|
{
|
||||||
|
assert(mp_gcodegen != nullptr);
|
||||||
|
|
||||||
std::stringstream gcode;
|
std::stringstream gcode;
|
||||||
|
|
||||||
const double e_per_mm = CalibPressureAdvance::e_per_mm(
|
const double e_per_mm = CalibPressureAdvance::e_per_mm(
|
||||||
@@ -537,6 +520,7 @@ std::string CalibPressureAdvancePattern::draw_line(double to_x, double to_y, Dra
|
|||||||
mp_gcodegen->config().filament_flow_ratio.get_at(0)
|
mp_gcodegen->config().filament_flow_ratio.get_at(0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TODO: this seems to always be (0, 0)
|
||||||
const Point last_pos = mp_gcodegen->last_pos();
|
const Point last_pos = mp_gcodegen->last_pos();
|
||||||
const double length = get_distance(last_pos.x(), last_pos.y(), to_x, to_y);
|
const double length = get_distance(last_pos.x(), last_pos.y(), to_x, to_y);
|
||||||
auto dE = e_per_mm * length;
|
auto dE = e_per_mm * length;
|
||||||
@@ -570,8 +554,7 @@ std::string CalibPressureAdvancePattern::draw_box(double min_x, double min_y, do
|
|||||||
|
|
||||||
gcode << move_to(Vec2d(min_x, min_y), "Move to box start");
|
gcode << move_to(Vec2d(min_x, min_y), "Move to box start");
|
||||||
|
|
||||||
PatternSettings ps(*this);
|
DrawLineOptArgs line_opt_args(m_pattern_settings);
|
||||||
DrawLineOptArgs line_opt_args(ps);
|
|
||||||
line_opt_args.height = opt_args.height;
|
line_opt_args.height = opt_args.height;
|
||||||
line_opt_args.line_width = opt_args.line_width;
|
line_opt_args.line_width = opt_args.line_width;
|
||||||
line_opt_args.speed = opt_args.speed;
|
line_opt_args.speed = opt_args.speed;
|
||||||
@@ -742,6 +725,7 @@ double CalibPressureAdvancePattern::get_distance(double cur_x, double cur_y, dou
|
|||||||
|
|
||||||
Point CalibPressureAdvancePattern::bed_center()
|
Point CalibPressureAdvancePattern::bed_center()
|
||||||
{
|
{
|
||||||
|
assert(mp_gcodegen != nullptr);
|
||||||
BoundingBoxf bed_ext = get_extents(mp_gcodegen->config().printable_area.values);
|
BoundingBoxf bed_ext = get_extents(mp_gcodegen->config().printable_area.values);
|
||||||
|
|
||||||
if (is_delta()) {
|
if (is_delta()) {
|
||||||
@@ -836,26 +820,42 @@ double CalibPressureAdvancePattern::pattern_shift()
|
|||||||
|
|
||||||
double CalibPressureAdvancePattern::pattern_start_x()
|
double CalibPressureAdvancePattern::pattern_start_x()
|
||||||
{
|
{
|
||||||
double pattern_start_x =
|
// double pattern_start_x =
|
||||||
bed_center().x() -
|
// bed_center().x() -
|
||||||
(object_size_x() + pattern_shift()) / 2
|
// (object_size_x() + pattern_shift()) / 2
|
||||||
;
|
// ;
|
||||||
|
|
||||||
|
// if (is_delta()) {
|
||||||
|
// pattern_start_x = -pattern_start_x;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return pattern_start_x;
|
||||||
|
|
||||||
|
double x = m_starting_point.x();
|
||||||
|
|
||||||
if (is_delta()) {
|
if (is_delta()) {
|
||||||
pattern_start_x = -pattern_start_x;
|
x = -x;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pattern_start_x;
|
return x;
|
||||||
};
|
};
|
||||||
|
|
||||||
double CalibPressureAdvancePattern::pattern_start_y()
|
double CalibPressureAdvancePattern::pattern_start_y()
|
||||||
{
|
{
|
||||||
double pattern_start_y = bed_center().y() - object_size_y() / 2;
|
// double pattern_start_y = bed_center().y() - object_size_y() / 2;
|
||||||
|
|
||||||
|
// if (is_delta()) {
|
||||||
|
// pattern_start_y = -(frame_size_y() / 2);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return pattern_start_y;
|
||||||
|
|
||||||
|
double y = m_starting_point.y();
|
||||||
|
|
||||||
if (is_delta()) {
|
if (is_delta()) {
|
||||||
pattern_start_y = -(frame_size_y() / 2);
|
y -= (frame_size_y() / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pattern_start_y;
|
return y;
|
||||||
};
|
};
|
||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ struct Calib_Params {
|
|||||||
|
|
||||||
class CalibPressureAdvance {
|
class CalibPressureAdvance {
|
||||||
protected:
|
protected:
|
||||||
CalibPressureAdvance() : mp_gcodegen(nullptr) { };
|
CalibPressureAdvance() { };
|
||||||
CalibPressureAdvance(GCode* gcodegen);
|
CalibPressureAdvance(GCode* gcodegen);
|
||||||
~CalibPressureAdvance() { };
|
~CalibPressureAdvance() { };
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ protected:
|
|||||||
Bottom_To_Top
|
Bottom_To_Top
|
||||||
};
|
};
|
||||||
|
|
||||||
bool is_delta() const;
|
bool is_delta() const;
|
||||||
void delta_scale_bed_ext(BoundingBoxf& bed_ext) { bed_ext.scale(1.0f / 1.41421f); }
|
void delta_scale_bed_ext(BoundingBoxf& bed_ext) { bed_ext.scale(1.0f / 1.41421f); }
|
||||||
|
|
||||||
std::string move_to(Vec2d pt, std::string comment = std::string());
|
std::string move_to(Vec2d pt, std::string comment = std::string());
|
||||||
@@ -70,16 +70,16 @@ protected:
|
|||||||
double layer_height
|
double layer_height
|
||||||
);
|
);
|
||||||
|
|
||||||
GCode* mp_gcodegen;
|
GCode* mp_gcodegen {nullptr};
|
||||||
|
|
||||||
DrawDigitMode m_draw_digit_mode {DrawDigitMode::Left_To_Right};
|
DrawDigitMode m_draw_digit_mode {DrawDigitMode::Left_To_Right};
|
||||||
double m_digit_segment_len {2};
|
const double m_digit_segment_len {2};
|
||||||
double m_digit_gap_len {1};
|
const double m_digit_gap_len {1};
|
||||||
std::string::size_type m_max_number_len {5};
|
const std::string::size_type m_max_number_len {5};
|
||||||
|
|
||||||
double m_nozzle_diameter;
|
double m_nozzle_diameter {-1};
|
||||||
double m_line_width;
|
double m_line_width {-1};
|
||||||
double m_height_layer;
|
double m_height_layer {-1};
|
||||||
};
|
};
|
||||||
|
|
||||||
class CalibPressureAdvanceLine : public CalibPressureAdvance {
|
class CalibPressureAdvanceLine : public CalibPressureAdvance {
|
||||||
@@ -117,7 +117,10 @@ friend class CalibPressureAdvancePattern;
|
|||||||
friend struct DrawLineOptArgs;
|
friend struct DrawLineOptArgs;
|
||||||
friend struct DrawBoxOptArgs;
|
friend struct DrawBoxOptArgs;
|
||||||
private:
|
private:
|
||||||
PatternSettings(const CalibPressureAdvancePattern& cpap);
|
PatternSettings() { };
|
||||||
|
PatternSettings(const CalibPressureAdvancePattern* cpap);
|
||||||
|
|
||||||
|
PatternSettings& operator= (const PatternSettings& rhs) =default;
|
||||||
|
|
||||||
double anchor_line_width;
|
double anchor_line_width;
|
||||||
int anchor_perimeters;
|
int anchor_perimeters;
|
||||||
@@ -132,7 +135,7 @@ private:
|
|||||||
struct DrawLineOptArgs {
|
struct DrawLineOptArgs {
|
||||||
friend class CalibPressureAdvancePattern;
|
friend class CalibPressureAdvancePattern;
|
||||||
private:
|
private:
|
||||||
DrawLineOptArgs(const PatternSettings ps) {
|
DrawLineOptArgs(const PatternSettings& ps) {
|
||||||
height = ps.layer_height;
|
height = ps.layer_height;
|
||||||
line_width = ps.line_width;
|
line_width = ps.line_width;
|
||||||
speed = ps.perim_speed;
|
speed = ps.perim_speed;
|
||||||
@@ -147,7 +150,7 @@ private:
|
|||||||
struct DrawBoxOptArgs {
|
struct DrawBoxOptArgs {
|
||||||
friend class CalibPressureAdvancePattern;
|
friend class CalibPressureAdvancePattern;
|
||||||
private:
|
private:
|
||||||
DrawBoxOptArgs(const PatternSettings ps) {
|
DrawBoxOptArgs(const PatternSettings& ps) {
|
||||||
num_perimeters = ps.anchor_perimeters;
|
num_perimeters = ps.anchor_perimeters;
|
||||||
height = ps.first_layer_height;
|
height = ps.first_layer_height;
|
||||||
line_width = ps.anchor_line_width;
|
line_width = ps.anchor_line_width;
|
||||||
@@ -161,19 +164,66 @@ private:
|
|||||||
double speed;
|
double speed;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CalibPressureAdvancePattern : public CalibPressureAdvance {
|
// the bare minimum needed to plate this calibration test
|
||||||
friend struct PatternSettings;
|
class CalibPressureAdvancePatternPlate : public CalibPressureAdvance {
|
||||||
public:
|
public:
|
||||||
CalibPressureAdvancePattern(const Calib_Params& params);
|
CalibPressureAdvancePatternPlate(const Calib_Params& params) :
|
||||||
CalibPressureAdvancePattern(const Calib_Params& params, GCode* gcodegen);
|
CalibPressureAdvance(),
|
||||||
~CalibPressureAdvancePattern() { };
|
m_start_pa(params.start),
|
||||||
|
m_end_pa(params.end),
|
||||||
CustomGCode::Info generate_gcodes();
|
m_step_pa(params.step)
|
||||||
|
{
|
||||||
double max_layer_z() { return m_height_first_layer + ((m_num_layers - 1) * m_height_layer); };
|
this->m_height_layer = 0.2;
|
||||||
|
};
|
||||||
|
CalibPressureAdvancePatternPlate(
|
||||||
|
const Calib_Params& params,
|
||||||
|
GCode* gcodegen
|
||||||
|
) :
|
||||||
|
CalibPressureAdvance(gcodegen),
|
||||||
|
m_start_pa(params.start),
|
||||||
|
m_end_pa(params.end),
|
||||||
|
m_step_pa(params.step)
|
||||||
|
{
|
||||||
|
this->m_height_layer = 0.2;
|
||||||
|
};
|
||||||
|
|
||||||
double height_first_layer() const { return m_height_first_layer; };
|
double height_first_layer() const { return m_height_first_layer; };
|
||||||
double height_layer() const { return m_height_layer; };
|
double height_layer() const { return m_height_layer; };
|
||||||
|
double max_layer_z() { return m_height_first_layer + ((m_num_layers - 1) * m_height_layer); };
|
||||||
|
|
||||||
|
double handle_xy_size() { return m_handle_xy_size; };
|
||||||
|
protected:
|
||||||
|
const double m_start_pa;
|
||||||
|
const double m_end_pa;
|
||||||
|
const double m_step_pa;
|
||||||
|
|
||||||
|
const double m_handle_xy_size {5};
|
||||||
|
|
||||||
|
const int m_num_layers {4};
|
||||||
|
const double m_height_first_layer {0.25};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Remaining definition. Separated because it requires fully setup GCode object,
|
||||||
|
which is not available at the time of plating */
|
||||||
|
class CalibPressureAdvancePattern : public CalibPressureAdvancePatternPlate {
|
||||||
|
friend struct PatternSettings;
|
||||||
|
public:
|
||||||
|
CalibPressureAdvancePattern(
|
||||||
|
const Calib_Params& params,
|
||||||
|
GCode* gcodegen,
|
||||||
|
const Vec2d starting_point
|
||||||
|
) :
|
||||||
|
CalibPressureAdvancePatternPlate(params, gcodegen),
|
||||||
|
m_starting_point(starting_point)
|
||||||
|
{
|
||||||
|
this->m_draw_digit_mode = DrawDigitMode::Bottom_To_Top;
|
||||||
|
this->m_line_width = line_width();
|
||||||
|
|
||||||
|
this->m_pattern_settings = PatternSettings(this);
|
||||||
|
};
|
||||||
|
~CalibPressureAdvancePattern() { };
|
||||||
|
|
||||||
|
CustomGCode::Info generate_gcodes();
|
||||||
protected:
|
protected:
|
||||||
double line_width() const { return m_nozzle_diameter * m_line_ratio / 100; };
|
double line_width() const { return m_nozzle_diameter * m_line_ratio / 100; };
|
||||||
double line_width_anchor() const { return m_nozzle_diameter * m_anchor_layer_line_ratio / 100; };
|
double line_width_anchor() const { return m_nozzle_diameter * m_anchor_layer_line_ratio / 100; };
|
||||||
@@ -216,27 +266,24 @@ private:
|
|||||||
double pattern_start_x();
|
double pattern_start_x();
|
||||||
double pattern_start_y();
|
double pattern_start_y();
|
||||||
|
|
||||||
const double m_start_pa;
|
PatternSettings m_pattern_settings;
|
||||||
const double m_end_pa;
|
const Vec2d m_starting_point;
|
||||||
const double m_step_pa;
|
|
||||||
|
|
||||||
double m_line_ratio {112.5};
|
const double m_line_ratio {112.5};
|
||||||
int m_num_layers {4};
|
const int m_anchor_layer_line_ratio {140};
|
||||||
double m_height_first_layer {0.25};
|
const int m_anchor_perimeters {4};
|
||||||
double m_speed_first_layer {30};
|
|
||||||
double m_speed_perimeter {100};
|
|
||||||
|
|
||||||
int m_anchor_perimeters {4};
|
const double m_speed_first_layer {30};
|
||||||
int m_anchor_layer_line_ratio {140};
|
const double m_speed_perimeter {100};
|
||||||
|
|
||||||
double m_prime_zone_buffer {10};
|
const double m_prime_zone_buffer {10};
|
||||||
int m_wall_count {3};
|
const int m_wall_count {3};
|
||||||
double m_wall_side_length {30.0};
|
const double m_wall_side_length {30.0};
|
||||||
int m_corner_angle {90};
|
const int m_corner_angle {90};
|
||||||
int m_pattern_spacing {2};
|
const int m_pattern_spacing {2};
|
||||||
double m_encroachment {1. / 3.};
|
const double m_encroachment {1. / 3.};
|
||||||
|
|
||||||
double m_glyph_padding_horizontal {1};
|
const double m_glyph_padding_horizontal {1};
|
||||||
double m_glyph_padding_vertical {1};
|
const double m_glyph_padding_vertical {1};
|
||||||
};
|
};
|
||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
|
|||||||
@@ -8125,11 +8125,14 @@ void Plater::calib_pa(const Calib_Params& params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Plater::_calib_pa_pattern(const Calib_Params& params) {
|
void Plater::_calib_pa_pattern(const Calib_Params& params) {
|
||||||
add_model(false, Slic3r::resources_dir() + "/calib/PressureAdvance/pressure_advance_test.stl");
|
sidebar().obj_list()->load_generic_subobject("Cube", ModelVolumeType::INVALID);
|
||||||
orient();
|
orient();
|
||||||
|
|
||||||
DynamicPrintConfig* print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
DynamicPrintConfig* print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||||
CalibPressureAdvancePattern pa_pattern(params);
|
DynamicPrintConfig* printerConfig = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
|
||||||
|
DynamicPrintConfig* filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||||
|
|
||||||
|
CalibPressureAdvancePatternPlate pa_pattern(params);
|
||||||
|
|
||||||
print_config->set_key_value("layer_height", new ConfigOptionFloat(pa_pattern.height_layer()));
|
print_config->set_key_value("layer_height", new ConfigOptionFloat(pa_pattern.height_layer()));
|
||||||
print_config->set_key_value("initial_layer_print_height", new ConfigOptionFloat(pa_pattern.height_first_layer()));
|
print_config->set_key_value("initial_layer_print_height", new ConfigOptionFloat(pa_pattern.height_first_layer()));
|
||||||
@@ -8147,8 +8150,11 @@ void Plater::_calib_pa_pattern(const Calib_Params& params) {
|
|||||||
|
|
||||||
GizmoObjectManipulation& giz_obj_manip = p->view3D->get_canvas3d()->
|
GizmoObjectManipulation& giz_obj_manip = p->view3D->get_canvas3d()->
|
||||||
get_gizmos_manager().get_object_manipulation();
|
get_gizmos_manager().get_object_manipulation();
|
||||||
|
giz_obj_manip.set_uniform_scaling(true);
|
||||||
|
giz_obj_manip.on_change("size", 0, pa_pattern.handle_xy_size());
|
||||||
giz_obj_manip.set_uniform_scaling(false);
|
giz_obj_manip.set_uniform_scaling(false);
|
||||||
giz_obj_manip.on_change("size", 2, pa_pattern.max_layer_z());
|
giz_obj_manip.on_change("size", 2, pa_pattern.max_layer_z());
|
||||||
|
center_selection();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plater::_calib_pa_tower(const Calib_Params& params) {
|
void Plater::_calib_pa_tower(const Calib_Params& params) {
|
||||||
|
|||||||
Reference in New Issue
Block a user