mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-28 11:50:49 -07:00
Merge remote-tracking branch 'refs/remotes/SoftFever/main' into enh-spoolman-support
# Conflicts: # src/slic3r/GUI/Tab.cpp
This commit is contained in:
commit
5cf815c9a7
1964 changed files with 68569 additions and 25301 deletions
|
|
@ -1382,52 +1382,8 @@ namespace DoExport {
|
|||
double total_used_filament = 0.0;
|
||||
double total_weight = 0.0;
|
||||
double total_cost = 0.0;
|
||||
for (auto volume : result.print_statistics.volumes_per_extruder) {
|
||||
total_extruded_volume += volume.second;
|
||||
|
||||
size_t extruder_id = volume.first;
|
||||
auto extruder = std::find_if(extruders.begin(), extruders.end(), [extruder_id](const Extruder& extr) { return extr.id() == extruder_id; });
|
||||
if (extruder == extruders.end())
|
||||
continue;
|
||||
|
||||
double s = PI * sqr(0.5* extruder->filament_diameter());
|
||||
double weight = volume.second * extruder->filament_density() * 0.001;
|
||||
total_used_filament += volume.second/s;
|
||||
total_weight += weight;
|
||||
total_cost += weight * extruder->filament_cost() * 0.001;
|
||||
}
|
||||
//BBS: add flush volume
|
||||
for (auto volume : result.print_statistics.flush_per_filament) {
|
||||
total_extruded_volume += volume.second;
|
||||
|
||||
size_t extruder_id = volume.first;
|
||||
auto extruder = std::find_if(extruders.begin(), extruders.end(), [extruder_id](const Extruder& extr) { return extr.id() == extruder_id; });
|
||||
if (extruder == extruders.end())
|
||||
continue;
|
||||
|
||||
double s = PI * sqr(0.5* extruder->filament_diameter());
|
||||
double weight = volume.second * extruder->filament_density() * 0.001;
|
||||
total_used_filament += volume.second/s;
|
||||
total_weight += weight;
|
||||
total_cost += weight * extruder->filament_cost() * 0.001;
|
||||
}
|
||||
|
||||
for (auto volume : result.print_statistics.wipe_tower_volumes_per_extruder) {
|
||||
total_extruded_volume += volume.second;
|
||||
|
||||
size_t extruder_id = volume.first;
|
||||
auto extruder = std::find_if(extruders.begin(), extruders.end(), [extruder_id](const Extruder& extr) {return extr.id() == extruder_id; });
|
||||
if (extruder == extruders.end())
|
||||
continue;
|
||||
|
||||
double s = PI * sqr(0.5* extruder->filament_diameter());
|
||||
double weight = volume.second * extruder->filament_density() * 0.001;
|
||||
total_used_filament += volume.second/s;
|
||||
total_weight += weight;
|
||||
total_cost += weight * extruder->filament_cost() * 0.001;
|
||||
}
|
||||
|
||||
for (auto volume : result.print_statistics.support_volumes_per_extruder) {
|
||||
for (auto volume : result.print_statistics.total_volumes_per_extruder) {
|
||||
total_extruded_volume += volume.second;
|
||||
|
||||
size_t extruder_id = volume.first;
|
||||
|
|
@ -1447,7 +1403,7 @@ namespace DoExport {
|
|||
print_statistics.total_weight = total_weight;
|
||||
print_statistics.total_cost = total_cost;
|
||||
|
||||
print_statistics.filament_stats = result.print_statistics.volumes_per_extruder;
|
||||
print_statistics.filament_stats = result.print_statistics.model_volumes_per_extruder;
|
||||
}
|
||||
|
||||
// if any reserved keyword is found, returns a std::vector containing the first MAX_COUNT keywords found
|
||||
|
|
@ -2425,11 +2381,17 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||
auto probe_dist_y = std::max(1., m_config.bed_mesh_probe_distance.value.y());
|
||||
int probe_count_x = std::max(3, (int) std::ceil(mesh_bbox.size().x() / probe_dist_x));
|
||||
int probe_count_y = std::max(3, (int) std::ceil(mesh_bbox.size().y() / probe_dist_y));
|
||||
this->placeholder_parser().set("bed_mesh_probe_count", new ConfigOptionInts({probe_count_x, probe_count_y}));
|
||||
auto bed_mesh_algo = "bicubic";
|
||||
if (probe_count_x < 4 || probe_count_y < 4) {
|
||||
if (probe_count_x * probe_count_y <= 6) { // lagrange needs up to a total of 6 mesh points
|
||||
bed_mesh_algo = "lagrange";
|
||||
}
|
||||
else
|
||||
if(print.config().gcode_flavor == gcfKlipper){
|
||||
// bicubic needs 4 probe points per axis
|
||||
probe_count_x = std::max(probe_count_x,4);
|
||||
probe_count_y = std::max(probe_count_y,4);
|
||||
}
|
||||
this->placeholder_parser().set("bed_mesh_probe_count", new ConfigOptionInts({probe_count_x, probe_count_y}));
|
||||
this->placeholder_parser().set("bed_mesh_algo", bed_mesh_algo);
|
||||
// get center without wipe tower
|
||||
BoundingBoxf bbox_wo_wt; // bounding box without wipe tower
|
||||
|
|
@ -2466,6 +2428,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||
this->placeholder_parser().set("first_layer_temperature", new ConfigOptionInts(m_config.nozzle_temperature_initial_layer));
|
||||
this->placeholder_parser().set("max_print_height",new ConfigOptionInt(m_config.printable_height));
|
||||
this->placeholder_parser().set("z_offset", new ConfigOptionFloat(m_config.z_offset));
|
||||
this->placeholder_parser().set("model_name", new ConfigOptionString(print.get_model_name()));
|
||||
this->placeholder_parser().set("plate_number", new ConfigOptionString(print.get_plate_number_formatted()));
|
||||
this->placeholder_parser().set("plate_name", new ConfigOptionString(print.get_plate_name()));
|
||||
this->placeholder_parser().set("first_layer_height", new ConfigOptionFloat(m_config.initial_layer_print_height.value));
|
||||
|
||||
|
|
@ -3519,13 +3483,15 @@ namespace Skirt {
|
|||
size_t lines_per_extruder = (n_loops + n_tools - 1) / n_tools;
|
||||
|
||||
// BBS. Extrude skirt with first extruder if min_skirt_length is zero
|
||||
const PrintConfig &config = print.config();
|
||||
if (Print::min_skirt_length < EPSILON) {
|
||||
//ORCA: Always extrude skirt with first extruder, independantly of if the minimum skirt length is zero or not. The code below
|
||||
// is left as a placeholder for when a multiextruder support is implemented. Then we will need to extrude the skirt loops for each extruder.
|
||||
//const PrintConfig &config = print.config();
|
||||
//if (config.min_skirt_length.value < EPSILON) {
|
||||
skirt_loops_per_extruder_out[layer_tools.extruders.front()] = std::pair<size_t, size_t>(0, n_loops);
|
||||
} else {
|
||||
for (size_t i = 0; i < n_loops; i += lines_per_extruder)
|
||||
skirt_loops_per_extruder_out[layer_tools.extruders[i / lines_per_extruder]] = std::pair<size_t, size_t>(i, std::min(i + lines_per_extruder, n_loops));
|
||||
}
|
||||
//} else {
|
||||
// for (size_t i = 0; i < n_loops; i += lines_per_extruder)
|
||||
// skirt_loops_per_extruder_out[layer_tools.extruders[i / lines_per_extruder]] = std::pair<size_t, size_t>(i, std::min(i + lines_per_extruder, n_loops));
|
||||
//}
|
||||
}
|
||||
|
||||
static std::map<unsigned int, std::pair<size_t, size_t>> make_skirt_loops_per_extruder_1st_layer(
|
||||
|
|
@ -5260,7 +5226,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
|||
speed = m_config.get_abs_value("initial_layer_speed");
|
||||
}
|
||||
else if(m_config.slow_down_layers > 1){
|
||||
const auto _layer = layer_id() + 1;
|
||||
const auto _layer = layer_id();
|
||||
if (_layer > 0 && _layer < m_config.slow_down_layers) {
|
||||
const auto first_layer_speed =
|
||||
is_perimeter(path.role())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue