mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 06:41:14 -06:00
merge upstream changes
Signed-off-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
This commit is contained in:
parent
1bdedb1c47
commit
2492e5d39c
156 changed files with 33597 additions and 65667 deletions
|
@ -181,7 +181,7 @@ bool GCode::gcode_label_objects = true;
|
|||
length *= (1. - gcodegen.writer().extruder()->retract_before_wipe());
|
||||
|
||||
//SoftFever: allow 100% retract before wipe
|
||||
// if (length > 0)
|
||||
if (length >= 0)
|
||||
{
|
||||
/* Calculate how long we need to travel in order to consume the required
|
||||
amount of retraction. In other words, how far do we move in XY at wipe_speed
|
||||
|
@ -1320,24 +1320,26 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||
if (print.config().print_sequence == PrintSequence::ByObject) {
|
||||
// Add each of the object's layers separately.
|
||||
for (auto object : print.objects()) {
|
||||
std::vector<coordf_t> zs;
|
||||
//BBS: fix the issue that total layer is not right
|
||||
std::vector<coord_t> zs;
|
||||
zs.reserve(object->layers().size() + object->support_layers().size());
|
||||
for (auto layer : object->layers())
|
||||
zs.push_back(layer->print_z);
|
||||
zs.push_back((coord_t)(layer->print_z / EPSILON));
|
||||
for (auto layer : object->support_layers())
|
||||
zs.push_back(layer->print_z);
|
||||
zs.push_back((coord_t)(layer->print_z / EPSILON));
|
||||
std::sort(zs.begin(), zs.end());
|
||||
m_layer_count += (unsigned int)(object->instances().size() * (std::unique(zs.begin(), zs.end()) - zs.begin()));
|
||||
}
|
||||
} else {
|
||||
// Print all objects with the same print_z together.
|
||||
std::vector<coordf_t> zs;
|
||||
//BBS: fix the issue that total layer is not right
|
||||
std::vector<coord_t> zs;
|
||||
for (auto object : print.objects()) {
|
||||
zs.reserve(zs.size() + object->layers().size() + object->support_layers().size());
|
||||
for (auto layer : object->layers())
|
||||
zs.push_back(layer->print_z);
|
||||
zs.push_back((coord_t)(layer->print_z / EPSILON));
|
||||
for (auto layer : object->support_layers())
|
||||
zs.push_back(layer->print_z);
|
||||
zs.push_back((coord_t)(layer->print_z / EPSILON));
|
||||
}
|
||||
std::sort(zs.begin(), zs.end());
|
||||
m_layer_count = (unsigned int)(std::unique(zs.begin(), zs.end()) - zs.begin());
|
||||
|
@ -1366,6 +1368,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||
file.write_format("; %s\n", Slic3r::header_slic3r_generated().c_str());
|
||||
//BBS: total estimated printing time
|
||||
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Estimated_Printing_Time_Placeholder).c_str());
|
||||
//BBS: total layer number
|
||||
file.write_format("; total layer number: %d\n", m_layer_count);
|
||||
file.write_format("; HEADER_BLOCK_END\n\n");
|
||||
|
||||
|
||||
|
@ -3841,8 +3845,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
|||
//BBS: Overhang_threshold_none means Overhang_threshold_1_4 and forcing cooling for all external perimeter
|
||||
int overhang_threshold = EXTRUDER_CONFIG(overhang_fan_threshold) == Overhang_threshold_none ?
|
||||
Overhang_threshold_none : EXTRUDER_CONFIG(overhang_fan_threshold) - 1;
|
||||
if ((EXTRUDER_CONFIG(overhang_fan_threshold) == Overhang_threshold_none && path.role() == erExternalPerimeter) ||
|
||||
path.get_overhang_degree() > overhang_threshold ||
|
||||
if ((EXTRUDER_CONFIG(overhang_fan_threshold) == Overhang_threshold_none && path.role() == erExternalPerimeter)) {
|
||||
gcode += ";_OVERHANG_FAN_START\n";
|
||||
comment = ";_EXTRUDE_SET_SPEED";
|
||||
} else if (path.get_overhang_degree() > overhang_threshold ||
|
||||
is_bridge(path.role()))
|
||||
gcode += ";_OVERHANG_FAN_START\n";
|
||||
else
|
||||
|
@ -3920,8 +3926,11 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
|||
//BBS: Overhang_threshold_none means Overhang_threshold_1_4 and forcing cooling for all external perimeter
|
||||
int overhang_threshold = EXTRUDER_CONFIG(overhang_fan_threshold) == Overhang_threshold_none ?
|
||||
Overhang_threshold_none : EXTRUDER_CONFIG(overhang_fan_threshold) - 1;
|
||||
if ((EXTRUDER_CONFIG(overhang_fan_threshold) == Overhang_threshold_none && path.role() == erExternalPerimeter) ||
|
||||
path.get_overhang_degree() > overhang_threshold ||
|
||||
if ((EXTRUDER_CONFIG(overhang_fan_threshold) == Overhang_threshold_none && path.role() == erExternalPerimeter)) {
|
||||
gcode += ";_EXTRUDE_END\n";
|
||||
gcode += ";_OVERHANG_FAN_END\n";
|
||||
|
||||
} else if (path.get_overhang_degree() > overhang_threshold ||
|
||||
is_bridge(path.role()))
|
||||
gcode += ";_OVERHANG_FAN_END\n";
|
||||
else
|
||||
|
|
|
@ -270,7 +270,8 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
|
|||
// get non 100% overhang paths by intersecting this loop with the grown lower slices
|
||||
Polylines remain_polines;
|
||||
|
||||
if (perimeter_generator.config->enable_overhang_speed) {
|
||||
//BBS: don't calculate overhang degree when enable fuzzy skin. It's unmeaning
|
||||
if (perimeter_generator.config->enable_overhang_speed && perimeter_generator.config->fuzzy_skin == FuzzySkinType::None) {
|
||||
for (auto it = lower_polygons_series->begin();
|
||||
it != lower_polygons_series->end(); it++)
|
||||
{
|
||||
|
|
|
@ -765,14 +765,14 @@ static StringObjectException layered_print_cleareance_valid(const Print &print,
|
|||
convex_hulls_temp.push_back(convex_hull);
|
||||
if (!intersection(convex_hulls_other, convex_hulls_temp).empty()) {
|
||||
if (warning) {
|
||||
warning->string = inst->model_instance->get_object()->name + L(" is too close to others, there may be collisions when printing.\n");
|
||||
warning->string = inst->model_instance->get_object()->name + L(" is too close to others, there may be collisions when printing.") + "\n";
|
||||
warning->object = inst->model_instance->get_object();
|
||||
}
|
||||
}
|
||||
if (!intersection(exclude_polys, convex_hull).empty()) {
|
||||
return {inst->model_instance->get_object()->name + L(" is too close to exclusion area, there may be collisions when printing.\n"), inst->model_instance->get_object()};
|
||||
return {inst->model_instance->get_object()->name + L(" is too close to exclusion area, there may be collisions when printing.") + "\n", inst->model_instance->get_object()};
|
||||
/*if (warning) {
|
||||
warning->string = inst->model_instance->get_object()->name + L(" is too close to exclusion area, there may be collisions when printing.\n");
|
||||
warning->string = inst->model_instance->get_object()->name + L(" is too close to exclusion area, there may be collisions when printing.") + "\n";
|
||||
warning->object = inst->model_instance->get_object();
|
||||
}*/
|
||||
}
|
||||
|
@ -1139,7 +1139,8 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
|
|||
}
|
||||
|
||||
StringObjectException except;
|
||||
except.string = format(L("Plate %d: %s does not support filament %s\n"), this->get_plate_index() + 1, L(bed_type_name), extruder_id + 1);
|
||||
except.string = format(L("Plate %d: %s does not support filament %s"), this->get_plate_index() + 1, L(bed_type_name), extruder_id + 1);
|
||||
except.string += "\n";
|
||||
except.type = STRING_EXCEPT_FILAMENT_NOT_MATCH_BED_TYPE;
|
||||
except.params.push_back(std::to_string(this->get_plate_index() + 1));
|
||||
except.params.push_back(L(bed_type_name));
|
||||
|
|
|
@ -1486,7 +1486,7 @@ void TreeSupport::generate_toolpaths()
|
|||
filler_interface->spacing = support_extrusion_width;
|
||||
|
||||
FillParams fill_params;
|
||||
fill_params.density = interface_density;
|
||||
fill_params.density = object_config.raft_first_layer_density * 0.01;
|
||||
fill_params.dont_adjust = true;
|
||||
|
||||
fill_expolygons_generate_paths(ts_layer->support_fills.entities, std::move(offset_ex(raft_areas, scale_(expand_offset))),
|
||||
|
@ -1596,14 +1596,13 @@ void TreeSupport::generate_toolpaths()
|
|||
// base_areas
|
||||
filler_support->spacing = support_flow.spacing();
|
||||
Flow flow = (layer_id == 0 && m_raft_layers == 0) ? m_object->print()->brim_flow() : support_flow;
|
||||
if (area_group.dist_to_top < 10 && !with_infill && m_object_config->support_style!=smsTreeHybrid) {
|
||||
if (layer_id>0 && area_group.dist_to_top < 10 && !with_infill && m_object_config->support_style!=smsTreeHybrid) {
|
||||
if (area_group.dist_to_top < 5) // 1 wall at the top <5mm
|
||||
make_perimeter_and_inner_brim(ts_layer->support_fills.entities, poly, 1, flow, erSupportMaterial);
|
||||
else // at least 2 walls for range [5,10)
|
||||
make_perimeter_and_inner_brim(ts_layer->support_fills.entities, poly, std::max(wall_count, size_t(2)), flow, erSupportMaterial);
|
||||
|
||||
} else {
|
||||
if (with_infill && layer_id > 0 && m_support_params.base_fill_pattern != ipLightning) {
|
||||
} else if (layer_id > 0 && with_infill && m_support_params.base_fill_pattern != ipLightning) {
|
||||
filler_support->angle = Geometry::deg2rad(object_config.support_angle.value);
|
||||
|
||||
// allow infill-only mode if support is thick enough
|
||||
|
@ -1614,11 +1613,12 @@ void TreeSupport::generate_toolpaths()
|
|||
make_perimeter_and_infill(ts_layer->support_fills.entities, *m_object->print(), poly, std::max(size_t(1), wall_count), flow,
|
||||
erSupportMaterial, filler_support.get(), support_density);
|
||||
}
|
||||
} else {
|
||||
make_perimeter_and_inner_brim(ts_layer->support_fills.entities, poly,
|
||||
layer_id > 0 ? wall_count : std::numeric_limits<size_t>::max(), flow, erSupportMaterial);
|
||||
}
|
||||
}
|
||||
else {
|
||||
make_perimeter_and_inner_brim(ts_layer->support_fills.entities, poly,
|
||||
layer_id > 0 ? wall_count : std::numeric_limits<size_t>::max(), flow, erSupportMaterial);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (m_support_params.base_fill_pattern == ipLightning)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue