Merge remote-tracking branch 'remote/master' into SoftFever

# Conflicts:
#	src/libslic3r/Preset.cpp
This commit is contained in:
SoftFever 2022-09-09 21:54:57 +08:00
commit bb74438f7c
132 changed files with 5737 additions and 3598 deletions

View file

@ -130,13 +130,7 @@ void AppConfig::set_defaults()
#endif
if (get("single_instance").empty())
set_bool("single_instance",
#ifdef __APPLE__
true
#else // __APPLE__
false
#endif // __APPLE__
);
set_bool("single_instance", false);
#ifdef SUPPORT_REMEMBER_OUTPUT_PATH
if (get("remember_output_path").empty())

View file

@ -454,10 +454,6 @@ set(OCCT_LIBS
TKernel
)
if(APPLE)
target_link_libraries(libslic3r freetype)
endif()
target_link_libraries(libslic3r
libnest2d
@ -480,6 +476,13 @@ target_link_libraries(libslic3r
${OCCT_LIBS}
)
if(NOT WIN32)
target_link_libraries(libslic3r freetype)
if (NOT APPLE)
target_link_libraries(libslic3r fontconfig)
endif()
endif()
if (TARGET OpenVDB::openvdb)
target_link_libraries(libslic3r OpenVDB::openvdb)
endif()

View file

@ -534,8 +534,10 @@ bool ConfigBase::set_deserialize_nothrow(const t_config_option_key &opt_key_src,
this->handle_legacy(opt_key, value);
if (opt_key.empty()) {
// Ignore the option.
//BBS: record these options
substitutions_ctxt.unrecogized_keys.push_back(opt_key_src);
//BBS: record these options, keep only one repeated opt_key
auto iter = std::find(substitutions_ctxt.unrecogized_keys.begin(), substitutions_ctxt.unrecogized_keys.end(), opt_key_src);
if (iter == substitutions_ctxt.unrecogized_keys.end())
substitutions_ctxt.unrecogized_keys.push_back(opt_key_src);
return true;
}
return this->set_deserialize_raw(opt_key, value, substitutions_ctxt, append);

View file

@ -2507,6 +2507,14 @@ GCode::LayerResult GCode::process_layer(
gcode += "; open powerlost recovery\n";
gcode += "M1003 S1\n";
}
// BBS: open first layer inspection at second layer
if (print.config().scan_first_layer.value) {
// BBS: retract first to avoid droping when scan model
gcode += this->retract();
gcode += "M976 S1 P1 ; scan model before printing 2nd layer\n";
gcode += "M400 P100\n";
gcode += this->unretract();
}
//BBS: reset acceleration at sencond layer
if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) {
@ -2661,7 +2669,29 @@ GCode::LayerResult GCode::process_layer(
}
}
if (support_dontcare || interface_dontcare) {
if (interface_dontcare) {
int extruder_override = wiping_extrusions.get_support_interface_extruder_overrides(&object);
if (extruder_override >= 0) {
interface_extruder = extruder_override;
interface_dontcare = false;
}
}
// BBS: try to print support base with a filament other than interface filament
if (support_dontcare && !interface_dontcare) {
unsigned int dontcare_extruder = first_extruder_id;
for (unsigned int extruder_id : layer_tools.extruders) {
if (print.config().filament_soluble.get_at(extruder_id)) continue;
if (extruder_id == interface_extruder) continue;
dontcare_extruder = extruder_id;
break;
}
if (support_dontcare) support_extruder = dontcare_extruder;
}
else if (support_dontcare || interface_dontcare) {
// Some support will be printed with "don't care" material, preferably non-soluble.
// Is the current extruder assigned a soluble filament?
unsigned int dontcare_extruder = first_extruder_id;
@ -3028,18 +3058,6 @@ GCode::LayerResult GCode::process_layer(
file.write(gcode);
#endif
// BBS: scan model after print first layer
// Note: for sequential printing, every object will have this
if (print.config().scan_first_layer.value) {
if (first_layer) {
//BBS: retract first to avoid droping when scan model
gcode += this->retract();
gcode += "M976 S1 P1 ; scan model after print first layer\n";
gcode += "M400 P100\n";
gcode += this->unretract();
}
}
BOOST_LOG_TRIVIAL(trace) << "Exported layer " << layer.id() << " print_z " << print_z <<
log_memory_info();
@ -3839,8 +3857,8 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction)
if (m_writer.extruder() == nullptr)
return gcode;
// wipe (if it's enabled for this extruder and we have a stored wipe path)
if (EXTRUDER_CONFIG(wipe) && m_wipe.has_path()) {
// wipe (if it's enabled for this extruder and we have a stored wipe path and no-zero wipe distance)
if (EXTRUDER_CONFIG(wipe) && m_wipe.has_path() && scale_(EXTRUDER_CONFIG(wipe_distance)) > SCALED_EPSILON) {
gcode += toolchange ? m_writer.retract_for_toolchange(true) : m_writer.retract(true);
gcode += m_wipe.wipe(*this, toolchange, is_last_retraction);
}

View file

@ -83,7 +83,7 @@ public:
m_tool_change_idx(0),
m_plate_origin(plate_origin),
m_single_extruder_multi_material(print_config.single_extruder_multi_material),
m_enable_timelapse_print(print_config.timelapse_no_toolhead.value),
m_enable_timelapse_print(print_config.timelapse_type.value == TimelapseType::tlSmooth),
m_is_first_print(true)
{}

View file

@ -990,11 +990,22 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
}
const ConfigOptionPoints* extruder_offset = config.option<ConfigOptionPoints>("extruder_offset");
const ConfigOptionBool* single_extruder_multi_material = config.option<ConfigOptionBool>("single_extruder_multi_material");
if (extruder_offset != nullptr) {
m_extruder_offsets.resize(extruder_offset->values.size());
for (size_t i = 0; i < extruder_offset->values.size(); ++i) {
Vec2f offset = extruder_offset->values[i].cast<float>();
m_extruder_offsets[i] = { offset(0), offset(1), 0.0f };
//BBS: for single extruder multi material, only use the offset of first extruder
if (single_extruder_multi_material != nullptr && single_extruder_multi_material->getBool()) {
Vec2f offset = extruder_offset->values[0].cast<float>();
m_extruder_offsets.resize(m_result.extruders_count);
for (size_t i = 0; i < m_result.extruders_count; ++i) {
m_extruder_offsets[i] = { offset(0), offset(1), 0.0f };
}
}
else {
m_extruder_offsets.resize(extruder_offset->values.size());
for (size_t i = 0; i < extruder_offset->values.size(); ++i) {
Vec2f offset = extruder_offset->values[i].cast<float>();
m_extruder_offsets[i] = { offset(0), offset(1), 0.0f };
}
}
}
@ -1192,6 +1203,7 @@ void GCodeProcessor::reset()
}
m_extruded_last_z = 0.0f;
m_zero_layer_height = 0.0f;
m_first_layer_height = 0.0f;
m_processing_start_custom_gcode = false;
m_g1_line_id = 0;
@ -2469,7 +2481,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
AxisCoords delta_pos;
for (unsigned char a = X; a <= E; ++a) {
delta_pos[a] = m_end_position[a] - m_start_position[a];
max_abs_delta = std::max(max_abs_delta, std::abs(delta_pos[a]));
max_abs_delta = std::max<float>(max_abs_delta, std::abs(delta_pos[a]));
}
// no displacement, return
@ -2575,7 +2587,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
minimum_feedrate(static_cast<PrintEstimatedStatistics::ETimeMode>(i), m_feedrate);
//BBS: calculeta enter and exit direction
curr.enter_direction = { delta_pos[X], delta_pos[Y], delta_pos[Z] };
curr.enter_direction = { static_cast<float>(delta_pos[X]), static_cast<float>(delta_pos[Y]), static_cast<float>(delta_pos[Z]) };
float norm = curr.enter_direction.norm();
if (!is_extrusion_only_move(delta_pos))
curr.enter_direction = curr.enter_direction / norm;
@ -2624,8 +2636,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
curr.abs_axis_feedrate[a] = std::abs(curr.axis_feedrate[a]);
if (curr.abs_axis_feedrate[a] != 0.0f) {
float axis_max_feedrate = get_axis_max_feedrate(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
if (axis_max_feedrate != 0.0f)
min_feedrate_factor = std::min(min_feedrate_factor, axis_max_feedrate / curr.abs_axis_feedrate[a]);
if (axis_max_feedrate != 0.0f) min_feedrate_factor = std::min<float>(min_feedrate_factor, axis_max_feedrate / curr.abs_axis_feedrate[a]);
}
}
//BBS: update curr.feedrate
@ -2914,6 +2925,7 @@ void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line)
EMoveType type = move_type(delta_pos[E]);
float delta_xyz = std::sqrt(sqr(arc_length) + sqr(delta_pos[Z]));
if (type == EMoveType::Extrude) {
float volume_extruded_filament = area_filament_cross_section * delta_pos[E];
@ -3020,8 +3032,7 @@ void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line)
curr.abs_axis_feedrate[a] = std::abs(curr.axis_feedrate[a]);
if (curr.abs_axis_feedrate[a] != 0.0f) {
float axis_max_feedrate = get_axis_max_feedrate(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
if (axis_max_feedrate != 0.0f)
min_feedrate_factor = std::min(min_feedrate_factor, axis_max_feedrate / curr.abs_axis_feedrate[a]);
if (axis_max_feedrate != 0.0f) min_feedrate_factor = std::min<float>(min_feedrate_factor, axis_max_feedrate / curr.abs_axis_feedrate[a]);
}
}
curr.feedrate *= min_feedrate_factor;
@ -3048,8 +3059,7 @@ void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line)
if (axis_acc[a] != 0.0f) {
float axis_max_acceleration = get_axis_max_acceleration(static_cast<PrintEstimatedStatistics::ETimeMode>(i), static_cast<Axis>(a));
if (axis_max_acceleration != 0.0f && axis_acc[a] > axis_max_acceleration)
min_acc_factor = std::min(min_acc_factor, axis_max_acceleration / axis_acc[a]);
if (axis_max_acceleration != 0.0f && axis_acc[a] > axis_max_acceleration) min_acc_factor = std::min<float>(min_acc_factor, axis_max_acceleration / axis_acc[a]);
}
}
block.acceleration = acceleration * min_acc_factor;
@ -3685,7 +3695,7 @@ void GCodeProcessor::store_move_vertex(EMoveType type, EMovePathType path_type)
m_interpolation_points[i] =
Vec3f(m_interpolation_points[i].x() + m_x_offset,
m_interpolation_points[i].y() + m_y_offset,
m_processing_start_custom_gcode ? m_first_layer_height : m_interpolation_points[i].z()) +
m_processing_start_custom_gcode ? m_zero_layer_height : m_interpolation_points[i].z()) +
m_extruder_offsets[m_extruder_id];
}
@ -3696,8 +3706,8 @@ void GCodeProcessor::store_move_vertex(EMoveType type, EMovePathType path_type)
m_extruder_id,
m_cp_color.current,
//BBS: add plate's offset to the rendering vertices
Vec3f(m_end_position[X] + m_x_offset, m_end_position[Y] + m_y_offset, m_processing_start_custom_gcode ? m_first_layer_height : m_end_position[Z]) + m_extruder_offsets[m_extruder_id],
m_end_position[E] - m_start_position[E],
Vec3f(m_end_position[X] + m_x_offset, m_end_position[Y] + m_y_offset, m_processing_start_custom_gcode ? m_zero_layer_height : m_end_position[Z]) + m_extruder_offsets[m_extruder_id],
static_cast<float>(m_end_position[E] - m_start_position[E]),
m_feedrate,
m_width,
m_height,

View file

@ -219,7 +219,7 @@ namespace Slic3r {
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
private:
using AxisCoords = std::array<float, 4>;
using AxisCoords = std::array<double, 4>;
using ExtruderColors = std::vector<unsigned char>;
using ExtruderTemps = std::vector<float>;
@ -595,6 +595,7 @@ namespace Slic3r {
ExtruderTemps m_extruder_temps;
float m_extruded_last_z;
float m_first_layer_height; // mm
float m_zero_layer_height; // mm
bool m_processing_start_custom_gcode;
unsigned int m_g1_line_id;
unsigned int m_layer_id;

View file

@ -175,8 +175,13 @@ ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool
this->collect_extruders(*object, per_layer_extruder_switches);
// Reorder the extruders to minimize tool switches.
std::vector<unsigned int> first_layer_tool_order;
if (first_extruder == (unsigned int)-1) {
this->reorder_extruders(generate_first_layer_tool_order(print));
first_layer_tool_order = generate_first_layer_tool_order(print);
}
if (!first_layer_tool_order.empty()) {
this->reorder_extruders(first_layer_tool_order);
}
else {
this->reorder_extruders(first_extruder);

View file

@ -545,7 +545,7 @@ WipeTower::WipeTower(const PrintConfig& config, int plate_idx, Vec3d plate_origi
m_current_tool(initial_tool),
//wipe_volumes(flush_matrix)
m_wipe_volume(prime_volume),
m_enable_timelapse_print(config.timelapse_no_toolhead.value)
m_enable_timelapse_print(config.timelapse_type.value == TimelapseType::tlSmooth)
{
// Read absolute value of first layer speed, if given as percentage,
// it is taken over following default. Speeds from config are not

View file

@ -574,7 +574,7 @@ enum class EnforcerBlockerType : int8_t {
Extruder13,
Extruder14,
Extruder15,
ExtruderMax = Extruder15,
ExtruderMax
};
enum class ConversionType : int {

View file

@ -643,7 +643,7 @@ std::string Preset::get_filament_type(std::string &display_filament_type)
}
static std::vector<std::string> s_Preset_print_options {
"layer_height", "initial_layer_print_height", "wall_loops", "spiral_mode",
"layer_height", "initial_layer_print_height", "wall_loops", "slice_closing_radius", "spiral_mode",
"top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness",
"reduce_crossing_wall", "detect_thin_wall", "detect_overhang_wall",
"seam_position", "wall_infill_order", "sparse_infill_density", "sparse_infill_pattern", "top_surface_pattern", "bottom_surface_pattern",
@ -683,7 +683,8 @@ static std::vector<std::string> s_Preset_print_options {
"gcode_add_line_number", "enable_arc_fitting", "infill_combination", "adaptive_layer_height",
"support_bottom_interface_spacing", "enable_overhang_speed", "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed",
"initial_layer_infill_speed", "only_one_wall_top", "only_one_wall_first_layer",
"timelapse_no_toolhead"
"timelapse_type"
};
static std::vector<std::string> s_Preset_filament_options {
@ -755,6 +756,7 @@ static std::vector<std::string> s_Preset_sla_print_options {
"support_object_elevation",
"support_points_density_relative",
"support_points_minimal_distance",
"slice_closing_radius",
"pad_enable",
"pad_wall_thickness",
"pad_wall_height",

View file

@ -1758,7 +1758,7 @@ const WipeTowerData& Print::wipe_tower_data(size_t filaments_cnt) const
bool Print::enable_timelapse_print() const
{
return m_config.timelapse_no_toolhead.value;
return m_config.timelapse_type.value == TimelapseType::tlSmooth;
}
void Print::_make_wipe_tower()
@ -1779,11 +1779,10 @@ void Print::_make_wipe_tower()
// BBS: priming logic is removed, so don't consider it in tool ordering
m_wipe_tower_data.tool_ordering = ToolOrdering(*this, (unsigned int)-1, false);
// if enable_timelapse_print(), update all layer_tools parameters(has_wipe_tower, wipe_tower_partitions)
// if enable_timelapse_print(), update all layer_tools parameters: wipe_tower_partitions
if (enable_timelapse_print()) {
std::vector<LayerTools>& layer_tools_array = m_wipe_tower_data.tool_ordering.layer_tools();
for (LayerTools& layer_tools : layer_tools_array) {
layer_tools.has_wipe_tower = true;
if (layer_tools.wipe_tower_partitions == 0) {
layer_tools.wipe_tower_partitions = 1;
}

View file

@ -12,6 +12,35 @@
#include <float.h>
namespace {
std::set<std::string> SplitStringAndRemoveDuplicateElement(const std::string &str, const std::string &separator)
{
std::set<std::string> result;
if (str.empty()) return result;
std::string strs = str + separator;
size_t pos;
size_t size = strs.size();
for (int i = 0; i < size; ++i) {
pos = strs.find(separator, i);
if (pos < size) {
std::string sub_str = strs.substr(i, pos - i);
result.insert(sub_str);
i = pos + separator.size() - 1;
}
}
return result;
}
void ReplaceString(std::string &resource_str, const std::string &old_str, const std::string &new_str)
{
std::string::size_type pos = 0;
while ((pos = resource_str.find(old_str)) != std::string::npos) { resource_str.replace(pos, old_str.length(), new_str); }
}
}
namespace Slic3r {
//! macro used to mark string used at localization,
@ -204,6 +233,14 @@ static const t_config_enum_values s_keys_map_BrimType = {
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(BrimType)
// using 0,1,2 to compatible with old files
static const t_config_enum_values s_keys_map_TimelapseType = {
{"0", tlNone},
{"1", tlSmooth},
{"2", tlTraditional}
};
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(TimelapseType)
static const t_config_enum_values s_keys_map_DraftShield = {
{ "disabled", dsDisabled },
{ "limited", dsLimited },
@ -571,7 +608,7 @@ void PrintConfigDef::init_fff_params()
def->sidetext = L("%");
def->min = 0;
def->max = 100;
def->mode = comDevelop;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInts { 100 });
def = this->add("overhang_fan_threshold", coEnums);
@ -580,7 +617,7 @@ void PrintConfigDef::init_fff_params()
"Expressed as percentage which indicides how much width of the line without support from lower layer");
def->sidetext = L("");
def->enum_keys_map = &s_keys_map_OverhangFanThreshold;
def->mode = comDevelop;
def->mode = comAdvanced;
def->enum_values.emplace_back("5%");
def->enum_values.emplace_back("25%");
def->enum_values.emplace_back("50%");
@ -2130,16 +2167,24 @@ void PrintConfigDef::init_fff_params()
def->mode = comSimple;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("timelapse_no_toolhead", coBool);
def = this->add("timelapse_type", coEnum);
def->label = L("Timelapse");
def->tooltip = L("If enabled, a timelapse video will be generated for each print. "
"After each layer is printed, the toolhead will move to the excess chute, "
"and then a snapshot is taken with the chamber camera. "
def->tooltip = L("If smooth or traditional mode is selected, a timelapse video will be generated for each print. "
"After each layer is printed, a snapshot is taken with the chamber camera. "
"All of these snapshots are composed into a timelapse video when printing completes. "
"If smooth mode is selected, the toolhead will move to the excess chute after each layer is printed "
"and then take a snapshot. "
"Since the melt filament may leak from the nozzle during the process of taking a snapshot, "
"prime tower is required for nozzle priming.");
"prime tower is required for smooth mode to wipe nozzle.");
def->enum_keys_map = &ConfigOptionEnum<TimelapseType>::get_enum_values();
def->enum_values.emplace_back("0");
def->enum_values.emplace_back("1");
def->enum_values.emplace_back("2");
def->enum_labels.emplace_back(L("None"));
def->enum_labels.emplace_back(L("Smooth"));
def->enum_labels.emplace_back(L("Traditional"));
def->mode = comSimple;
def->set_default_value(new ConfigOptionBool(false));
def->set_default_value(new ConfigOptionEnum<TimelapseType>(tlNone));
def = this->add("standby_temperature_delta", coInt);
def->label = L("Temperature variation");
@ -2184,6 +2229,16 @@ void PrintConfigDef::init_fff_params()
def->mode = comDevelop;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("slice_closing_radius", coFloat);
def->label = L("Slice gap closing radius");
def->category = L("Quality");
def->tooltip = L("Cracks smaller than 2x gap closing radius are being filled during the triangle mesh slicing. "
"The gap closing operation may reduce the final print resolution, therefore it is advisable to keep the value reasonably low.");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0.049));
def = this->add("enable_support", coBool);
//BBS: remove material behind support
def->label = L("Enable support");
@ -2621,6 +2676,7 @@ void PrintConfigDef::init_fff_params()
def->label = L("Wipe Distance");
def->tooltip = L("Discribe how long the nozzle will move along the last path when retracting");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 2. });
@ -3530,6 +3586,19 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
opt_key = "compatible_process_expression_group";
} else if (opt_key == "cooling") {
opt_key = "slow_down_for_layer_cooling";
} else if (opt_key == "timelapse_no_toolhead") {
opt_key = "timelapse_type";
} else if (opt_key == "different_settings_to_system") {
std::string copy_value = value;
copy_value.erase(std::remove(copy_value.begin(), copy_value.end(), '\"'), copy_value.end()); // remove '"' in string
std::set<std::string> split_keys = SplitStringAndRemoveDuplicateElement(copy_value, ";");
for (std::string split_key : split_keys) {
std::string copy_key = split_key, copy_value = "";
handle_legacy(copy_key, copy_value);
if (copy_key != split_key) {
ReplaceString(value, split_key, copy_key);
}
}
}
// Ignore the following obsolete configuration keys:
@ -3544,7 +3613,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
, "support_sharp_tails","remove_small_overhangs", "support_with_sheath",
"tree_support_branch_diameter_angle", "tree_support_collision_resolution",
"small_perimeter_speed", "max_volumetric_speed", "max_print_speed",
"support_bottom_z_distance", "support_closing_radius", "slicing_mode", "slice_closing_radius",
"support_bottom_z_distance", "support_closing_radius", "slicing_mode",
"remove_freq_sweep", "remove_bed_leveling", "remove_extrusion_calibration",
"support_transition_line_width", "support_transition_speed", "bed_temperature", "bed_temperature_initial_layer",
"can_switch_nozzle_type", "can_add_auxiliary_fan", "extra_flush_volume", "spaghetti_detector"
@ -3655,9 +3724,12 @@ void DynamicPrintConfig::normalize_fdm(int used_filaments)
ConfigOptionBool* islh_opt = this->option<ConfigOptionBool>("independent_support_layer_height", true);
ConfigOptionBool* alh_opt = this->option<ConfigOptionBool>("adaptive_layer_height");
ConfigOptionEnum<PrintSequence>* ps_opt = this->option<ConfigOptionEnum<PrintSequence>>("print_sequence");
if (used_filaments == 1 || ps_opt->value == PrintSequence::ByObject)
ept_opt->value = false;
ConfigOptionEnum<TimelapseType> *timelapse_opt = this->option<ConfigOptionEnum<TimelapseType>>("timelapse_type");
if (timelapse_opt && timelapse_opt->value == TimelapseType::tlSmooth) {
if (used_filaments == 1 || ps_opt->value == PrintSequence::ByObject)
ept_opt->value = false;
}
if (ept_opt->value) {
if (islh_opt)

View file

@ -142,6 +142,12 @@ enum BrimType {
btOuterAndInner,
};
enum TimelapseType {
tlNone,
tlSmooth,
tlTraditional
};
enum DraftShield {
dsDisabled, dsLimited, dsEnabled
};
@ -249,6 +255,7 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SeamPosition)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SLADisplayOrientation)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(SLAPillarConnectionMode)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BrimType)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(TimelapseType)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(BedType)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(DraftShield)
CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(ForwardCompatibilitySubstitutionRule)
@ -591,6 +598,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, raft_first_layer_expansion))
((ConfigOptionInt, raft_layers))
((ConfigOptionEnum<SeamPosition>, seam_position))
((ConfigOptionFloat, slice_closing_radius))
((ConfigOptionBool, enable_support))
// Automatic supports (generated based on support_threshold_angle).
((ConfigOptionEnum<SupportType>, support_type))
@ -874,7 +882,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
// BBS: not in any preset, calculated before slicing
((ConfigOptionBool, has_prime_tower))
((ConfigOptionFloat, nozzle_volume))
((ConfigOptionBool, timelapse_no_toolhead))
((ConfigOptionEnum<TimelapseType>, timelapse_type))
)
@ -900,6 +908,8 @@ PRINT_CONFIG_CLASS_DEFINE(
//Number of the layers needed for the exposure time fade [3;20]
((ConfigOptionInt, faded_layers))/*= 10*/
((ConfigOptionFloat, slice_closing_radius))
// Enabling or disabling support creation
((ConfigOptionBool, supports_enable))

View file

@ -680,7 +680,8 @@ bool PrintObject::invalidate_state_by_config_options(
//BBS
|| opt_key == "adaptive_layer_height"
|| opt_key == "raft_layers"
|| opt_key == "raft_contact_distance") {
|| opt_key == "raft_contact_distance"
|| opt_key == "slice_closing_radius") {
steps.emplace_back(posSlice);
} else if (
opt_key == "elefant_foot_compensation"

View file

@ -136,7 +136,7 @@ static std::vector<VolumeSlices> slice_volumes_inner(
slicing_ranges.reserve(layer_ranges.size());
MeshSlicingParamsEx params_base;
params_base.closing_radius = g_config_slice_closing_radius;
params_base.closing_radius = print_object_config.slice_closing_radius.value;
params_base.extra_offset = 0;
params_base.trafo = object_trafo;
//BBS: 0.0025mm is safe enough to simplify the data to speed slicing up for high-resolution model.
@ -1040,7 +1040,7 @@ void PrintObject::slice_volumes()
if (min_growth < 0.f || elfoot > 0.f) {
// Apply the negative XY compensation. (the ones that is <0)
ExPolygons trimming;
static const float eps = float(scale_(g_config_slice_closing_radius) * 1.5);
static const float eps = float(scale_(m_config.slice_closing_radius.value) * 1.5);
if (elfoot > 0.f) {
lslices_1st_layer = offset_ex(layer->merged(eps), -eps);
trimming = Slic3r::elephant_foot_compensation(lslices_1st_layer,

View file

@ -930,7 +930,8 @@ bool SLAPrintObject::invalidate_state_by_config_options(const std::vector<t_conf
|| opt_key == "supports_enable"
|| opt_key == "support_object_elevation"
|| opt_key == "pad_around_object"
|| opt_key == "pad_around_object_everywhere") {
|| opt_key == "pad_around_object_everywhere"
|| opt_key == "slice_closing_radius") {
steps.emplace_back(slaposObjectSlice);
} else if (
opt_key == "support_points_density_relative"

View file

@ -518,7 +518,7 @@ void SLAPrint::Steps::slice_model(SLAPrintObject &po)
po.m_model_slices.clear();
MeshSlicingParamsEx params;
params.closing_radius = float(g_config_slice_closing_radius);
params.closing_radius = float(po.config().slice_closing_radius.value);
//BBS: always regular mode
//switch (po.config().slicing_mode.value) {
//case SlicingMode::Regular: params.mode = MeshSlicingParams::SlicingMode::Regular; break;
@ -749,7 +749,7 @@ void SLAPrint::Steps::slice_supports(SLAPrintObject &po) {
for(auto& rec : po.m_slice_index) heights.emplace_back(rec.slice_level());
sd->support_slices = sd->support_tree_ptr->slice(
heights, float(g_config_slice_closing_radius));
heights, float(po.config().slice_closing_radius.value));
}
for (size_t i = 0; i < sd->support_slices.size() && i < po.m_slice_index.size(); ++i)

View file

@ -94,7 +94,6 @@ static constexpr bool RELATIVE_E_AXIS = 1;
static constexpr bool g_config_support_sharp_tails = true;
static constexpr bool g_config_remove_small_overhangs = true;
static constexpr float g_config_tree_support_collision_resolution = 0.2;
static constexpr float g_config_slice_closing_radius = 0.049;
// Write slices as SVG images into out directory during the 2D processing of the slices.
// #define SLIC3R_DEBUG_SLICE_PROCESSING