Merge branch 'main' into dev/bbs-measure
This commit is contained in:
@@ -6813,7 +6813,12 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string type = (volume->type() == ModelVolumeType::MODEL_PART)?"model":"other";
|
||||
// Orca#7574: always use "model" type to follow the 3MF Core Specification:
|
||||
// https://github.com/3MFConsortium/spec_core/blob/20c079eef39e45ed223b8443dc9f34cbe32dc2c2/3MF%20Core%20Specification.md#3431-item-element
|
||||
// > Note: items MUST NOT reference objects of type "other", either directly or recursively.
|
||||
// This won't break anything because when loading the file Orca (and Bambu) simply does not care about the actual object type at all (as long as it's one of "model" & "other");
|
||||
// But PrusaSlicer requires the type to be "model".
|
||||
std::string type = "model";
|
||||
|
||||
output_buffer += " <";
|
||||
output_buffer += OBJECT_TAG;
|
||||
|
||||
@@ -1898,36 +1898,42 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
if (!print.config().small_area_infill_flow_compensation_model.empty())
|
||||
m_small_area_infill_flow_compensator = make_unique<SmallAreaInfillFlowCompensator>(print.config());
|
||||
|
||||
|
||||
file.write_format("; HEADER_BLOCK_START\n");
|
||||
// Write information on the generator.
|
||||
file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str());
|
||||
if (is_bbl_printers)
|
||||
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str());
|
||||
//BBS: total layer number
|
||||
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Total_Layer_Number_Placeholder).c_str());
|
||||
m_enable_exclude_object = config().exclude_object;
|
||||
//Orca: extra check for bbl printer
|
||||
if (is_bbl_printers) {
|
||||
if (print.calib_params().mode == CalibMode::Calib_None) { // Don't support skipping in cali mode
|
||||
// list all label_object_id with sorted order here
|
||||
m_enable_exclude_object = true;
|
||||
m_label_objects_ids.clear();
|
||||
m_label_objects_ids.reserve(print.num_object_instances());
|
||||
for (const PrintObject *print_object : print.objects())
|
||||
for (const PrintInstance &print_instance : print_object->instances())
|
||||
m_label_objects_ids.push_back(print_instance.model_instance->get_labeled_id());
|
||||
|
||||
std::sort(m_label_objects_ids.begin(), m_label_objects_ids.end());
|
||||
|
||||
std::string objects_id_list = "; model label id: ";
|
||||
for (auto it = m_label_objects_ids.begin(); it != m_label_objects_ids.end(); it++)
|
||||
objects_id_list += (std::to_string(*it) + (it != m_label_objects_ids.end() - 1 ? "," : "\n"));
|
||||
file.writeln(objects_id_list);
|
||||
} else {
|
||||
m_enable_exclude_object = false;
|
||||
m_label_objects_ids.clear();
|
||||
}
|
||||
// Orca: Don't output Header block if BTT thumbnail is identified in the list
|
||||
// Get the thumbnails value as a string
|
||||
std::string thumbnails_value = print.config().option<ConfigOptionString>("thumbnails")->value;
|
||||
// search string for the BTT_TFT label
|
||||
bool has_BTT_thumbnail = (thumbnails_value.find("BTT_TFT") != std::string::npos);
|
||||
|
||||
if(!has_BTT_thumbnail){
|
||||
file.write_format("; HEADER_BLOCK_START\n");
|
||||
// Write information on the generator.
|
||||
file.write_format("; generated by %s on %s\n", Slic3r::header_slic3r_generated().c_str(), Slic3r::Utils::local_timestamp().c_str());
|
||||
if (is_bbl_printers)
|
||||
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str());
|
||||
//BBS: total layer number
|
||||
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Total_Layer_Number_Placeholder).c_str());
|
||||
m_enable_exclude_object = config().exclude_object;
|
||||
//Orca: extra check for bbl printer
|
||||
if (is_bbl_printers) {
|
||||
if (print.calib_params().mode == CalibMode::Calib_None) { // Don't support skipping in cali mode
|
||||
// list all label_object_id with sorted order here
|
||||
m_enable_exclude_object = true;
|
||||
m_label_objects_ids.clear();
|
||||
m_label_objects_ids.reserve(print.num_object_instances());
|
||||
for (const PrintObject *print_object : print.objects())
|
||||
for (const PrintInstance &print_instance : print_object->instances())
|
||||
m_label_objects_ids.push_back(print_instance.model_instance->get_labeled_id());
|
||||
|
||||
std::sort(m_label_objects_ids.begin(), m_label_objects_ids.end());
|
||||
|
||||
std::string objects_id_list = "; model label id: ";
|
||||
for (auto it = m_label_objects_ids.begin(); it != m_label_objects_ids.end(); it++)
|
||||
objects_id_list += (std::to_string(*it) + (it != m_label_objects_ids.end() - 1 ? "," : "\n"));
|
||||
file.writeln(objects_id_list);
|
||||
} else {
|
||||
m_enable_exclude_object = false;
|
||||
m_label_objects_ids.clear();
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1949,7 +1955,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
}
|
||||
|
||||
file.write_format("; HEADER_BLOCK_END\n\n");
|
||||
|
||||
}
|
||||
|
||||
// BBS: write global config at the beginning of gcode file because printer
|
||||
// need these config information
|
||||
@@ -5981,7 +5987,7 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string
|
||||
m_wipe.reset_path();*/
|
||||
|
||||
Point last_post_before_retract = this->last_pos();
|
||||
gcode += this->retract(false, false, lift_type);
|
||||
gcode += this->retract(false, false, lift_type, role);
|
||||
// When "Wipe while retracting" is enabled, then extruder moves to another position, and travel from this position can cross perimeters.
|
||||
// Because of it, it is necessary to call avoid crossing perimeters again with new starting point after calling retraction()
|
||||
// FIXME Lukas H.: Try to predict if this second calling of avoid crossing perimeters will be needed or not. It could save computations.
|
||||
@@ -6183,7 +6189,7 @@ bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role, LiftTyp
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType lift_type)
|
||||
std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType lift_type, ExtrusionRole role)
|
||||
{
|
||||
std::string gcode;
|
||||
|
||||
@@ -6201,7 +6207,8 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction, LiftType li
|
||||
(the extruder might be already retracted fully or partially). We call these
|
||||
methods even if we performed wipe, since this will ensure the entire retraction
|
||||
length is honored in case wipe path was too short. */
|
||||
gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract();
|
||||
if (role != erTopSolidInfill || EXTRUDER_CONFIG(retract_on_top_layer))
|
||||
gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract();
|
||||
|
||||
gcode += m_writer.reset_e();
|
||||
// Orca: check if should + can lift (roughly from SuperSlicer)
|
||||
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
|
||||
std::string travel_to(const Point& point, ExtrusionRole role, std::string comment, double z = DBL_MAX);
|
||||
bool needs_retraction(const Polyline& travel, ExtrusionRole role, LiftType& lift_type);
|
||||
std::string retract(bool toolchange = false, bool is_last_retraction = false, LiftType lift_type = LiftType::NormalLift);
|
||||
std::string retract(bool toolchange = false, bool is_last_retraction = false, LiftType lift_type = LiftType::NormalLift, ExtrusionRole role = erNone);
|
||||
std::string unretract() { return m_writer.unlift() + m_writer.unretract(); }
|
||||
std::string set_extruder(unsigned int extruder_id, double print_z, bool by_object=false);
|
||||
bool is_BBL_Printer();
|
||||
|
||||
@@ -98,6 +98,8 @@ const std::vector<std::string> GCodeProcessor::Reserved_Tags_compatible = {
|
||||
const std::string GCodeProcessor::Flush_Start_Tag = " FLUSH_START";
|
||||
const std::string GCodeProcessor::Flush_End_Tag = " FLUSH_END";
|
||||
|
||||
//Orca: External device purge tag
|
||||
const std::string GCodeProcessor::External_Purge_Tag = " EXTERNAL_PURGE";
|
||||
|
||||
const float GCodeProcessor::Wipe_Width = 0.05f;
|
||||
const float GCodeProcessor::Wipe_Height = 0.05f;
|
||||
@@ -2289,6 +2291,24 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
|
||||
m_flushing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Orca: Integrate filament consumption for purging performed to an external device and controlled via macros
|
||||
// (eg. Happy Hare) in the filament consumption stats.
|
||||
if (boost::starts_with(comment, GCodeProcessor::External_Purge_Tag)) {
|
||||
std::regex numberRegex(R"(\d+\.\d+)");
|
||||
std::smatch match;
|
||||
std::string line(comment);
|
||||
if (std::regex_search(line, match, numberRegex)) {
|
||||
float filament_diameter = (static_cast<size_t>(m_extruder_id) < m_result.filament_diameters.size()) ? m_result.filament_diameters[m_extruder_id] : m_result.filament_diameters.back();
|
||||
float filament_radius = 0.5f * filament_diameter;
|
||||
float area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
|
||||
|
||||
float dE = std::stof(match.str());
|
||||
float volume_extruded_filament = area_filament_cross_section * dE;
|
||||
m_used_filaments.update_flush_per_filament(m_extruder_id, volume_extruded_filament);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!producers_enabled || m_producer == EProducer::OrcaSlicer) {
|
||||
// height tag
|
||||
|
||||
@@ -272,6 +272,7 @@ class Print;
|
||||
static const std::vector<std::string> Reserved_Tags_compatible;
|
||||
static const std::string Flush_Start_Tag;
|
||||
static const std::string Flush_End_Tag;
|
||||
static const std::string External_Purge_Tag;
|
||||
public:
|
||||
enum class ETags : unsigned char
|
||||
{
|
||||
|
||||
@@ -1222,6 +1222,17 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
|
||||
smooth_overhang_level(paths);
|
||||
}
|
||||
|
||||
if (overhangs_reverse) {
|
||||
for (const ExtrusionPath& path : paths) {
|
||||
if (path.role() == erOverhangPerimeter) {
|
||||
if (pg_extrusion.is_contour)
|
||||
steep_overhang_contour = true;
|
||||
else
|
||||
steep_overhang_hole = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1851,6 +1851,26 @@ void PresetBundle::export_selections(AppConfig &config)
|
||||
}
|
||||
|
||||
// BBS
|
||||
void PresetBundle::set_num_filaments(unsigned int n, std::vector<std::string> new_colors) {
|
||||
int old_filament_count = this->filament_presets.size();
|
||||
if (n > old_filament_count && old_filament_count != 0)
|
||||
filament_presets.resize(n, filament_presets.back());
|
||||
else {
|
||||
filament_presets.resize(n);
|
||||
}
|
||||
ConfigOptionStrings* filament_color = project_config.option<ConfigOptionStrings>("filament_colour");
|
||||
filament_color->resize(n);
|
||||
ams_multi_color_filment.resize(n);
|
||||
// BBS set new filament color to new_color
|
||||
if (old_filament_count < n) {
|
||||
if (!new_colors.empty()) {
|
||||
for (int i = old_filament_count; i < n; i++) {
|
||||
filament_color->values[i] = new_colors[i - old_filament_count];
|
||||
}
|
||||
}
|
||||
}
|
||||
update_multi_material_filament_presets();
|
||||
}
|
||||
void PresetBundle::set_num_filaments(unsigned int n, std::string new_color)
|
||||
{
|
||||
int old_filament_count = this->filament_presets.size();
|
||||
|
||||
@@ -111,6 +111,7 @@ public:
|
||||
void export_selections(AppConfig &config);
|
||||
|
||||
// BBS
|
||||
void set_num_filaments(unsigned int n, std::vector<std::string> new_colors);
|
||||
void set_num_filaments(unsigned int n, std::string new_col = "");
|
||||
unsigned int sync_ams_list(unsigned int & unknowns);
|
||||
//BBS: check whether this is the only edited filament
|
||||
|
||||
@@ -148,6 +148,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
||||
"retraction_minimum_travel",
|
||||
"retract_before_wipe",
|
||||
"retract_when_changing_layer",
|
||||
"retract_on_top_layer",
|
||||
"retraction_length",
|
||||
"retract_length_toolchange",
|
||||
"z_hop",
|
||||
|
||||
@@ -3711,6 +3711,12 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBools { false });
|
||||
|
||||
def = this->add("retract_on_top_layer", coBools);
|
||||
def->label = L("Retract on top layer");
|
||||
def->tooltip = L("Force a retraction on top layer. Disabling could prevent clog on very slow patterns with small movements, like Hilbert curve");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBools { true });
|
||||
|
||||
def = this->add("retraction_length", coFloats);
|
||||
def->label = L("Length");
|
||||
def->full_label = L("Retraction Length");
|
||||
@@ -5371,7 +5377,7 @@ void PrintConfigDef::init_fff_params()
|
||||
// BBS: floats
|
||||
"wipe_distance",
|
||||
// bools
|
||||
"retract_when_changing_layer", "wipe",
|
||||
"retract_when_changing_layer", "retract_on_top_layer", "wipe",
|
||||
// percents
|
||||
"retract_before_wipe",
|
||||
"long_retractions_when_cut",
|
||||
@@ -5423,7 +5429,7 @@ void PrintConfigDef::init_extruder_option_keys()
|
||||
"nozzle_diameter", "min_layer_height", "max_layer_height", "extruder_offset",
|
||||
"retraction_length", "z_hop", "z_hop_types", "travel_slope", "retract_lift_above", "retract_lift_below", "retract_lift_enforce", "retraction_speed", "deretraction_speed",
|
||||
"retract_before_wipe", "retract_restart_extra", "retraction_minimum_travel", "wipe", "wipe_distance",
|
||||
"retract_when_changing_layer", "retract_length_toolchange", "retract_restart_extra_toolchange", "extruder_colour",
|
||||
"retract_when_changing_layer", "retract_on_top_layer", "retract_length_toolchange", "retract_restart_extra_toolchange", "extruder_colour",
|
||||
"default_filament_profile","retraction_distances_when_cut","long_retractions_when_cut"
|
||||
};
|
||||
|
||||
@@ -5436,6 +5442,7 @@ void PrintConfigDef::init_extruder_option_keys()
|
||||
"retract_lift_enforce",
|
||||
"retract_restart_extra",
|
||||
"retract_when_changing_layer",
|
||||
"retract_on_top_layer",
|
||||
"retraction_distances_when_cut",
|
||||
"retraction_length",
|
||||
"retraction_minimum_travel",
|
||||
@@ -5455,7 +5462,7 @@ void PrintConfigDef::init_filament_option_keys()
|
||||
"filament_diameter", "min_layer_height", "max_layer_height",
|
||||
"retraction_length", "z_hop", "z_hop_types", "retract_lift_above", "retract_lift_below", "retract_lift_enforce", "retraction_speed", "deretraction_speed",
|
||||
"retract_before_wipe", "retract_restart_extra", "retraction_minimum_travel", "wipe", "wipe_distance",
|
||||
"retract_when_changing_layer", "retract_length_toolchange", "retract_restart_extra_toolchange", "filament_colour",
|
||||
"retract_when_changing_layer", "retract_on_top_layer", "retract_length_toolchange", "retract_restart_extra_toolchange", "filament_colour",
|
||||
"default_filament_profile","retraction_distances_when_cut","long_retractions_when_cut"/*,"filament_seam_gap"*/
|
||||
};
|
||||
|
||||
@@ -5468,6 +5475,7 @@ void PrintConfigDef::init_filament_option_keys()
|
||||
"retract_lift_enforce",
|
||||
"retract_restart_extra",
|
||||
"retract_when_changing_layer",
|
||||
"retract_on_top_layer",
|
||||
"retraction_distances_when_cut",
|
||||
"retraction_length",
|
||||
"retraction_minimum_travel",
|
||||
|
||||
@@ -1239,6 +1239,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
||||
((ConfigOptionFloat, resolution))
|
||||
((ConfigOptionFloats, retraction_minimum_travel))
|
||||
((ConfigOptionBools, retract_when_changing_layer))
|
||||
((ConfigOptionBools, retract_on_top_layer))
|
||||
((ConfigOptionFloat, skirt_distance))
|
||||
((ConfigOptionInt, skirt_height))
|
||||
((ConfigOptionInt, skirt_loops))
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
||||
#include <tbb/parallel_for.h>
|
||||
#include <tbb/spin_mutex.h>
|
||||
|
||||
#include <Shiny/Shiny.h>
|
||||
|
||||
|
||||
@@ -1910,14 +1910,15 @@ static inline void improve_ordering_by_two_exchanges_with_segment_flipping(Polyl
|
||||
for (const FlipEdge &edge : edges) {
|
||||
Polyline &pl = polylines[edge.source_index];
|
||||
out.emplace_back(std::move(pl));
|
||||
if (edge.p2 == pl.first_point().cast<double>()) {
|
||||
if (edge.p2 == out.back().first_point().cast<double>()) {
|
||||
// Polyline is flipped.
|
||||
out.back().reverse();
|
||||
} else {
|
||||
// Polyline is not flipped.
|
||||
assert(edge.p1 == pl.first_point().cast<double>());
|
||||
assert(edge.p1 == out.back().first_point().cast<double>());
|
||||
}
|
||||
}
|
||||
polylines = out;
|
||||
|
||||
#ifndef NDEBUG
|
||||
double cost_final = cost();
|
||||
|
||||
@@ -319,6 +319,13 @@ std::vector<double> layer_height_profile_adaptive(const SlicingParameters& slici
|
||||
else if (layer_height_profile.back() > height && layer_height_profile.back() - height > LAYER_HEIGHT_CHANGE_STEP)
|
||||
height = layer_height_profile.back() - LAYER_HEIGHT_CHANGE_STEP;
|
||||
|
||||
for (auto const& [range,options] : object.layer_config_ranges) {
|
||||
if ( print_z >= range.first && print_z <= range.second) {
|
||||
height = options.opt_float("layer_height");
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
||||
layer_height_profile.push_back(print_z);
|
||||
layer_height_profile.push_back(height);
|
||||
print_z += height;
|
||||
@@ -444,6 +451,7 @@ std::vector<double> smooth_height_profile(const std::vector<double>& profile, co
|
||||
}
|
||||
|
||||
void adjust_layer_height_profile(
|
||||
const ModelObject &model_object,
|
||||
const SlicingParameters &slicing_params,
|
||||
std::vector<coordf_t> &layer_height_profile,
|
||||
coordf_t z,
|
||||
@@ -478,6 +486,11 @@ void adjust_layer_height_profile(
|
||||
}
|
||||
}
|
||||
|
||||
for (auto const& [range,options] : model_object.layer_config_ranges) {
|
||||
if (z >= range.first - current_layer_height && z <= range.second + current_layer_height)
|
||||
return;
|
||||
};
|
||||
|
||||
// 2) Is it possible to apply the delta?
|
||||
switch (action) {
|
||||
case LAYER_HEIGHT_EDIT_ACTION_DECREASE:
|
||||
|
||||
@@ -176,6 +176,7 @@ enum LayerHeightEditActionType : unsigned int {
|
||||
};
|
||||
|
||||
void adjust_layer_height_profile(
|
||||
const ModelObject &model_object,
|
||||
const SlicingParameters &slicing_params,
|
||||
std::vector<coordf_t> &layer_height_profile,
|
||||
coordf_t z,
|
||||
|
||||
@@ -266,8 +266,18 @@ public:
|
||||
protected:
|
||||
double speed_first_layer() const { return m_config.option<ConfigOptionFloat>("initial_layer_speed")->value; };
|
||||
double speed_perimeter() const { return m_config.option<ConfigOptionFloat>("outer_wall_speed")->value; };
|
||||
double line_width_first_layer() const { return m_config.get_abs_value("initial_layer_line_width"); };
|
||||
double line_width() const { return m_config.get_abs_value("line_width"); };
|
||||
double line_width_first_layer() const
|
||||
{
|
||||
// TODO: FIXME: find out current filament/extruder?
|
||||
const double nozzle_diameter = m_config.opt_float("nozzle_diameter", 0);
|
||||
return m_config.get_abs_value("initial_layer_line_width", nozzle_diameter);
|
||||
};
|
||||
double line_width() const
|
||||
{
|
||||
// TODO: FIXME: find out current filament/extruder?
|
||||
const double nozzle_diameter = m_config.opt_float("nozzle_diameter", 0);
|
||||
return m_config.get_abs_value("line_width", nozzle_diameter);
|
||||
};
|
||||
int wall_count() const { return m_config.option<ConfigOptionInt>("wall_loops")->value; };
|
||||
|
||||
private:
|
||||
|
||||
@@ -675,12 +675,13 @@ std::vector<int> GLVolumeCollection::load_object(
|
||||
int obj_idx,
|
||||
const std::vector<int> &instance_idxs,
|
||||
const std::string &color_by,
|
||||
bool opengl_initialized)
|
||||
bool opengl_initialized,
|
||||
bool need_raycaster)
|
||||
{
|
||||
std::vector<int> volumes_idx;
|
||||
for (int volume_idx = 0; volume_idx < int(model_object->volumes.size()); ++volume_idx)
|
||||
for (int instance_idx : instance_idxs)
|
||||
volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, color_by, opengl_initialized));
|
||||
volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, color_by, opengl_initialized, false, false, need_raycaster));
|
||||
return volumes_idx;
|
||||
}
|
||||
|
||||
@@ -693,7 +694,8 @@ int GLVolumeCollection::load_object_volume(
|
||||
const std::string &color_by,
|
||||
bool opengl_initialized,
|
||||
bool in_assemble_view,
|
||||
bool use_loaded_id)
|
||||
bool use_loaded_id,
|
||||
bool need_raycaster)
|
||||
{
|
||||
const ModelVolume *model_volume = model_object->volumes[volume_idx];
|
||||
const int extruder_id = model_volume->extruder_id();
|
||||
@@ -711,7 +713,7 @@ int GLVolumeCollection::load_object_volume(
|
||||
v.model.init_from(mesh, true);
|
||||
#else
|
||||
v.model.init_from(*mesh);
|
||||
v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh);
|
||||
if (need_raycaster) { v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh); }
|
||||
#endif // ENABLE_SMOOTH_NORMALS
|
||||
v.composite_id = GLVolume::CompositeID(obj_idx, volume_idx, instance_idx);
|
||||
|
||||
|
||||
@@ -439,7 +439,8 @@ public:
|
||||
int obj_idx,
|
||||
const std::vector<int> &instance_idxs,
|
||||
const std::string &color_by,
|
||||
bool opengl_initialized);
|
||||
bool opengl_initialized,
|
||||
bool need_raycaster = true);
|
||||
|
||||
int load_object_volume(
|
||||
const ModelObject *model_object,
|
||||
@@ -449,7 +450,8 @@ public:
|
||||
const std::string &color_by,
|
||||
bool opengl_initialized,
|
||||
bool in_assemble_view = false,
|
||||
bool use_loaded_id = false);
|
||||
bool use_loaded_id = false,
|
||||
bool need_raycaster = true);
|
||||
// Load SLA auxiliary GLVolumes (for support trees or pad).
|
||||
void load_object_auxiliary(
|
||||
const SLAPrintObject *print_object,
|
||||
|
||||
@@ -50,14 +50,14 @@ static const std::vector<std::string> filament_vendors =
|
||||
"Fil X", "GEEETECH", "Giantarm", "Gizmo Dorks", "GreenGate3D",
|
||||
"HATCHBOX", "Hello3D", "IC3D", "IEMAI", "IIID Max",
|
||||
"INLAND", "iProspect", "iSANMATE", "Justmaker", "Keene Village Plastics",
|
||||
"Kexcelled", "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"};
|
||||
"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",
|
||||
|
||||
@@ -159,7 +159,7 @@ void Downloader::start_download(const std::string& full_url)
|
||||
size_t id = get_next_id();
|
||||
std::string escaped_url = FileGet::escape_url(full_url.substr(results.length()));
|
||||
if (is_bambustudio_open(full_url) || (is_orca_open(full_url) && is_makerworld_link(full_url)))
|
||||
plater->request_model_download(escaped_url);
|
||||
plater->request_model_download(wxString::FromUTF8(escaped_url));
|
||||
else {
|
||||
std::string text(escaped_url);
|
||||
m_downloads.emplace_back(std::make_unique<Download>(id, std::move(escaped_url), this, m_dest_folder));
|
||||
@@ -254,4 +254,4 @@ void Downloader::set_download_state(int id, DownloadState state)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3123,7 +3123,7 @@ void GCodeViewer::load_shells(const Print& print, bool initialized, bool force_p
|
||||
instance_ids.resize(instance_index);
|
||||
|
||||
size_t current_volumes_count = m_shells.volumes.volumes.size();
|
||||
m_shells.volumes.load_object(model_obj, object_idx, instance_ids, "object", initialized);
|
||||
m_shells.volumes.load_object(model_obj, object_idx, instance_ids, "object", initialized, false);
|
||||
|
||||
// adjust shells' z if raft is present
|
||||
const SlicingParameters& slicing_parameters = obj->slicing_parameters();
|
||||
|
||||
@@ -590,7 +590,7 @@ void GLCanvas3D::LayersEditing::adjust_layer_height_profile()
|
||||
{
|
||||
this->update_slicing_parameters();
|
||||
PrintObject::update_layer_height_profile(*m_model_object, *m_slicing_parameters, m_layer_height_profile);
|
||||
Slic3r::adjust_layer_height_profile(*m_slicing_parameters, m_layer_height_profile, this->last_z, this->strength, this->band_width, this->last_action);
|
||||
Slic3r::adjust_layer_height_profile(*m_model_object, *m_slicing_parameters, m_layer_height_profile, this->last_z, this->strength, this->band_width, this->last_action);
|
||||
m_layers_texture.valid = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -792,8 +792,8 @@ void GLToolbar::do_action(GLToolbarItem::EActionType type, int item_id, GLCanvas
|
||||
}
|
||||
|
||||
if (m_type == Normal && item->get_state() != GLToolbarItem::Disabled) {
|
||||
// the item may get disabled during the action, if not, set it back to normal state
|
||||
item->set_state(GLToolbarItem::Normal);
|
||||
// the item may get disabled during the action, if not, set it back to hover state
|
||||
item->set_state(GLToolbarItem::Hover);
|
||||
parent.render();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4280,7 +4280,6 @@ void GUI_App::check_new_version_sf(bool show_tips, int by_user)
|
||||
best_pre = tag_version;
|
||||
best_pre_url = root.get<std::string>("html_url");
|
||||
best_pre_content = root.get<std::string>("body");
|
||||
best_pre.set_prerelease("Preview");
|
||||
}
|
||||
} else {
|
||||
if (best_release < tag_version) {
|
||||
@@ -4302,7 +4301,6 @@ void GUI_App::check_new_version_sf(bool show_tips, int by_user)
|
||||
best_pre = tag_version;
|
||||
best_pre_url = json_version.second.get<std::string>("html_url");
|
||||
best_pre_content = json_version.second.get<std::string>("body");
|
||||
best_pre.set_prerelease("Preview");
|
||||
}
|
||||
} else {
|
||||
if (best_release < tag_version) {
|
||||
@@ -5647,7 +5645,8 @@ bool GUI_App::check_and_keep_current_preset_changes(const wxString& caption, con
|
||||
bool is_called_from_configwizard = postponed_apply_of_keeped_changes != nullptr;
|
||||
|
||||
UnsavedChangesDialog dlg(caption, header, "", action_buttons);
|
||||
if (dlg.ShowModal() == wxID_CANCEL)
|
||||
bool no_need_change = dlg.getUpdateItemCount() == 0 ? true : false;
|
||||
if (!no_need_change && dlg.ShowModal() == wxID_CANCEL)
|
||||
return false;
|
||||
|
||||
auto reset_modifications = [this, is_called_from_configwizard]() {
|
||||
@@ -5662,7 +5661,7 @@ bool GUI_App::check_and_keep_current_preset_changes(const wxString& caption, con
|
||||
load_current_presets(false);
|
||||
};
|
||||
|
||||
if (dlg.discard())
|
||||
if (dlg.discard() || no_need_change)
|
||||
reset_modifications();
|
||||
else // save selected changes
|
||||
{
|
||||
|
||||
@@ -652,7 +652,8 @@ void Slic3r::GUI::ImageGrid::renderContent1(wxDC &dc, wxPoint const &pt, int ind
|
||||
if (hit) {
|
||||
texts.Add(_L("Delete"));
|
||||
texts.Add(secondAction);
|
||||
texts.Add(thirdAction);
|
||||
if (!thirdAction.IsEmpty())
|
||||
texts.Add(thirdAction);
|
||||
renderButtons(dc, texts, rect, m_hit_type == HIT_ACTION ? m_hit_item & 3 : -1, states);
|
||||
} else if (!nonHoverText.IsEmpty()) {
|
||||
texts.Add(nonHoverText);
|
||||
|
||||
@@ -29,7 +29,7 @@ static const std::vector<int> _3DCONNEXION_VENDORS =
|
||||
0x256F // 3DCONNECTION = 9583 // 3Dconnexion
|
||||
};
|
||||
|
||||
// See: https://github.com/FreeSpacenav/spacenavd/blob/a9eccf34e7cac969ee399f625aef827f4f4aaec6/src/dev.c#L202
|
||||
// See: https://github.com/FreeSpacenav/spacenavd/blob/39856625a6de1e8c4b57c5938e1bf29d13cf1a9f/src/dev.c#L63
|
||||
static const std::vector<int> _3DCONNEXION_DEVICES =
|
||||
{
|
||||
0xc603, /* 50691 spacemouse plus XT */
|
||||
@@ -43,6 +43,7 @@ static const std::vector<int> _3DCONNEXION_DEVICES =
|
||||
0xc628, /* 50728 space navigator for notebooks*/
|
||||
0xc629, /* 50729 space pilot pro*/
|
||||
0xc62b, /* 50731 space mouse pro*/
|
||||
0xc640, /* 50752 nulooq */
|
||||
0xc62e, /* 50734 spacemouse wireless (USB cable) *TESTED* */
|
||||
0xc62f, /* 50735 spacemouse wireless receiver */
|
||||
0xc631, /* 50737 spacemouse pro wireless *TESTED* */
|
||||
@@ -50,7 +51,7 @@ static const std::vector<int> _3DCONNEXION_DEVICES =
|
||||
0xc633, /* 50739 spacemouse enterprise */
|
||||
0xc635, /* 50741 spacemouse compact *TESTED* */
|
||||
0xc636, /* 50742 spacemouse module */
|
||||
0xc640, /* 50752 nulooq */
|
||||
0xc63a, /* 60060 spacemouse wireless (Bluetooth) */
|
||||
0xc652, /* 50770 3Dconnexion universal receiver *TESTED* */
|
||||
};
|
||||
|
||||
|
||||
@@ -502,21 +502,20 @@ std::vector<std::string> UpdateVersionDialog::splitWithStl(std::string str,std::
|
||||
void UpdateVersionDialog::update_version_info(wxString release_note, wxString version)
|
||||
{
|
||||
//bbs check whether the web display is used
|
||||
bool use_web_link = false;
|
||||
url_line = "";
|
||||
auto split_array = splitWithStl(release_note.ToStdString(), "###");
|
||||
|
||||
if (split_array.size() >= 3) {
|
||||
for (auto i = 0; i < split_array.size(); i++) {
|
||||
std::string url = split_array[i];
|
||||
if (std::strstr(url.c_str(), "http://") != NULL || std::strstr(url.c_str(), "https://") != NULL) {
|
||||
use_web_link = true;
|
||||
url_line = url;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool use_web_link = false;
|
||||
url_line = "";
|
||||
// Orca: not used in Orca Slicer
|
||||
// auto split_array = splitWithStl(release_note.ToStdString(), "###");
|
||||
// if (split_array.size() >= 3) {
|
||||
// for (auto i = 0; i < split_array.size(); i++) {
|
||||
// std::string url = split_array[i];
|
||||
// if (std::strstr(url.c_str(), "http://") != NULL || std::strstr(url.c_str(), "https://") != NULL) {
|
||||
// use_web_link = true;
|
||||
// url_line = url;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (use_web_link) {
|
||||
m_brand->Hide();
|
||||
|
||||
@@ -1649,7 +1649,14 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||
//Orca: sync filament num if it's a multi tool printer
|
||||
if (opt_key == "extruders_count" && !m_config->opt_bool("single_extruder_multi_material")){
|
||||
auto num_extruder = boost::any_cast<size_t>(value);
|
||||
wxGetApp().preset_bundle->set_num_filaments(num_extruder);
|
||||
int old_filament_size = wxGetApp().preset_bundle->filament_presets.size();
|
||||
std::vector<std::string> new_colors;
|
||||
for (int i = old_filament_size; i < num_extruder; ++i) {
|
||||
wxColour new_col = Plater::get_next_color_for_filament();
|
||||
std::string new_color = new_col.GetAsString(wxC2S_HTML_SYNTAX).ToStdString();
|
||||
new_colors.push_back(new_color);
|
||||
}
|
||||
wxGetApp().preset_bundle->set_num_filaments(num_extruder, new_colors);
|
||||
wxGetApp().plater()->on_filaments_change(num_extruder);
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
|
||||
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
|
||||
@@ -4322,6 +4329,7 @@ if (is_marlin_flavor)
|
||||
optgroup->append_single_option_line("deretraction_speed", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retraction_minimum_travel", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_when_changing_layer", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_on_top_layer", "", extruder_idx);
|
||||
optgroup->append_single_option_line("wipe", "", extruder_idx);
|
||||
optgroup->append_single_option_line("wipe_distance", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_before_wipe", "", extruder_idx);
|
||||
@@ -4538,7 +4546,7 @@ void TabPrinter::toggle_options()
|
||||
// user can customize other retraction options if retraction is enabled
|
||||
//BBS
|
||||
bool retraction = have_retract_length || use_firmware_retraction;
|
||||
std::vector<std::string> vec = { "z_hop", "retract_when_changing_layer" };
|
||||
std::vector<std::string> vec = {"z_hop", "retract_when_changing_layer", "retract_on_top_layer"};
|
||||
for (auto el : vec)
|
||||
toggle_option(el, retraction, i);
|
||||
|
||||
|
||||
@@ -312,6 +312,8 @@ public:
|
||||
{
|
||||
}
|
||||
};
|
||||
public:
|
||||
int getUpdateItemCount() { return m_presetitems.size(); }
|
||||
|
||||
private:
|
||||
std::vector<PresetItem> m_presetitems;
|
||||
|
||||
Reference in New Issue
Block a user