Merge branch 'main' into bugfox/bed-shape-orientation

This commit is contained in:
Noisyfox
2025-04-20 18:21:31 +08:00
committed by GitHub
224 changed files with 7442 additions and 1142 deletions
+6 -6
View File
@@ -3139,6 +3139,9 @@ void GCode::print_machine_envelope(GCodeOutputStream &file, Print &print)
print.config().machine_max_jerk_y.values.front() * factor,
print.config().machine_max_jerk_z.values.front() * factor,
print.config().machine_max_jerk_e.values.front() * factor);
// New Marlin uses M205 J[mm] for junction deviation (only apply if it is > 0)
file.write_format(writer().set_junction_deviation(config().machine_max_junction_deviation.values.front()).c_str());
}
}
@@ -3783,9 +3786,6 @@ LayerResult GCode::process_layer(
}
case CalibMode::Calib_Input_shaping_freq: {
if (m_layer_index == 1){
if (print.config().gcode_flavor.value == gcfMarlinFirmware) {
gcode += writer().set_junction_deviation(0.25);//Set junction deviation at high value to maximize ringing.
}
gcode += writer().set_input_shaping('A', print.calib_params().start, 0.f);
} else {
if (print.calib_params().freqStartX == print.calib_params().freqStartY && print.calib_params().freqEndX == print.calib_params().freqEndY) {
@@ -3799,9 +3799,6 @@ LayerResult GCode::process_layer(
}
case CalibMode::Calib_Input_shaping_damp: {
if (m_layer_index == 1){
if (print.config().gcode_flavor.value == gcfMarlinFirmware) {
gcode += writer().set_junction_deviation(0.25); // Set junction deviation at high value to maximize ringing.
}
gcode += writer().set_input_shaping('X', 0.f, print.calib_params().freqStartX);
gcode += writer().set_input_shaping('Y', 0.f, print.calib_params().freqStartY);
} else {
@@ -3826,6 +3823,9 @@ LayerResult GCode::process_layer(
gcode += m_writer.set_jerk_xy(m_config.initial_layer_jerk.value);
}
if (m_writer.get_gcode_flavor() == gcfMarlinFirmware && m_config.default_junction_deviation.value > 0) {
gcode += m_writer.set_junction_deviation(m_config.default_junction_deviation.value);
}
}
if (! first_layer && ! m_second_layer_things_done) {
+52 -47
View File
@@ -1038,6 +1038,10 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
if (machine_max_jerk_e != nullptr)
m_time_processor.machine_limits.machine_max_jerk_e.values = machine_max_jerk_e->values;
const ConfigOptionFloats* machine_max_junction_deviation = config.option<ConfigOptionFloats>("machine_max_junction_deviation");
if (machine_max_junction_deviation != nullptr)
m_time_processor.machine_limits.machine_max_junction_deviation.values = machine_max_junction_deviation->values;
const ConfigOptionFloats* machine_max_acceleration_extruding = config.option<ConfigOptionFloats>("machine_max_acceleration_extruding");
if (machine_max_acceleration_extruding != nullptr)
m_time_processor.machine_limits.machine_max_acceleration_extruding.values = machine_max_acceleration_extruding->values;
@@ -4598,55 +4602,56 @@ void GCodeProcessor::run_post_process()
if (m_print != nullptr)
m_print->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, warning);
}
}
export_lines.insert_lines(
backtrace, cmd,
// line inserter
[tool_number, this](unsigned int id, const std::vector<float>& time_diffs) {
const int temperature = int(m_layer_id != 1 ? m_extruder_temps_config[tool_number] :
m_extruder_temps_first_layer_config[tool_number]);
// Orca: M104.1 for XL printers, I can't find the documentation for this so I copied the C++ comments from
// Prusa-Firmware-Buddy here
/**
* M104.1: Early Set Hotend Temperature (preheat, and with stealth mode support)
*
* This GCode is used to tell the XL printer the time estimate when a tool will be used next,
* so that the printer can start preheating the tool in advance.
*
* ## Parameters
* - `P` - <number> - time in seconds till the temperature S is required (in standard mode)
* - `Q` - <number> - time in seconds till the temperature S is required (in stealth mode)
* The rest is same as M104
*/
if (this->m_is_XL_printer) {
std::string out = "M104.1 T" + std::to_string(tool_number);
if (time_diffs.size() > 0)
out += " P" + std::to_string(int(std::round(time_diffs[0])));
if (time_diffs.size() > 1)
out += " Q" + std::to_string(int(std::round(time_diffs[1])));
out += " S" + std::to_string(temperature) + "\n";
return out;
} else {
std::string comment = "preheat T" + std::to_string(tool_number) +
" time: " + std::to_string((int) std::round(time_diffs[0])) + "s";
return GCodeWriter::set_temperature(temperature, this->m_flavor, false, tool_number, comment);
}
},
// line replacer
[this, tool_number](const std::string& line) {
if (GCodeReader::GCodeLine::cmd_is(line, "M104")) {
GCodeReader::GCodeLine gline;
GCodeReader reader;
reader.parse_line(line, [&gline](GCodeReader& reader, const GCodeReader::GCodeLine& l) { gline = l; });
float val;
if (gline.has_value('T', val) && gline.raw().find("cooldown") != std::string::npos) {
if (static_cast<int>(val) == tool_number)
return std::string("; removed M104\n");
export_lines.insert_lines(
backtrace, cmd,
// line inserter
[tool_number, this](unsigned int id, const std::vector<float>& time_diffs) {
const int temperature = int(m_layer_id != 1 ? m_extruder_temps_config[tool_number] :
m_extruder_temps_first_layer_config[tool_number]);
// Orca: M104.1 for XL printers, I can't find the documentation for this so I copied the C++ comments from
// Prusa-Firmware-Buddy here
/**
* M104.1: Early Set Hotend Temperature (preheat, and with stealth mode support)
*
* This GCode is used to tell the XL printer the time estimate when a tool will be used next,
* so that the printer can start preheating the tool in advance.
*
* ## Parameters
* - `P` - <number> - time in seconds till the temperature S is required (in standard mode)
* - `Q` - <number> - time in seconds till the temperature S is required (in stealth mode)
* The rest is same as M104
*/
if (this->m_is_XL_printer) {
std::string out = "M104.1 T" + std::to_string(tool_number);
if (time_diffs.size() > 0)
out += " P" + std::to_string(int(std::round(time_diffs[0])));
if (time_diffs.size() > 1)
out += " Q" + std::to_string(int(std::round(time_diffs[1])));
out += " S" + std::to_string(temperature) + "\n";
return out;
} else {
std::string comment = "preheat T" + std::to_string(tool_number) +
" time: " + std::to_string((int) std::round(time_diffs[0])) + "s";
return GCodeWriter::set_temperature(temperature, this->m_flavor, false, tool_number, comment);
}
},
// line replacer
[this, tool_number](const std::string& line) {
if (GCodeReader::GCodeLine::cmd_is(line, "M104")) {
GCodeReader::GCodeLine gline;
GCodeReader reader;
reader.parse_line(line, [&gline](GCodeReader& reader, const GCodeReader::GCodeLine& l) { gline = l; });
float val;
if (gline.has_value('T', val) && gline.raw().find("cooldown") != std::string::npos) {
if (static_cast<int>(val) == tool_number)
return std::string("; removed M104\n");
}
}
return line;
}
return line;
});
);
}
}
};
+18 -18
View File
@@ -1601,24 +1601,20 @@ void WipeTower2::save_on_last_wipe()
auto& toolchange = m_layer_info->tool_changes[i];
tool_change(toolchange.new_tool);
// Orca: allow calculation of the required depth and wipe volume for soluable toolchanges as well
// NOTE: it's not clear if this is the right way, technically we should disable wipe tower if soluble filament is used as it
// will will make the wipe tower unstable. Need to revist this in the future.
if (i == idx) {
float width = m_wipe_tower_width - 3*m_perimeter_width; // width we draw into
// if (i == idx) {
float width = m_wipe_tower_width - 3*m_perimeter_width; // width we draw into
float volume_to_save = length_to_volume(finish_layer().total_extrusion_length_in_plane(), m_perimeter_width, m_layer_info->height);
float volume_left_to_wipe = std::max(m_filpar[toolchange.new_tool].filament_minimal_purge_on_wipe_tower, toolchange.wipe_volume_total - volume_to_save);
float volume_we_need_depth_for = std::max(0.f, volume_left_to_wipe - length_to_volume(toolchange.first_wipe_line, m_perimeter_width*m_extra_flow, m_layer_info->height));
float depth_to_wipe = get_wipe_depth(volume_we_need_depth_for, m_layer_info->height, m_perimeter_width, m_extra_flow, m_extra_spacing_wipe, width);
float volume_to_save = length_to_volume(finish_layer().total_extrusion_length_in_plane(), m_perimeter_width, m_layer_info->height);
float volume_left_to_wipe = std::max(m_filpar[toolchange.new_tool].filament_minimal_purge_on_wipe_tower, toolchange.wipe_volume_total - volume_to_save);
float volume_we_need_depth_for = std::max(0.f, volume_left_to_wipe - length_to_volume(toolchange.first_wipe_line, m_perimeter_width*m_extra_flow, m_layer_info->height));
float depth_to_wipe = get_wipe_depth(volume_we_need_depth_for, m_layer_info->height, m_perimeter_width, m_extra_flow, m_extra_spacing_wipe, width);
toolchange.required_depth = toolchange.ramming_depth + depth_to_wipe;
toolchange.wipe_volume = volume_left_to_wipe;
// }
toolchange.required_depth = toolchange.ramming_depth + depth_to_wipe;
toolchange.wipe_volume = volume_left_to_wipe;
}
}
}
}
}
// Return index of first toolchange that switches to non-soluble extruder
@@ -1626,10 +1622,14 @@ void WipeTower2::save_on_last_wipe()
int WipeTower2::first_toolchange_to_nonsoluble(
const std::vector<WipeTowerInfo::ToolChange>& tool_changes) const
{
for (size_t idx=0; idx<tool_changes.size(); ++idx)
if (! m_filpar[tool_changes[idx].new_tool].is_soluble)
return idx;
return -1;
// Orca: allow calculation of the required depth and wipe volume for soluable toolchanges as well
// NOTE: it's not clear if this is the right way, technically we should disable wipe tower if soluble filament is used as it
// will will make the wipe tower unstable. Need to revist this in the future.
return tool_changes.empty() ? -1 : 0;
//for (size_t idx=0; idx<tool_changes.size(); ++idx)
// if (! m_filpar[tool_changes[idx].new_tool].is_soluble)
// return idx;
//return -1;
}
static WipeTower::ToolChangeResult merge_tcr(WipeTower::ToolChangeResult& first,
+13 -4
View File
@@ -37,6 +37,7 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config)
if (use_mach_limits) {
m_max_jerk_x = std::lrint(print_config.machine_max_jerk_x.values.front());
m_max_jerk_y = std::lrint(print_config.machine_max_jerk_y.values.front());
m_max_junction_deviation = (print_config.machine_max_junction_deviation.values.front());
};
m_max_jerk_z = print_config.machine_max_jerk_z.values.front();
m_max_jerk_e = print_config.machine_max_jerk_e.values.front();
@@ -315,14 +316,22 @@ std::string GCodeWriter::set_accel_and_jerk(unsigned int acceleration, double je
std::string GCodeWriter::set_junction_deviation(double junction_deviation){
std::ostringstream gcode;
if (FLAVOR_IS_NOT(gcfMarlinFirmware)) {
throw std::runtime_error("Junction deviation is only supported by Marlin firmware");
if (FLAVOR_IS(gcfMarlinFirmware) && junction_deviation > 0 && m_max_junction_deviation > 0) {
// Clamp the junction deviation to the allowed maximum.
gcode << "M205 J";
if (junction_deviation <= m_max_junction_deviation) {
gcode << std::fixed << std::setprecision(3) << junction_deviation;
} else {
gcode << std::fixed << std::setprecision(3) << m_max_junction_deviation;
}
if (GCodeWriter::full_gcode_comment) {
gcode << " ; Junction Deviation";
}
gcode << "\n";
}
gcode << "M205 J" << std::fixed << std::setprecision(3) << junction_deviation << " ; Junction Deviation\n";
return gcode.str();
}
std::string GCodeWriter::set_pressure_advance(double pa) const
{
std::ostringstream gcode;
+1
View File
@@ -138,6 +138,7 @@ public:
double m_last_jerk;
double m_max_jerk_z;
double m_max_jerk_e;
double m_max_junction_deviation;
unsigned int m_travel_acceleration;
unsigned int m_travel_jerk;
+2 -1
View File
@@ -822,7 +822,7 @@ static std::vector<std::string> s_Preset_print_options {
"wall_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle",
"wall_distribution_count", "min_feature_size", "min_bead_width", "post_process", "min_length_factor",
"small_perimeter_speed", "small_perimeter_threshold","bridge_angle","internal_bridge_angle", "filter_out_gap_fill", "travel_acceleration","inner_wall_acceleration", "min_width_top_surface",
"default_jerk", "outer_wall_jerk", "inner_wall_jerk", "infill_jerk", "top_surface_jerk", "initial_layer_jerk","travel_jerk",
"default_jerk", "outer_wall_jerk", "inner_wall_jerk", "infill_jerk", "top_surface_jerk", "initial_layer_jerk","travel_jerk","default_junction_deviation",
"top_solid_infill_flow_ratio","bottom_solid_infill_flow_ratio","only_one_wall_first_layer", "print_flow_ratio", "seam_gap",
"role_based_wipe_speed", "wipe_speed", "accel_to_decel_enable", "accel_to_decel_factor", "wipe_on_loops", "wipe_before_external_loop",
"bridge_density","internal_bridge_density", "precise_outer_wall", "overhang_speed_classic", "bridge_acceleration",
@@ -875,6 +875,7 @@ static std::vector<std::string> s_Preset_machine_limits_options {
"machine_max_speed_x", "machine_max_speed_y", "machine_max_speed_z", "machine_max_speed_e",
"machine_min_extruding_rate", "machine_min_travel_rate",
"machine_max_jerk_x", "machine_max_jerk_y", "machine_max_jerk_z", "machine_max_jerk_e",
"machine_max_junction_deviation",
};
static std::vector<std::string> s_Preset_printer_options {
+11
View File
@@ -1516,6 +1516,17 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
}
}
// check junction deviation
const auto max_junction_deviation = m_config.machine_max_junction_deviation.values[0];
if (warning_key.empty() && m_default_object_config.default_junction_deviation.value > max_junction_deviation) {
warning->string = L( "Junction deviation setting exceeds the printer's maximum value "
"(machine_max_junction_deviation).\nOrca will "
"automatically cap the junction deviation to ensure it doesn't surpass the printer's "
"capabilities.\nYou can adjust the "
"machine_max_junction_deviation value in your printer's configuration to get higher limits.");
warning->opt_key = warning_key;
}
// check acceleration
const auto max_accel = m_config.machine_max_acceleration_extruding.values[0];
if (warning_key.empty() && m_default_object_config.default_acceleration > 0 && max_accel > 0) {
+19 -2
View File
@@ -2553,6 +2553,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("default_junction_deviation", coFloat);
def->label = L("Junction Deviation");
def->tooltip = L("Marlin Firmware Junction Deviation (replaces the traditional XY Jerk setting)");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("outer_wall_jerk", coFloat);
def->label = L("Outer wall");
def->tooltip = L("Jerk of outer walls");
@@ -3352,8 +3360,8 @@ void PrintConfigDef::init_fff_params()
def->tooltip = L(
"Flow Compensation Model, used to adjust the flow for small infill "
"areas. The model is expressed as a comma separated pair of values for "
"extrusion length and flow correction factors, one per line, in the "
"following format: \"1.234,5.678\"");
"extrusion length and flow correction factor. Each pair is on a "
"separate line, followed by a semicolon, in the following format: \"1.234, 5.678;\"");
def->mode = comAdvanced;
def->gui_flags = "serialized";
def->multiline = true;
@@ -3437,6 +3445,15 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionFloats(axis.max_jerk));
}
}
// M205 J... [mm] machine junction deviation limits
def = this->add("machine_max_junction_deviation", coFloats);
def->full_label = L("Maximum Junction Deviation");
def->category = L("Machine limits");
def->tooltip = L("Maximum junction deviation (M205 J, only apply if JD > 0 for Marlin Firmware)");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats{0. ,0. });
// M205 S... [mm/sec]
def = this->add("machine_min_extruding_rate", coFloats);
+3
View File
@@ -899,6 +899,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, initial_layer_jerk))
((ConfigOptionFloat, travel_jerk))
((ConfigOptionBool, precise_z_height))
((ConfigOptionFloat, default_junction_deviation))
((ConfigOptionBool, interlocking_beam))
((ConfigOptionFloat,interlocking_beam_width))
@@ -1070,6 +1071,8 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloats, machine_max_jerk_y))
((ConfigOptionFloats, machine_max_jerk_z))
((ConfigOptionFloats, machine_max_jerk_e))
// M205 J... [mm]
((ConfigOptionFloats, machine_max_junction_deviation))
// M205 T... [mm/sec]
((ConfigOptionFloats, machine_min_travel_rate))
// M205 S... [mm/sec]
+1 -5
View File
@@ -648,13 +648,9 @@ void Bed3D::update_bed_triangles()
(*model_offset_ptr)(1) = m_build_volume.bounding_volume2d().min.y() - bed_ext.min.y();
(*model_offset_ptr)(2) = -0.41 + GROUND_Z;
// ORCA fix for non-rectangular bed (without 3D model) beds rendered with shifted position
// TODO: FIXME: Is this ever needed?
//Vec2d point_shift = m_build_volume.type() == BuildVolume_Type::Circle ? Vec2d(0,0) : m_bed_shape[0];
Vec2d point_shift(0, 0);
std::vector<Vec2d> origin_bed_shape;
for (size_t i = 0; i < m_bed_shape.size(); i++) {
origin_bed_shape.push_back(m_bed_shape[i] - point_shift);
origin_bed_shape.push_back(m_bed_shape[i]);
}
std::vector<Vec2d> new_bed_shape; // offset to correct origin
for (auto point : origin_bed_shape) {
+2
View File
@@ -563,6 +563,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
for (auto el : { "outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk", "top_surface_jerk", "travel_jerk", "infill_jerk"})
toggle_field(el, have_default_jerk);
toggle_line("default_junction_deviation", gcflavor == gcfMarlinFirmware);
bool have_skirt = config->opt_int("skirt_loops") > 0;
toggle_field("skirt_height", have_skirt && config->opt_enum<DraftShield>("draft_shield") != dsEnabled);
toggle_line("single_loop_draft_shield", have_skirt); // ORCA: Display one wall if skirt enabled
+13 -13
View File
@@ -38,7 +38,7 @@
namespace Slic3r {
namespace GUI {
static const std::vector<std::string> filament_vendors =
static const std::vector<std::string> filament_vendors =
{"3Dgenius", "3DJake", "3DXTECH", "3D BEST-Q", "3D Hero",
"3D-Fuel", "Aceaddity", "AddNorth", "Amazon Basics", "AMOLEN",
"Ankermake", "Anycubic", "Atomic", "AzureFilm", "BASF",
@@ -47,18 +47,18 @@ static const std::vector<std::string> filament_vendors =
"CERPRiSE", "Das Filament", "DO3D", "DOW", "DSM",
"Duramic", "ELEGOO", "Eryone", "Essentium", "eSUN",
"Extrudr", "Fiberforce", "Fiberlogy", "FilaCube", "Filamentive",
"Fillamentum", "FLASHFORGE", "Formfutura", "Francofil", "FilamentOne",
"Fil X", "GEEETECH", "Giantarm", "Gizmo Dorks", "GreenGate3D",
"HATCHBOX", "Hello3D", "IC3D", "IEMAI", "IIID Max",
"INLAND", "iProspect", "iSANMATE", "Justmaker", "Keene Village Plastics",
"Kexcelled", "LDO", "MakerBot", "MatterHackers", "MIKA3D",
"NinjaTek", "Nobufil", "Novamaker", "OVERTURE", "OVVNYXE",
"Polymaker", "Priline", "Printed Solid", "Protopasta", "Prusament",
"Push Plastic", "R3D", "Re-pet3D", "Recreus", "Regen",
"RatRig", "Sain SMART", "SliceWorx", "Snapmaker", "SnoLabs",
"Spectrum", "SUNLU", "TTYT3D", "Tianse", "UltiMaker",
"Valment", "Verbatim", "VO3D", "Voxelab", "VOXELPLA",
"YOOPAI", "Yousu", "Ziro", "Zyltech"};
"Fillamentum", "FLASHFORGE", "Formfutura", "Francofil", "FusRock",
"FilamentOne", "Fil X", "GEEETECH", "Giantarm", "Gizmo Dorks",
"GreenGate3D", "HATCHBOX", "Hello3D", "IC3D", "IEMAI",
"IIID Max", "INLAND", "iProspect", "iSANMATE", "Justmaker",
"Keene Village Plastics", "Kexcelled", "LDO", "MakerBot", "MatterHackers",
"MIKA3D", "NinjaTek", "Nobufil", "Novamaker", "OVERTURE",
"OVVNYXE", "Polymaker", "Priline", "Printed Solid", "Protopasta",
"Prusament", "Push Plastic", "R3D", "Re-pet3D", "Recreus",
"Regen", "RatRig", "Sain SMART", "SliceWorx", "Snapmaker",
"SnoLabs", "Spectrum", "SUNLU", "TTYT3D", "Tianse",
"UltiMaker", "Valment", "Verbatim", "VO3D", "Voxelab",
"VOXELPLA", "YOOPAI", "Yousu", "Ziro", "Zyltech"};
static const std::vector<std::string> filament_types = {"PLA", "rPLA", "PLA+", "PLA Tough", "PETG", "ABS", "ASA", "FLEX", "HIPS", "PA", "PACF",
"NYLON", "PVA", "PVB", "PC", "PCABS", "PCTG", "PCCF", "PHA", "PP", "PEI", "PET",
+4 -31
View File
@@ -476,35 +476,8 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox
step = static_cast<int>(grid_counts.minCoeff() + 1) * 10;
}
if (0) {
for (coord_t x = pp_bbox.min(0); x <= pp_bbox.max(0); x += scale_(step)) {
Polyline line;
line.append(Point(x, pp_bbox.min(1)));
line.append(Point(x, pp_bbox.max(1)));
if ( (count % 5) == 0 )
axes_lines_bolder.push_back(line);
else
axes_lines.push_back(line);
count ++;
}
count = 0;
for (coord_t y = pp_bbox.min(1); y <= pp_bbox.max(1); y += scale_(step)) {
Polyline line;
line.append(Point(pp_bbox.min(0), y));
line.append(Point(pp_bbox.max(0), y));
axes_lines.push_back(line);
if ( (count % 5) == 0 )
axes_lines_bolder.push_back(line);
else
axes_lines.push_back(line);
count ++;
}
}
// ORCA draw grid lines relative to origin
for (coord_t x = m_origin.x(); x >= pp_bbox.min(0); x -= scale_(step)) { // Negative X axis
for (coord_t x = scale_(m_origin.x()); x >= pp_bbox.min(0); x -= scale_(step)) { // Negative X axis
(count % 5 == 0 ? axes_lines_bolder : axes_lines).push_back(Polyline(
Point(x, pp_bbox.min(1)),
Point(x, pp_bbox.max(1))
@@ -512,7 +485,7 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox
count ++;
}
count = 0;
for (coord_t x = m_origin.x(); x <= pp_bbox.max(0); x += scale_(step)) { // Positive X axis
for (coord_t x = scale_(m_origin.x()); x <= pp_bbox.max(0); x += scale_(step)) { // Positive X axis
(count % 5 == 0 ? axes_lines_bolder : axes_lines).push_back(Polyline(
Point(x, pp_bbox.min(1)),
Point(x, pp_bbox.max(1))
@@ -520,7 +493,7 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox
count ++;
}
count = 0;
for (coord_t y = m_origin.y(); y >= pp_bbox.min(1); y -= scale_(step)) { // Negative Y axis
for (coord_t y = scale_(m_origin.y()); y >= pp_bbox.min(1); y -= scale_(step)) { // Negative Y axis
(count % 5 == 0 ? axes_lines_bolder : axes_lines).push_back(Polyline(
Point(pp_bbox.min(0), y),
Point(pp_bbox.max(0), y)
@@ -528,7 +501,7 @@ void PartPlate::calc_gridlines(const ExPolygon& poly, const BoundingBox& pp_bbox
count ++;
}
count = 0;
for (coord_t y = m_origin.y(); y <= pp_bbox.max(1); y += scale_(step)) { // Positive Y axis
for (coord_t y = scale_(m_origin.y()); y <= pp_bbox.max(1); y += scale_(step)) { // Positive Y axis
(count % 5 == 0 ? axes_lines_bolder : axes_lines).push_back(Polyline(
Point(pp_bbox.min(0), y),
Point(pp_bbox.max(0), y)
+10 -1
View File
@@ -999,7 +999,7 @@ Sidebar::Sidebar(Plater *parent)
}
ams_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "ams_fila_sync", wxEmptyString, wxDefaultSize, wxDefaultPosition,
wxBU_EXACTFIT | wxNO_BORDER, false, 18);
wxBU_EXACTFIT | wxNO_BORDER, false, 16); // ORCA match icon size with other icons as 16x16
ams_btn->SetToolTip(_L("Synchronize filament list from AMS"));
ams_btn->Bind(wxEVT_BUTTON, [this, scrolled_sizer](wxCommandEvent &e) {
sync_ams_list();
@@ -10208,6 +10208,8 @@ void Plater::calib_input_shaping_freq(const Calib_Params& params)
add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.stl" : "/calib/input_shaping/fast_tower_test.stl"));
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
printer_config->set_key_value("machine_max_junction_deviation", new ConfigOptionFloats {0.3});
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats { 0.0 });
filament_config->set_key_value("slow_down_min_speed", new ConfigOptionFloats { 0.0 });
filament_config->set_key_value("slow_down_for_layer_cooling", new ConfigOptionBools{false});
@@ -10228,6 +10230,7 @@ void Plater::calib_input_shaping_freq(const Calib_Params& params)
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloat(200));
print_config->set_key_value("default_acceleration", new ConfigOptionFloat(2000));
print_config->set_key_value("outer_wall_acceleration", new ConfigOptionFloat(2000));
print_config->set_key_value("default_junction_deviation", new ConfigOptionFloat(0.25));
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
model().objects[0]->config.set_key_value("brim_object_gap", new ConfigOptionFloat(0.0));
@@ -10252,6 +10255,8 @@ void Plater::calib_input_shaping_damp(const Calib_Params& params)
add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.stl" : "/calib/input_shaping/fast_tower_test.stl"));
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
printer_config->set_key_value("machine_max_junction_deviation", new ConfigOptionFloats{0.3});
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats { 0.0 });
filament_config->set_key_value("slow_down_min_speed", new ConfigOptionFloats { 0.0 });
filament_config->set_key_value("slow_down_for_layer_cooling", new ConfigOptionBools{false});
@@ -10272,6 +10277,7 @@ void Plater::calib_input_shaping_damp(const Calib_Params& params)
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloat(200));
print_config->set_key_value("default_acceleration", new ConfigOptionFloat(2000));
print_config->set_key_value("outer_wall_acceleration", new ConfigOptionFloat(2000));
print_config->set_key_value("default_junction_deviation", new ConfigOptionFloat(0.25));
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
model().objects[0]->config.set_key_value("brim_object_gap", new ConfigOptionFloat(0.0));
@@ -10296,6 +10302,8 @@ void Plater::calib_junction_deviation(const Calib_Params& params)
add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.stl" : "/calib/input_shaping/fast_tower_test.stl"));
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
printer_config->set_key_value("machine_max_junction_deviation", new ConfigOptionFloats{1.0});
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats { 0.0 });
filament_config->set_key_value("slow_down_min_speed", new ConfigOptionFloats { 0.0 });
filament_config->set_key_value("slow_down_for_layer_cooling", new ConfigOptionBools{false});
@@ -10316,6 +10324,7 @@ void Plater::calib_junction_deviation(const Calib_Params& params)
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloat(200));
print_config->set_key_value("default_acceleration", new ConfigOptionFloat(2000));
print_config->set_key_value("outer_wall_acceleration", new ConfigOptionFloat(2000));
print_config->set_key_value("default_junction_deviation", new ConfigOptionFloat(0.0));
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
model().objects[0]->config.set_key_value("brim_object_gap", new ConfigOptionFloat(0.0));
+84 -20
View File
@@ -793,6 +793,42 @@ void Tab::decorate()
tt = &m_tt_white_bullet;
}
if (opt.first == "compatible_prints" || opt.first == "compatible_printers") {
bool sys_page = true;
bool modified_page = false;
if (m_type == Slic3r::Preset::TYPE_PRINTER) {
sys_page = m_presets->get_selected_preset_parent() != nullptr;
modified_page = false;
} else {
if (opt.first == "compatible_prints") {
get_sys_and_mod_flags("compatible_prints", sys_page, modified_page);
// Don't call for "compatible_printers"
} else if (opt.first == "compatible_printers") {
get_sys_and_mod_flags("compatible_printers", sys_page, modified_page);
if (m_type == Slic3r::Preset::TYPE_FILAMENT || m_type == Slic3r::Preset::TYPE_SLA_MATERIAL) {
get_sys_and_mod_flags("compatible_prints", sys_page, modified_page);
}
}
}
if (!sys_page) {
is_nonsys_value = true;
sys_icon = m_bmp_non_system;
sys_tt = m_tt_non_system;
if (!modified_page)
color = &m_default_text_clr;
else
color = &m_modified_label_clr;
}
if (!modified_page) {
is_modified_value = false;
icon = &m_bmp_white_bullet;
tt = &m_tt_white_bullet;
}
}
if (option_without_field) {
if (Line* line = get_line(opt.first)) {
line->set_undo_bitmap(icon);
@@ -945,9 +981,20 @@ void Tab::get_sys_and_mod_flags(const std::string& opt_key, bool& sys_page, bool
auto opt = m_options_list.find(opt_key);
if (opt == m_options_list.end())
return;
// If the value is empty, clear the system flag
if (opt_key == "compatible_printers" || opt_key == "compatible_prints") {
auto* compatible_values = m_config->option<ConfigOptionStrings>(opt_key);
if (compatible_values && compatible_values->values.empty()) {
sys_page = false; // Empty value should NOT be treated as a system value
}
} else if (sys_page) {
sys_page = (opt->second & osSystemValue) != 0;
}
if (sys_page) sys_page = (opt->second & osSystemValue) != 0;
modified_page |= (opt->second & osInitValue) == 0;
//if (sys_page) sys_page = (opt->second & osSystemValue) != 0;
//modified_page |= (opt->second & osInitValue) == 0;
}
void Tab::update_changed_tree_ui()
@@ -1068,22 +1115,10 @@ void Tab::on_roll_back_value(const bool to_sys /*= true*/)
if (m_type != Preset::TYPE_PRINTER && (m_options_list["compatible_printers"] & os) == 0) {
to_sys ? group->back_to_sys_value("compatible_printers") : group->back_to_initial_value("compatible_printers");
load_key_value("compatible_printers", true/*some value*/, true);
if (m_compatible_printers.checkbox) {
bool is_empty = m_config->option<ConfigOptionStrings>("compatible_printers")->values.empty();
m_compatible_printers.checkbox->SetValue(is_empty);
is_empty ? m_compatible_printers.btn->Disable() : m_compatible_printers.btn->Enable();
}
}
if ((m_type == Preset::TYPE_FILAMENT || m_type == Preset::TYPE_SLA_MATERIAL) && (m_options_list["compatible_prints"] & os) == 0) {
to_sys ? group->back_to_sys_value("compatible_prints") : group->back_to_initial_value("compatible_prints");
load_key_value("compatible_prints", true/*some value*/, true);
if (m_compatible_prints.checkbox) {
bool is_empty = m_config->option<ConfigOptionStrings>("compatible_prints")->values.empty();
m_compatible_prints.checkbox->SetValue(is_empty);
is_empty ? m_compatible_prints.btn->Disable() : m_compatible_prints.btn->Enable();
}
}
}
for (const auto &kvp : group->opt_map()) {
@@ -1106,6 +1141,17 @@ void Tab::on_roll_back_value(const bool to_sys /*= true*/)
// BBS: restore all pages in preset, update_dirty also update combobox
update_dirty();
if (m_compatible_printers.checkbox) {
bool is_empty = m_config->option<ConfigOptionStrings>("compatible_printers")->values.empty();
m_compatible_printers.checkbox->SetValue(is_empty);
is_empty ? m_compatible_printers.btn->Disable() : m_compatible_printers.btn->Enable();
}
if (m_compatible_prints.checkbox) {
bool is_empty = m_config->option<ConfigOptionStrings>("compatible_prints")->values.empty();
m_compatible_prints.checkbox->SetValue(is_empty);
is_empty ? m_compatible_prints.btn->Disable() : m_compatible_prints.btn->Enable();
}
m_page_view->GetParent()->Layout();
}
@@ -2198,6 +2244,7 @@ void TabPrint::build()
optgroup->append_single_option_line("top_surface_jerk");
optgroup->append_single_option_line("initial_layer_jerk");
optgroup->append_single_option_line("travel_jerk");
optgroup->append_single_option_line("default_junction_deviation");
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced", 15);
optgroup->append_single_option_line("max_volumetric_extrusion_rate_slope", "extrusion-rate-smoothing");
@@ -2281,13 +2328,13 @@ void TabPrint::build()
optgroup->append_single_option_line("wipe_tower_no_sparse_layers");
optgroup->append_single_option_line("single_extruder_multi_material_priming");
optgroup = page->new_optgroup(L("Filament for Features"));
optgroup = page->new_optgroup(L("Filament for Features"), L"param_filament_for_features");
optgroup->append_single_option_line("wall_filament");
optgroup->append_single_option_line("sparse_infill_filament");
optgroup->append_single_option_line("solid_infill_filament");
optgroup->append_single_option_line("wipe_tower_filament");
optgroup = page->new_optgroup(L("Ooze prevention"));
optgroup = page->new_optgroup(L("Ooze prevention"), L"param_ooze_prevention");
optgroup->append_single_option_line("ooze_prevention");
optgroup->append_single_option_line("standby_temperature_delta");
optgroup->append_single_option_line("preheat_time");
@@ -2375,8 +2422,8 @@ page = add_options_page(L("Others"), "custom-gcode_other"); // ORCA: icon only v
optgroup->append_single_option_line(option);
// Orca: hide the dependencies tab for process for now. The UI is not ready yet.
// page = add_options_page(L("Dependencies"), "custom-gcode_advanced");
// optgroup = page->new_optgroup(L("Profile dependencies"));
// page = add_options_page(L("Dependencies"), "param_profile_dependencies"); // icons ready
// optgroup = page->new_optgroup(L("Profile dependencies"), "param_profile_dependencies"); // icons ready
// create_line_with_widget(optgroup.get(), "compatible_printers", "", [this](wxWindow* parent) {
// return compatible_widget_create(parent, m_compatible_printers);
@@ -3299,7 +3346,7 @@ void TabFilament::build()
};
// Orca: New section to focus on flow rate and PA to declutter general section
optgroup = page->new_optgroup(L("Flow ratio and Pressure Advance"), L"param_information");
optgroup = page->new_optgroup(L("Flow ratio and Pressure Advance"), L"param_flow_ratio_and_pressure_advance");
optgroup->append_single_option_line("pellet_flow_coefficient", "pellet-flow-coefficient");
optgroup->append_single_option_line("filament_flow_ratio");
@@ -3515,7 +3562,7 @@ void TabFilament::build()
return sizer;
});
optgroup = page->new_optgroup(L("Toolchange parameters with multi extruder MM printers"));
optgroup = page->new_optgroup(L("Toolchange parameters with multi extruder MM printers"), "param_toolchange_multi_extruder");
optgroup->append_single_option_line("filament_multitool_ramming");
optgroup->append_single_option_line("filament_multitool_ramming_volume");
optgroup->append_single_option_line("filament_multitool_ramming_flow");
@@ -4122,6 +4169,8 @@ PageShp TabPrinter::build_kinematics_page()
append_option_line(optgroup, "machine_max_jerk_" + axis);
}
// machine max junction deviation
append_option_line(optgroup, "machine_max_junction_deviation");
//optgroup = page->new_optgroup(L("Minimum feedrates"));
// append_option_line(optgroup, "machine_min_extruding_rate");
// append_option_line(optgroup, "machine_min_travel_rate");
@@ -4634,6 +4683,9 @@ void TabPrinter::toggle_options()
for (int i = 0; i < max_field; ++i)
toggle_option("machine_max_acceleration_travel", gcf != gcfMarlinLegacy && gcf != gcfKlipper, i);
toggle_line("machine_max_acceleration_travel", gcf != gcfMarlinLegacy && gcf != gcfKlipper);
for (int i = 0; i < max_field; ++i)
toggle_option("machine_max_junction_deviation", gcf == gcfMarlinFirmware, i);
toggle_line("machine_max_junction_deviation", gcf == gcfMarlinFirmware);
}
}
@@ -5868,12 +5920,24 @@ wxSizer* Tab::compatible_widget_create(wxWindow* parent, PresetDependencies &dep
{
deps.btn->Enable(! deps.checkbox->GetValue());
// All printers have been made compatible with this preset.
if (deps.checkbox->GetValue())
if (deps.checkbox->GetValue())
this->load_key_value(deps.key_list, std::vector<std::string> {});
this->get_field(deps.key_condition)->toggle(deps.checkbox->GetValue());
this->update_changed_ui();
}) );
if (m_compatible_printers.checkbox) {
bool is_empty = m_config->option<ConfigOptionStrings>("compatible_printers")->values.empty();
m_compatible_printers.checkbox->SetValue(is_empty);
is_empty ? m_compatible_printers.btn->Disable() : m_compatible_printers.btn->Enable();
}
if (m_compatible_prints.checkbox) {
bool is_empty = m_config->option<ConfigOptionStrings>("compatible_prints")->values.empty();
m_compatible_prints.checkbox->SetValue(is_empty);
is_empty ? m_compatible_prints.btn->Disable() : m_compatible_prints.btn->Enable();
}
deps.btn->Bind(wxEVT_BUTTON, ([this, parent, &deps](wxCommandEvent e)
{
// Collect names of non-default non-external profiles.
+1 -1
View File
@@ -23,7 +23,7 @@ namespace Slic3r { namespace GUI {
m_printing_img = ScalableBitmap(this, "printer", 16);
m_arrow_img = ScalableBitmap(this, "monitor_arrow", 14);
m_none_printing_img = ScalableBitmap(this, "tab_monitor_active", 24);
m_none_printing_img = ScalableBitmap(this, "tab_monitor_active", 20); // ORCA match icon size with exact resolution to fix blurry icon
m_none_arrow_img = ScalableBitmap(this, "monitor_none_arrow", 14);
m_none_add_img = ScalableBitmap(this, "monitor_none_add", 14);
-1
View File
@@ -1159,7 +1159,6 @@ void Junction_Deviation_Test_Dlg::on_start(wxCommandEvent& event) {
} else if (m_params.end > 0.3) {
MessageDialog msg_dlg(nullptr, _L("NOTE: High values may cause Layer shift"), wxEmptyString, wxICON_WARNING | wxOK);
msg_dlg.ShowModal();
return;
}
m_params.mode = CalibMode::Calib_Junction_Deviation;
+5 -5
View File
@@ -169,12 +169,12 @@ namespace fts {
// Calculate score
if (matched) {
static constexpr int sequential_bonus = 15; // bonus for adjacent matches
static constexpr int separator_bonus = 10/*30*/; // bonus if match occurs after a separator
// static constexpr int camel_bonus = 30; // bonus if match is uppercase and prev is lower
static constexpr int first_letter_bonus = 15; // bonus if the first letter is matched
static constexpr int sequential_bonus = 75; // bonus for adjacent matches
static constexpr int separator_bonus = 10; // bonus if match occurs after a separator
// static constexpr int camel_bonus = 30; // bonus if match is uppercase and prev is lower
static constexpr int first_letter_bonus = -30; // bonus if the first letter is matched
static constexpr int leading_letter_penalty = -1/*-5*/; // penalty applied for every letter in str before the first match
static constexpr int leading_letter_penalty = -1; // penalty applied for every letter in str before the first match
static constexpr int max_leading_letter_penalty = -15; // maximum penalty for leading letters
static constexpr int unmatched_letter_penalty = -1; // penalty for every letter that doesn't matter