Merge remote-tracking branch 'upstream/main' into dev/h2d-2
# Conflicts: # src/slic3r/GUI/Tab.cpp
This commit is contained in:
@@ -1061,7 +1061,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
|
||||
gcodegen.m_wipe.reset_path(); // We don't want wiping on the ramming lines.
|
||||
toolchange_gcode_str = gcodegen.set_extruder(new_extruder_id, tcr.print_z); // TODO: toolchange_z vs print_z
|
||||
if (gcodegen.config().enable_prime_tower) {
|
||||
deretraction_str += gcodegen.writer().travel_to_z(z, "restore layer Z");
|
||||
deretraction_str += gcodegen.writer().travel_to_z(z, "Force restore layer Z", true);
|
||||
Vec3d position{gcodegen.writer().get_position()};
|
||||
position.z() = z;
|
||||
gcodegen.writer().set_position(position);
|
||||
@@ -5734,10 +5734,11 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||
auto target_z = get_sloped_z(sloped->slope_begin.z_ratio);
|
||||
slope_need_z_travel = m_writer.will_move_z(target_z);
|
||||
}
|
||||
// go to first point of extrusion path
|
||||
//BBS: path.first_point is 2D point. But in lazy raise case, lift z is done in travel_to function.
|
||||
//Add m_need_change_layer_lift_z when change_layer in case of no lift if m_last_pos is equal to path.first_point() by chance
|
||||
// Move to first point of extrusion path
|
||||
// path is 2D. But in slope lift case, lift z is done in travel_to function.
|
||||
// Add m_need_change_layer_lift_z when change_layer in case of no lift if m_last_pos is equal to path.first_point() by chance
|
||||
if (!m_last_pos_defined || m_last_pos != path.first_point() || m_need_change_layer_lift_z || slope_need_z_travel) {
|
||||
const bool _last_pos_undefined = !m_last_pos_defined;
|
||||
gcode += this->travel_to(
|
||||
path.first_point(),
|
||||
path.role(),
|
||||
@@ -5745,8 +5746,13 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||
sloped == nullptr ? DBL_MAX : get_sloped_z(sloped->slope_begin.z_ratio)
|
||||
);
|
||||
m_need_change_layer_lift_z = false;
|
||||
// Orca: force restore Z after unknown last pos
|
||||
if (_last_pos_undefined && !slope_need_z_travel) {
|
||||
gcode += this->writer().travel_to_z(m_last_layer_z, "force restore Z after unknown last pos", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if needed, write the gcode_label_objects_end then gcode_label_objects_start
|
||||
// should be already done by travel_to, but just in case
|
||||
m_writer.add_object_change_labels(gcode);
|
||||
@@ -7182,6 +7188,8 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo
|
||||
if (m_config.enable_pressure_advance.get_at(new_filament_id)) {
|
||||
gcode += m_writer.set_pressure_advance(m_config.pressure_advance.get_at(new_filament_id));
|
||||
}
|
||||
//Orca: tool changer or IDEX's firmware may change Z position, so we set it to unknown/undefined
|
||||
m_last_pos_defined = false;
|
||||
|
||||
return gcode;
|
||||
}
|
||||
|
||||
@@ -1350,7 +1350,7 @@ void WipeTower2::set_extruder(size_t idx, const PrintConfig& config)
|
||||
// We will use the same variables internally, but the correspondence to the configuration options will be different.
|
||||
float vol = config.filament_multitool_ramming_volume.get_at(idx);
|
||||
float flow = config.filament_multitool_ramming_flow.get_at(idx);
|
||||
m_filpar[idx].multitool_ramming = config.filament_multitool_ramming.get_at(idx);
|
||||
m_filpar[idx].multitool_ramming = config.filament_multitool_ramming.get_at(idx) && vol > 0.f && flow > 0.f;
|
||||
m_filpar[idx].ramming_line_width_multiplicator = 2.;
|
||||
m_filpar[idx].ramming_step_multiplicator = 1.;
|
||||
|
||||
@@ -1360,7 +1360,7 @@ void WipeTower2::set_extruder(size_t idx, const PrintConfig& config)
|
||||
// ramming_speed vector that would respect both the volume and flow (because of
|
||||
// rounding issues with small volumes and high flow).
|
||||
m_filpar[idx].ramming_speed.push_back(flow);
|
||||
m_filpar[idx].multitool_ramming_time = vol/flow;
|
||||
m_filpar[idx].multitool_ramming_time = flow > 0.f ? vol/flow : 0.f;
|
||||
}
|
||||
|
||||
m_used_filament_length.resize(std::max(m_used_filament_length.size(), idx + 1)); // makes sure that the vector is big enough so we don't have to check later
|
||||
|
||||
@@ -637,12 +637,12 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co
|
||||
return out_string;
|
||||
}
|
||||
|
||||
std::string GCodeWriter::travel_to_z(double z, const std::string &comment)
|
||||
std::string GCodeWriter::travel_to_z(double z, const std::string &comment, bool force)
|
||||
{
|
||||
/* If target Z is lower than current Z but higher than nominal Z
|
||||
we don't perform the move but we only adjust the nominal Z by
|
||||
reducing the lift amount that will be used for unlift. */
|
||||
if (!this->will_move_z(z)) {
|
||||
if (!force && !this->will_move_z(z)) {
|
||||
double nominal_z = m_pos(2) - m_lifted;
|
||||
m_lifted -= (z - nominal_z);
|
||||
if (std::abs(m_lifted) < EPSILON)
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
double get_current_speed() const { return m_current_speed;}
|
||||
std::string travel_to_xy(const Vec2d &point, const std::string &comment = std::string());
|
||||
std::string travel_to_xyz(const Vec3d &point, const std::string &comment = std::string(), bool force_z = false);
|
||||
std::string travel_to_z(double z, const std::string &comment = std::string());
|
||||
std::string travel_to_z(double z, const std::string &comment = std::string(), bool force = false);
|
||||
bool will_move_z(double z) const;
|
||||
std::string extrude_to_xy(const Vec2d &point, double dE, const std::string &comment = std::string(), bool force_no_extrusion = false);
|
||||
//BBS: generate G2 or G3 extrude which moves by arc
|
||||
|
||||
@@ -191,6 +191,10 @@ void IMSlider::SetSelectionSpan(const int lower_val, const int higher_val)
|
||||
m_higher_value = std::max(std::min(higher_val, m_max_value), m_lower_value);
|
||||
if (m_lower_value < m_higher_value) m_is_one_layer = false;
|
||||
|
||||
// ORCA reset single layer position when min max values changed
|
||||
// This will trigger when print height changed. but stays same on reslicing if layer count is same
|
||||
m_one_layer_value = int((m_higher_value - m_lower_value)/2);
|
||||
|
||||
set_as_dirty();
|
||||
}
|
||||
|
||||
@@ -443,9 +447,20 @@ bool IMSlider::switch_one_layer_mode()
|
||||
return false;
|
||||
|
||||
m_is_one_layer = !m_is_one_layer;
|
||||
if (!m_is_one_layer) {
|
||||
if (!m_is_one_layer) { // DEACTIVATE
|
||||
m_one_layer_value = GetHigherValue(); // ORCA Backup value on deactivate
|
||||
SetLowerValue(m_min_value);
|
||||
SetHigherValue(m_max_value);
|
||||
SetHigherValue(m_max_value); // Higher value resets on toggling off one layer mode to show whole model
|
||||
}else{ // ACTIVATE
|
||||
// ORCA Ensure value fits range. value set in IMSlider::SetSelectionSpan but added this just in case
|
||||
if(!m_one_layer_value || m_one_layer_value > m_max_value || m_one_layer_value < m_min_value){
|
||||
m_one_layer_value = int((m_max_value - m_min_value)/2);
|
||||
SetHigherValue(m_one_layer_value);
|
||||
}
|
||||
else if(GetHigherValue() == m_max_value) // ORCA Prefer backup value if higher value reseted
|
||||
SetHigherValue(m_one_layer_value); // ORCA Restore value
|
||||
else // ORCA Prefer higher value if user changed higher value. so it will show section on same view
|
||||
SetHigherValue(GetHigherValue()); // ORCA use same position with higher value if user changed its position. visible section stays same when switching one layer mode with this
|
||||
}
|
||||
m_selection == ssLower ? correct_lower_value() : correct_higher_value();
|
||||
if (m_selection == ssUndef) m_selection = ssHigher;
|
||||
@@ -1487,6 +1502,7 @@ void IMSlider::on_mouse_wheel(wxMouseEvent& evt) {
|
||||
if (is_one_layer()) {
|
||||
const int new_pos = GetHigherValue() + wheel;
|
||||
SetHigherValue(new_pos);
|
||||
m_one_layer_value = new_pos; // ORCA backup value for single layer mode
|
||||
}
|
||||
else {
|
||||
const int new_pos = m_selection == ssLower ? GetLowerValue() + wheel : GetHigherValue() + wheel;
|
||||
|
||||
@@ -179,6 +179,7 @@ private:
|
||||
int m_max_value;
|
||||
int m_lower_value;
|
||||
int m_higher_value;
|
||||
int m_one_layer_value; // ORCA
|
||||
bool m_dirty = false;
|
||||
|
||||
bool m_render_as_disabled{ false };
|
||||
|
||||
@@ -501,7 +501,7 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox
|
||||
|
||||
// calculate and generate grid
|
||||
int step = Bed_2D::calculate_grid_step(pp_bbox, scale_(1.00));
|
||||
Vec2d scaled_origin = Vec2d(scale_(m_origin.x()),scale_(m_origin.x()));
|
||||
Vec2d scaled_origin = Vec2d(scale_(m_origin.x()),scale_(m_origin.y()));
|
||||
auto grid_lines = Bed_2D::generate_grid(poly, pp_bbox, scaled_origin, scale_(step), SCALED_EPSILON);
|
||||
|
||||
Lines lines_thin = to_lines(grid_lines[0]);
|
||||
|
||||
@@ -5399,7 +5399,7 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||
// }
|
||||
// }
|
||||
// Orca: check if the project is created with OrcaSlicer 2.3.1-alpha and use the sparse infill rotation template for non-safe infill patterns
|
||||
else if ((file_version < app_version) && file_version == Semver("2.3.1-alpha")) {
|
||||
else if (load_config && (file_version < app_version) && file_version == Semver("2.3.1-alpha")) {
|
||||
if (!config_loaded.opt_string("sparse_infill_rotate_template").empty()) {
|
||||
const auto _sparse_infill_pattern =
|
||||
config_loaded.option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value;
|
||||
|
||||
@@ -4031,6 +4031,10 @@ void TabFilament::toggle_options()
|
||||
"filament_cooling_initial_speed", "filament_cooling_final_speed"})
|
||||
toggle_option(el, !is_BBL_printer);
|
||||
|
||||
bool multitool_ramming = m_config->opt_bool("filament_multitool_ramming", 0);
|
||||
toggle_option("filament_multitool_ramming_volume", multitool_ramming);
|
||||
toggle_option("filament_multitool_ramming_flow", multitool_ramming);
|
||||
|
||||
const int extruder_idx = 0; // m_variant_combo->GetSelection(); // TODO: Orca hack
|
||||
toggle_line("retraction_distances_when_ec", m_config->opt_bool("long_retractions_when_ec", extruder_idx), 256 + extruder_idx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user