mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 11:53:48 +00:00
Merge branch 'main' into feature/wipetower-option
This commit is contained in:
@@ -23,10 +23,11 @@ template<> struct hash<Slic3r::GridPoint3>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
void InterlockingGenerator::generate_interlocking_structure(PrintObject* print_object)
|
||||
void InterlockingGenerator::generate_interlocking_structure(PrintObject* print_object, const std::function<void()>& throw_on_cancel)
|
||||
{
|
||||
const auto& config = print_object->config();
|
||||
if (!config.interlocking_beam) {
|
||||
// Check if interlocking is enabled, and avoid errors like division by zero due to invalid configuration.
|
||||
if (!config.interlocking_beam || config.interlocking_beam_layer_count < 1 || config.interlocking_depth < 1 || config.interlocking_beam_width < EPSILON ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,8 +56,10 @@ void InterlockingGenerator::generate_interlocking_structure(PrintObject* print_o
|
||||
continue;
|
||||
}
|
||||
|
||||
throw_on_cancel();
|
||||
|
||||
InterlockingGenerator gen(*print_object, region_a_index, region_b_index, beam_width, boundary_avoidance, rotation, cell_size, beam_layer_count,
|
||||
interface_dilation, air_dilation, air_filtering);
|
||||
interface_dilation, air_dilation, air_filtering, throw_on_cancel);
|
||||
gen.generateInterlockingStructure();
|
||||
}
|
||||
}
|
||||
@@ -108,12 +111,14 @@ void InterlockingGenerator::handleThinAreas(const std::unordered_set<GridPoint3>
|
||||
}
|
||||
}
|
||||
for (auto& near_interlock : near_interlock_per_layer) {
|
||||
throw_on_cancel();
|
||||
near_interlock = offset(union_(closing(near_interlock, rounding_errors)), detect);
|
||||
polygons_rotate(near_interlock, rotation);
|
||||
}
|
||||
|
||||
// Only alter layers when they are present in both meshes, zip should take care if that.
|
||||
for (size_t layer_nr = 0; layer_nr < print_object.layer_count(); layer_nr++){
|
||||
throw_on_cancel();
|
||||
auto layer = print_object.get_layer(layer_nr);
|
||||
ExPolygons polys_a = to_expolygons(layer->get_region(region_a_index)->slices.surfaces);
|
||||
ExPolygons polys_b = to_expolygons(layer->get_region(region_b_index)->slices.surfaces);
|
||||
@@ -199,7 +204,8 @@ void InterlockingGenerator::addBoundaryCells(const std::vector<ExPolygons>& lay
|
||||
const DilationKernel& kernel,
|
||||
std::unordered_set<GridPoint3>& cells) const
|
||||
{
|
||||
auto voxel_emplacer = [&cells](GridPoint3 p) {
|
||||
auto voxel_emplacer = [this, &cells](GridPoint3 p) {
|
||||
this->throw_on_cancel();
|
||||
if (p.z() < 0) {
|
||||
return true;
|
||||
}
|
||||
@@ -313,6 +319,7 @@ void InterlockingGenerator::applyMicrostructureToOutlines(const std::unordered_s
|
||||
for (size_t region_idx = 0; region_idx < 2; region_idx++) {
|
||||
const size_t region = (region_idx == 0) ? region_a_index : region_b_index;
|
||||
for (size_t layer_nr = 0; layer_nr < max_layer_count; layer_nr++) {
|
||||
throw_on_cancel();
|
||||
ExPolygons layer_outlines = layer_regions[layer_nr];
|
||||
expolygons_rotate(layer_outlines, unapply_rotation);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
/*!
|
||||
* Generate an interlocking structure between each two adjacent meshes.
|
||||
*/
|
||||
static void generate_interlocking_structure(PrintObject* print_object);
|
||||
static void generate_interlocking_structure(PrintObject* print_object, const std::function<void()>& throw_on_cancel);
|
||||
|
||||
private:
|
||||
/*!
|
||||
@@ -75,7 +75,8 @@ private:
|
||||
const coord_t beam_layer_count,
|
||||
const DilationKernel& interface_dilation,
|
||||
const DilationKernel& air_dilation,
|
||||
const bool air_filtering)
|
||||
const bool air_filtering,
|
||||
const std::function<void()>& throw_on_cancel)
|
||||
: print_object(print_object)
|
||||
, region_a_index(region_a_index)
|
||||
, region_b_index(region_b_index)
|
||||
@@ -88,6 +89,7 @@ private:
|
||||
, interface_dilation(interface_dilation)
|
||||
, air_dilation(air_dilation)
|
||||
, air_filtering(air_filtering)
|
||||
, throw_on_cancel(throw_on_cancel)
|
||||
{}
|
||||
|
||||
/*! Given two polygons, return the parts that border on air, and grow 'perpendicular' up to 'detect' distance.
|
||||
@@ -165,6 +167,8 @@ private:
|
||||
// Whether to fully remove all of the interlocking cells which would be visible on the outside. If no air filtering then those cells
|
||||
// will be cut off midway in a beam.
|
||||
const bool air_filtering;
|
||||
|
||||
const std::function<void()>& throw_on_cancel;
|
||||
};
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
@@ -882,6 +882,7 @@ std::vector<SurfaceFill> group_fills(const Layer &layer, LockRegionParam &lock_p
|
||||
if (surface.is_top()) {
|
||||
params.pattern = region_config.top_surface_pattern.value;
|
||||
params.density = float(region_config.top_surface_density);
|
||||
if (params.density <= 0.0f) continue;
|
||||
} else { // Surface is bottom
|
||||
params.pattern = region_config.bottom_surface_pattern.value;
|
||||
params.density = float(region_config.bottom_surface_density);
|
||||
|
||||
@@ -1321,19 +1321,18 @@ void ToolOrdering::reorder_extruders_for_minimum_flush_volume(bool reorder_first
|
||||
return false;
|
||||
};
|
||||
|
||||
if (m_print->is_BBL_printer() || number_of_extruders == 1){
|
||||
auto maps_without_group = filament_maps;
|
||||
for (auto& item : maps_without_group)
|
||||
item = 0;
|
||||
|
||||
reorder_filaments_for_minimum_flush_volume(
|
||||
filament_lists,
|
||||
filament_maps,
|
||||
m_print->is_BBL_printer() ? filament_maps : maps_without_group, // non-bbl printers do not support filament group yet
|
||||
layer_filaments,
|
||||
nozzle_flush_mtx,
|
||||
get_custom_seq,
|
||||
&filament_sequences
|
||||
);
|
||||
} else {
|
||||
// For non-bbl multi-extruder printers we don't support filament group yet, so we keep the layer sequence because we don't flush based on order
|
||||
filament_sequences = layer_filaments;
|
||||
}
|
||||
|
||||
auto curr_flush_info = calc_filament_change_info_by_toolorder(print_config, filament_maps, nozzle_flush_mtx, filament_sequences);
|
||||
if (nozzle_nums <= 1)
|
||||
@@ -1349,9 +1348,6 @@ void ToolOrdering::reorder_extruders_for_minimum_flush_volume(bool reorder_first
|
||||
// always calculate the info by one extruder
|
||||
{
|
||||
std::vector<std::vector<unsigned int>>filament_sequences_one_extruder;
|
||||
auto maps_without_group = filament_maps;
|
||||
for (auto& item : maps_without_group)
|
||||
item = 0;
|
||||
reorder_filaments_for_minimum_flush_volume(
|
||||
filament_lists,
|
||||
maps_without_group,
|
||||
|
||||
@@ -3979,7 +3979,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->enum_labels.push_back(L("No ironing"));
|
||||
def->enum_labels.push_back(L("Top surfaces"));
|
||||
def->enum_labels.push_back(L("Topmost surface"));
|
||||
def->enum_labels.push_back(L("All solid layer"));
|
||||
def->enum_labels.push_back(L("All solid layers"));
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<IroningType>(IroningType::NoIroning));
|
||||
|
||||
@@ -4561,7 +4561,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->set_default_value(new ConfigOptionFloat(0.));
|
||||
|
||||
def = this->add("detect_overhang_wall", coBool);
|
||||
def->label = L("Detect overhang wall");
|
||||
def->label = L("Detect overhang walls");
|
||||
def->category = L("Quality");
|
||||
def->tooltip = L("Detect the overhang percentage relative to line width and use different speed to print. "
|
||||
"For 100%% overhang, bridge speed is used.");
|
||||
@@ -5311,7 +5311,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def = this->add("minimum_sparse_infill_area", coFloat);
|
||||
def->label = L("Minimum sparse infill threshold");
|
||||
def->category = L("Strength");
|
||||
def->tooltip = L("Sparse infill area which is smaller than threshold value is replaced by internal solid infill.");
|
||||
def->tooltip = L("Sparse infill areas smaller than this threshold value are replaced by internal solid infill.");
|
||||
def->sidetext = L(u8"mm²"); // square milimeters, CIS languages need translation
|
||||
def->min = 0;
|
||||
def->mode = comAdvanced;
|
||||
@@ -6163,10 +6163,10 @@ void PrintConfigDef::init_fff_params()
|
||||
def->set_default_value(new ConfigOptionPoints{});
|
||||
|
||||
def = this->add("detect_thin_wall", coBool);
|
||||
def->label = L("Detect thin wall");
|
||||
def->label = L("Detect thin walls");
|
||||
def->category = L("Strength");
|
||||
def->tooltip = L("Detect thin wall which can't contain two line width. And use single line to print. "
|
||||
"Maybe printed not very well, because it's not closed loop.");
|
||||
def->tooltip = L("Detect thin walls which can't contain two line widths, and use single line to print. "
|
||||
"Maybe not printed very well, because it's not a closed loop.");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool(false));
|
||||
|
||||
@@ -6777,7 +6777,7 @@ void PrintConfigDef::init_fff_params()
|
||||
}
|
||||
|
||||
def = this->add("detect_narrow_internal_solid_infill", coBool);
|
||||
def->label = L("Detect narrow internal solid infill");
|
||||
def->label = L("Detect narrow internal solid infills");
|
||||
def->category = L("Strength");
|
||||
def->tooltip = L("This option will auto-detect narrow internal solid infill areas. "
|
||||
"If enabled, the concentric pattern will be used for the area to speed up printing. "
|
||||
|
||||
@@ -1212,7 +1212,7 @@ void PrintObject::slice_volumes()
|
||||
apply_fuzzy_skin_segmentation(*this, [print]() { print->throw_if_canceled(); });
|
||||
}
|
||||
|
||||
InterlockingGenerator::generate_interlocking_structure(this);
|
||||
InterlockingGenerator::generate_interlocking_structure(this, [print]() { print->throw_if_canceled(); });
|
||||
m_print->throw_if_canceled();
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "Slicing volumes - make_slices in parallel - begin";
|
||||
|
||||
Reference in New Issue
Block a user