diff --git a/include/feature_generation/MeshFeatureGenerator.h b/include/feature_generation/MeshFeatureGenerator.h index a9161e7fd1..3b74abdd04 100644 --- a/include/feature_generation/MeshFeatureGenerator.h +++ b/include/feature_generation/MeshFeatureGenerator.h @@ -24,8 +24,7 @@ class MeshFeatureGenerator : public FeatureGenerator std::shared_ptr getMesh() const; virtual void - generateFeatures(const SliceDataStorage& storage, const LayerPlanPtr& layer_plan, const std::vector& extruder_plans, const SliceLayerPart& part) const - = 0; + generateFeatures(const SliceDataStorage& storage, const LayerPlanPtr& layer_plan, const std::vector& extruder_plans, const SliceLayerPart& part) const = 0; private: std::shared_ptr mesh_; diff --git a/src/settings/PathConfigStorage.cpp b/src/settings/PathConfigStorage.cpp index 753f27480d..35325e1869 100644 --- a/src/settings/PathConfigStorage.cpp +++ b/src/settings/PathConfigStorage.cpp @@ -43,50 +43,45 @@ PathConfigStorage::PathConfigStorage(const SliceDataStorage& storage, const Laye , support_roof_train(Application::getInstance().current_slice_->scene.extruders[support_roof_extruder_nr]) , support_bottom_train(Application::getInstance().current_slice_->scene.extruders[support_bottom_extruder_nr]) , line_width_factor_per_extruder(PathConfigStorage::getLineWidthFactorPerExtruder(layer_nr)) - , raft_base_config( - GCodePathConfig{ .type = PrintFeatureType::SupportInterface, - .line_width = raft_base_train.settings_.get("raft_base_line_width"), - .layer_thickness = raft_base_train.settings_.get("raft_base_thickness"), - .flow = raft_base_train.settings_.get("raft_base_flow"), - .speed_derivatives = SpeedDerivatives{ .speed = raft_base_train.settings_.get("raft_base_speed"), - .acceleration = raft_base_train.settings_.get("raft_base_acceleration"), - .jerk = raft_base_train.settings_.get("raft_base_jerk") } }) - , raft_interface_config( - GCodePathConfig{ .type = PrintFeatureType::Support, - .line_width = raft_interface_train.settings_.get("raft_interface_line_width"), - .layer_thickness = raft_interface_train.settings_.get("raft_interface_thickness"), - .flow = raft_base_train.settings_.get("raft_interface_flow"), - .speed_derivatives = SpeedDerivatives{ .speed = raft_interface_train.settings_.get("raft_interface_speed"), - .acceleration = raft_interface_train.settings_.get("raft_interface_acceleration"), - .jerk = raft_interface_train.settings_.get("raft_interface_jerk") } }) - , raft_surface_config( - GCodePathConfig{ .type = PrintFeatureType::SupportInterface, - .line_width = raft_surface_train.settings_.get("raft_surface_line_width"), - .layer_thickness = raft_surface_train.settings_.get("raft_surface_thickness"), - .flow = raft_base_train.settings_.get("raft_surface_flow"), - .speed_derivatives = SpeedDerivatives{ .speed = raft_surface_train.settings_.get("raft_surface_speed"), - .acceleration = raft_surface_train.settings_.get("raft_surface_acceleration"), - .jerk = raft_surface_train.settings_.get("raft_surface_jerk") } }) - , support_roof_config( - GCodePathConfig{ .type = PrintFeatureType::SupportInterface, - .line_width - = static_cast(support_roof_train.settings_.get("support_roof_line_width") * line_width_factor_per_extruder[support_roof_extruder_nr]), - .layer_thickness = layer_thickness, - .flow = support_roof_train.settings_.get("support_roof_material_flow") - * ((layer_nr == 0) ? support_roof_train.settings_.get("material_flow_layer_0") : Ratio(1.0)), - .speed_derivatives = { .speed = support_roof_train.settings_.get("speed_support_roof"), - .acceleration = support_roof_train.settings_.get("acceleration_support_roof"), - .jerk = support_roof_train.settings_.get("jerk_support_roof") } }) - , support_bottom_config( - GCodePathConfig{ .type = PrintFeatureType::SupportInterface, - .line_width = static_cast( - support_bottom_train.settings_.get("support_bottom_line_width") * line_width_factor_per_extruder[support_bottom_extruder_nr]), - .layer_thickness = layer_thickness, - .flow = support_roof_train.settings_.get("support_bottom_material_flow") - * ((layer_nr == 0) ? support_roof_train.settings_.get("material_flow_layer_0") : Ratio(1.0)), - .speed_derivatives = SpeedDerivatives{ .speed = support_bottom_train.settings_.get("speed_support_bottom"), - .acceleration = support_bottom_train.settings_.get("acceleration_support_bottom"), - .jerk = support_bottom_train.settings_.get("jerk_support_bottom") } }) + , raft_base_config(GCodePathConfig{ .type = PrintFeatureType::SupportInterface, + .line_width = raft_base_train.settings_.get("raft_base_line_width"), + .layer_thickness = raft_base_train.settings_.get("raft_base_thickness"), + .flow = raft_base_train.settings_.get("raft_base_flow"), + .speed_derivatives = SpeedDerivatives{ .speed = raft_base_train.settings_.get("raft_base_speed"), + .acceleration = raft_base_train.settings_.get("raft_base_acceleration"), + .jerk = raft_base_train.settings_.get("raft_base_jerk") } }) + , raft_interface_config(GCodePathConfig{ .type = PrintFeatureType::Support, + .line_width = raft_interface_train.settings_.get("raft_interface_line_width"), + .layer_thickness = raft_interface_train.settings_.get("raft_interface_thickness"), + .flow = raft_base_train.settings_.get("raft_interface_flow"), + .speed_derivatives = SpeedDerivatives{ .speed = raft_interface_train.settings_.get("raft_interface_speed"), + .acceleration = raft_interface_train.settings_.get("raft_interface_acceleration"), + .jerk = raft_interface_train.settings_.get("raft_interface_jerk") } }) + , raft_surface_config(GCodePathConfig{ .type = PrintFeatureType::SupportInterface, + .line_width = raft_surface_train.settings_.get("raft_surface_line_width"), + .layer_thickness = raft_surface_train.settings_.get("raft_surface_thickness"), + .flow = raft_base_train.settings_.get("raft_surface_flow"), + .speed_derivatives = SpeedDerivatives{ .speed = raft_surface_train.settings_.get("raft_surface_speed"), + .acceleration = raft_surface_train.settings_.get("raft_surface_acceleration"), + .jerk = raft_surface_train.settings_.get("raft_surface_jerk") } }) + , support_roof_config(GCodePathConfig{ + .type = PrintFeatureType::SupportInterface, + .line_width = static_cast(support_roof_train.settings_.get("support_roof_line_width") * line_width_factor_per_extruder[support_roof_extruder_nr]), + .layer_thickness = layer_thickness, + .flow = support_roof_train.settings_.get("support_roof_material_flow") + * ((layer_nr == 0) ? support_roof_train.settings_.get("material_flow_layer_0") : Ratio(1.0)), + .speed_derivatives = { .speed = support_roof_train.settings_.get("speed_support_roof"), + .acceleration = support_roof_train.settings_.get("acceleration_support_roof"), + .jerk = support_roof_train.settings_.get("jerk_support_roof") } }) + , support_bottom_config(GCodePathConfig{ + .type = PrintFeatureType::SupportInterface, + .line_width = static_cast(support_bottom_train.settings_.get("support_bottom_line_width") * line_width_factor_per_extruder[support_bottom_extruder_nr]), + .layer_thickness = layer_thickness, + .flow = support_roof_train.settings_.get("support_bottom_material_flow") + * ((layer_nr == 0) ? support_roof_train.settings_.get("material_flow_layer_0") : Ratio(1.0)), + .speed_derivatives = SpeedDerivatives{ .speed = support_bottom_train.settings_.get("speed_support_bottom"), + .acceleration = support_bottom_train.settings_.get("acceleration_support_bottom"), + .jerk = support_bottom_train.settings_.get("jerk_support_bottom") } }) { const size_t extruder_count = Application::getInstance().current_slice_->scene.extruders.size(); travel_config_per_extruder.reserve(extruder_count); @@ -96,14 +91,13 @@ PathConfigStorage::PathConfigStorage(const SliceDataStorage& storage, const Laye for (size_t extruder_nr = 0; extruder_nr < extruder_count; extruder_nr++) { const ExtruderTrain& train = Application::getInstance().current_slice_->scene.extruders[extruder_nr]; - travel_config_per_extruder.emplace_back( - GCodePathConfig{ .type = PrintFeatureType::MoveCombing, - .line_width = 0, - .layer_thickness = 0, - .flow = 0.0, - .speed_derivatives = SpeedDerivatives{ .speed = train.settings_.get("speed_travel"), - .acceleration = train.settings_.get("acceleration_travel"), - .jerk = train.settings_.get("jerk_travel") } }); + travel_config_per_extruder.emplace_back(GCodePathConfig{ .type = PrintFeatureType::MoveCombing, + .line_width = 0, + .layer_thickness = 0, + .flow = 0.0, + .speed_derivatives = SpeedDerivatives{ .speed = train.settings_.get("speed_travel"), + .acceleration = train.settings_.get("acceleration_travel"), + .jerk = train.settings_.get("jerk_travel") } }); skirt_brim_config_per_extruder.emplace_back( GCodePathConfig{ .type = PrintFeatureType::SkirtBrim, .line_width = static_cast( @@ -117,17 +111,16 @@ PathConfigStorage::PathConfigStorage(const SliceDataStorage& storage, const Laye .speed_derivatives = SpeedDerivatives{ .speed = train.settings_.get("skirt_brim_speed"), .acceleration = train.settings_.get("acceleration_skirt_brim"), .jerk = train.settings_.get("jerk_skirt_brim") } }); - prime_tower_config_per_extruder.emplace_back( - GCodePathConfig{ - .type = PrintFeatureType::PrimeTower, - .line_width = static_cast( - train.settings_.get("prime_tower_line_width") - * ((mesh_group_settings.get("adhesion_type") == EPlatformAdhesion::RAFT) ? 1.0_r : line_width_factor_per_extruder[extruder_nr])), - .layer_thickness = layer_thickness, - .flow = train.settings_.get("prime_tower_flow") * ((layer_nr == 0) ? train.settings_.get("material_flow_layer_0") : Ratio(1.0)), - .speed_derivatives = SpeedDerivatives{ .speed = train.settings_.get("speed_prime_tower"), - .acceleration = train.settings_.get("acceleration_prime_tower"), - .jerk = train.settings_.get("jerk_prime_tower") } }); + prime_tower_config_per_extruder.emplace_back(GCodePathConfig{ + .type = PrintFeatureType::PrimeTower, + .line_width = static_cast( + train.settings_.get("prime_tower_line_width") + * ((mesh_group_settings.get("adhesion_type") == EPlatformAdhesion::RAFT) ? 1.0_r : line_width_factor_per_extruder[extruder_nr])), + .layer_thickness = layer_thickness, + .flow = train.settings_.get("prime_tower_flow") * ((layer_nr == 0) ? train.settings_.get("material_flow_layer_0") : Ratio(1.0)), + .speed_derivatives = SpeedDerivatives{ .speed = train.settings_.get("speed_prime_tower"), + .acceleration = train.settings_.get("acceleration_prime_tower"), + .jerk = train.settings_.get("jerk_prime_tower") } }); } for (const std::shared_ptr& mesh_storage : storage.meshes) @@ -192,10 +185,9 @@ void PathConfigStorage::handleInitialLayerSpeedup(const SliceDataStorage& storag global_first_layer_config_per_extruder.reserve(Application::getInstance().current_slice_->scene.extruders.size()); for (const ExtruderTrain& extruder : Application::getInstance().current_slice_->scene.extruders) { - global_first_layer_config_per_extruder.emplace_back( - SpeedDerivatives{ .speed = extruder.settings_.get("speed_print_layer_0"), - .acceleration = extruder.settings_.get("acceleration_print_layer_0"), - .jerk = extruder.settings_.get("jerk_print_layer_0") }); + global_first_layer_config_per_extruder.emplace_back(SpeedDerivatives{ .speed = extruder.settings_.get("speed_print_layer_0"), + .acceleration = extruder.settings_.get("acceleration_print_layer_0"), + .jerk = extruder.settings_.get("jerk_print_layer_0") }); } { // support