mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-17 05:52:39 +00:00
Merge remote-tracking branch 'upstream/main' into belt/baseChanges
Conflicts resolved in src/libslic3r/GCode.cpp and src/slic3r/GUI/GUI_Factories.cpp. GCode.cpp: combined upstream's air-filtration per-extruder gating (activate_air_filtration_during_print / _on_completion), the new extrusion-role-change gcode lambda, ZAA's path.z_contoured arc-fit disable, raft-aware slow_down_layers branch, and Vec3d/Line3 ZAA plumbing with the local belt-printer changes (path_on_first_layer, effective_layer_index_for_point, should_disable_arc_fitting). All auto-merged m_writer.X() calls converted to m_writer->X() to match the local unique_ptr<GCodeWriter> refactor. GUI_Factories.cpp: inserted brim_flow_ratio in the Support category list and renumbered around the local build_plate_tilt_x/y entries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1582,6 +1582,9 @@ void GCodeProcessorResult::reset() {
|
||||
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
|
||||
spiral_vase_mode = false;
|
||||
layer_filaments.clear();
|
||||
filament_change_sequence.clear();
|
||||
nozzle_change_sequence.clear();
|
||||
optimal_assignment.clear();
|
||||
filament_change_count_map.clear();
|
||||
warnings.clear();
|
||||
|
||||
@@ -5587,6 +5590,37 @@ void GCodeProcessor::process_filament_change(int id)
|
||||
void GCodeProcessor::store_move_vertex(EMoveType type, EMovePathType path_type, bool internal_only)
|
||||
{
|
||||
int filament_id = get_filament_id();
|
||||
const auto normal_mode = PrintEstimatedStatistics::ETimeMode::Normal;
|
||||
const size_t normal_mode_id = static_cast<size_t>(normal_mode);
|
||||
const float delta_x = std::abs(m_end_position[X] - m_start_position[X]);
|
||||
const float delta_y = std::abs(m_end_position[Y] - m_start_position[Y]);
|
||||
const float delta_z = std::abs(m_end_position[Z] - m_start_position[Z]);
|
||||
const float delta_e = std::abs(m_end_position[E] - m_start_position[E]);
|
||||
const bool has_x = delta_x > 0.0f;
|
||||
const bool has_y = delta_y > 0.0f;
|
||||
const bool has_z = delta_z > 0.0f;
|
||||
const bool has_e = delta_e > 0.0f;
|
||||
const float move_acceleration =
|
||||
(type == EMoveType::Travel) ? get_travel_acceleration(normal_mode) :
|
||||
((type == EMoveType::Retract || type == EMoveType::Unretract) ? get_retract_acceleration(normal_mode) :
|
||||
get_acceleration(normal_mode));
|
||||
const float junction_deviation = get_option_value(m_time_processor.machine_limits.machine_max_junction_deviation, normal_mode_id);
|
||||
const bool use_jd_jerk = (m_flavor == gcfMarlinFirmware && junction_deviation > 0.0f);
|
||||
const auto axis_jerk_for_preview = [this, normal_mode, use_jd_jerk, move_acceleration](Axis axis) {
|
||||
return use_jd_jerk ? get_axis_max_jerk_with_jd(normal_mode, axis, move_acceleration) : get_axis_max_jerk(normal_mode, axis);
|
||||
};
|
||||
const float jerk_x = axis_jerk_for_preview(X);
|
||||
const float jerk_y = axis_jerk_for_preview(Y);
|
||||
const float jerk_z = axis_jerk_for_preview(Z);
|
||||
const float jerk_e = axis_jerk_for_preview(E);
|
||||
const float move_jerk =
|
||||
(has_e && !has_x && !has_y && !has_z) ? jerk_e :
|
||||
(has_z && !has_x && !has_y) ? jerk_z :
|
||||
(has_x && has_y) ? std::min(jerk_x, jerk_y) :
|
||||
has_x ? jerk_x :
|
||||
has_y ? jerk_y :
|
||||
has_z ? jerk_z :
|
||||
std::min(jerk_x, jerk_y);
|
||||
m_last_line_id = (type == EMoveType::Color_change || type == EMoveType::Pause_Print || type == EMoveType::Custom_GCode) ?
|
||||
m_line_id + 1 :
|
||||
((type == EMoveType::Seam) ? m_last_line_id : m_line_id);
|
||||
@@ -5610,6 +5644,10 @@ void GCodeProcessor::store_move_vertex(EMoveType type, EMovePathType path_type,
|
||||
m_extruder_temps[filament_id],
|
||||
// ORCA: Add Pressure Advance visualization support
|
||||
m_pressure_advance,
|
||||
// ORCA: Add Acceleration visualization support
|
||||
move_acceleration,
|
||||
// ORCA: Add Jerk visualization support
|
||||
move_jerk,
|
||||
{ 0.0f, 0.0f }, // time
|
||||
static_cast<float>(m_layer_id), //layer_duration: set later
|
||||
std::max<unsigned int>(1, m_layer_id) - 1,
|
||||
@@ -5685,7 +5723,7 @@ float GCodeProcessor::get_axis_max_acceleration(PrintEstimatedStatistics::ETimeM
|
||||
}
|
||||
}
|
||||
|
||||
float GCodeProcessor::get_axis_max_jerk_with_jd(PrintEstimatedStatistics::ETimeMode mode, Axis axis) const
|
||||
float GCodeProcessor::get_axis_max_jerk_with_jd(PrintEstimatedStatistics::ETimeMode mode, Axis axis, float acceleration) const
|
||||
{
|
||||
if (axis != X && axis != Y && axis != Z && axis != E)
|
||||
return 0.0f;
|
||||
@@ -5696,12 +5734,22 @@ float GCodeProcessor::get_axis_max_jerk_with_jd(PrintEstimatedStatistics::ETimeM
|
||||
return 0.0f;
|
||||
|
||||
const float axis_max_acc = get_axis_max_acceleration(mode, axis);
|
||||
const float generic_acc = get_acceleration(mode);
|
||||
const float effective_acc = axis_max_acc > 0.0f ? axis_max_acc : generic_acc;
|
||||
float effective_acc = acceleration;
|
||||
if (effective_acc <= 0.0f)
|
||||
effective_acc = get_acceleration(mode);
|
||||
if (axis_max_acc > 0.0f)
|
||||
effective_acc = effective_acc > 0.0f ? std::min(effective_acc, axis_max_acc) : axis_max_acc;
|
||||
if (effective_acc <= 0.0f)
|
||||
return 0.0f;
|
||||
|
||||
return std::sqrt(jd * effective_acc * 2.5f);
|
||||
}
|
||||
|
||||
float GCodeProcessor::get_axis_max_jerk_with_jd(PrintEstimatedStatistics::ETimeMode mode, Axis axis) const
|
||||
{
|
||||
return get_axis_max_jerk_with_jd(mode, axis, get_acceleration(mode));
|
||||
}
|
||||
|
||||
float GCodeProcessor::get_axis_max_jerk(PrintEstimatedStatistics::ETimeMode mode, Axis axis) const
|
||||
{
|
||||
const size_t id = static_cast<size_t>(mode);
|
||||
|
||||
Reference in New Issue
Block a user