diff options
Diffstat (limited to 'src/libslic3r')
-rw-r--r-- | src/libslic3r/Model.cpp | 31 | ||||
-rw-r--r-- | src/libslic3r/MultiMaterialSegmentation.cpp | 2 | ||||
-rw-r--r-- | src/libslic3r/Print.cpp | 2 | ||||
-rw-r--r-- | src/libslic3r/PrintApply.cpp | 2 | ||||
-rw-r--r-- | src/libslic3r/PrintConfig.hpp | 2 | ||||
-rw-r--r-- | src/libslic3r/PrintObject.cpp | 1 |
6 files changed, 16 insertions, 24 deletions
diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index ce359e7bf..a212f2be1 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -2075,43 +2075,34 @@ bool model_volume_list_changed(const ModelObject &model_object_old, const ModelO }); } -bool model_custom_supports_data_changed(const ModelObject& mo, const ModelObject& mo_new) { +bool model_custom_supports_data_changed(const ModelObject& mo, const ModelObject& mo_new) +{ assert(! model_volume_list_changed(mo, mo_new, ModelVolumeType::MODEL_PART)); - // FIXME Lukas H.: Because of adding another mesh modifiers when slicing, then assert triggered and possible crash. It requires changing the integration of MMU segmentation. -// assert(mo.volumes.size() == mo_new.volumes.size()); -// for (size_t i=0; i<mo.volumes.size(); ++i) { - for (size_t i=0; i<std::min(mo.volumes.size(), mo_new.volumes.size()); ++i) { + for (size_t i = 0; i < mo.volumes.size(); ++ i) if (! mo_new.volumes[i]->supported_facets.timestamp_matches(mo.volumes[i]->supported_facets)) return true; - } return false; } -bool model_custom_seam_data_changed(const ModelObject& mo, const ModelObject& mo_new) { +bool model_custom_seam_data_changed(const ModelObject& mo, const ModelObject& mo_new) +{ assert(! model_volume_list_changed(mo, mo_new, ModelVolumeType::MODEL_PART)); - // FIXME Lukas H.: Because of adding another mesh modifiers when slicing, then assert triggered and possible crash. It requires changing the integration of MMU segmentation. -// assert(mo.volumes.size() == mo_new.volumes.size()); -// for (size_t i=0; i<mo.volumes.size(); ++i) { - for (size_t i=0; i<std::min(mo.volumes.size(), mo_new.volumes.size()); ++i) { + for (size_t i = 0; i < mo.volumes.size(); ++ i) if (! mo_new.volumes[i]->seam_facets.timestamp_matches(mo.volumes[i]->seam_facets)) return true; - } return false; } -bool model_mmu_segmentation_data_changed(const ModelObject& mo, const ModelObject& mo_new) { +bool model_mmu_segmentation_data_changed(const ModelObject& mo, const ModelObject& mo_new) +{ assert(! model_volume_list_changed(mo, mo_new, ModelVolumeType::MODEL_PART)); - // FIXME Lukas H.: Because of adding another mesh modifiers when slicing, then assert triggered and possible crash. It requires changing the integration of MMU segmentation. -// assert(mo.volumes.size() == mo_new.volumes.size()); -// for (size_t i=0; i<mo.volumes.size(); ++i) { - for (size_t i=0; i<std::min(mo.volumes.size(), mo_new.volumes.size()); ++i) { + for (size_t i = 0; i < mo.volumes.size(); ++ i) if (! mo_new.volumes[i]->mmu_segmentation_facets.timestamp_matches(mo.volumes[i]->mmu_segmentation_facets)) return true; - } return false; } -extern bool model_has_multi_part_objects(const Model &model) +bool model_has_multi_part_objects(const Model &model) { for (const ModelObject *model_object : model.objects) if (model_object->volumes.size() != 1 || ! model_object->volumes.front()->is_model_part()) @@ -2119,7 +2110,7 @@ extern bool model_has_multi_part_objects(const Model &model) return false; } -extern bool model_has_advanced_features(const Model &model) +bool model_has_advanced_features(const Model &model) { auto config_is_advanced = [](const ModelConfig &config) { return ! (config.empty() || (config.size() == 1 && config.cbegin()->first == "extruder")); diff --git a/src/libslic3r/MultiMaterialSegmentation.cpp b/src/libslic3r/MultiMaterialSegmentation.cpp index 778a64018..8ddb115c2 100644 --- a/src/libslic3r/MultiMaterialSegmentation.cpp +++ b/src/libslic3r/MultiMaterialSegmentation.cpp @@ -1511,7 +1511,7 @@ std::vector<std::vector<std::pair<ExPolygon, size_t>>> multi_material_segmentati } }); // end of parallel_for - if (auto w = print_object.print()->config().mmu_segmented_region_max_width; w > 0.f) + if (auto w = print_object.config().mmu_segmented_region_max_width; w > 0.f) cut_segmented_layers(input_expolygons, segmented_regions, float(-scale_(w))); // return segmented_regions; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 8288ddb19..99119f566 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -216,8 +216,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n osteps.emplace_back(posSupportMaterial); steps.emplace_back(psSkirt); steps.emplace_back(psBrim); - } else if (opt_key == "mmu_segmented_region_max_width") { - invalidated |= this->invalidate_all_steps(); } else { // for legacy, if we can't handle this option let's invalidate all steps //FIXME invalidate all steps of all objects as well? diff --git a/src/libslic3r/PrintApply.cpp b/src/libslic3r/PrintApply.cpp index 003305c4d..6b6b94f7d 100644 --- a/src/libslic3r/PrintApply.cpp +++ b/src/libslic3r/PrintApply.cpp @@ -72,6 +72,8 @@ static inline void model_volume_list_copy_configs(ModelObject &model_object_dst, mv_dst.supported_facets.assign(mv_src.supported_facets); assert(mv_dst.seam_facets.id() == mv_src.seam_facets.id()); mv_dst.seam_facets.assign(mv_src.seam_facets); + assert(mv_dst.mmu_segmentation_facets.id() == mv_src.mmu_segmentation_facets.id()); + mv_dst.mmu_segmentation_facets.assign(mv_src.mmu_segmentation_facets); //FIXME what to do with the materials? // mv_dst.m_material_id = mv_src.m_material_id; ++ i_src; diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index e7bc1ded5..a4a52f7d4 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -443,6 +443,7 @@ PRINT_CONFIG_CLASS_DEFINE( // Force the generation of solid shells between adjacent materials/volumes. ((ConfigOptionBool, interface_shells)) ((ConfigOptionFloat, layer_height)) + ((ConfigOptionFloat, mmu_segmented_region_max_width)) ((ConfigOptionFloat, raft_contact_distance)) ((ConfigOptionFloat, raft_expansion)) ((ConfigOptionPercent, raft_first_layer_density)) @@ -699,7 +700,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, max_print_height)) ((ConfigOptionFloats, min_print_speed)) ((ConfigOptionFloat, min_skirt_length)) - ((ConfigOptionFloat, mmu_segmented_region_max_width)) ((ConfigOptionString, notes)) ((ConfigOptionFloats, nozzle_diameter)) ((ConfigOptionBool, only_retract_when_crossing_perimeters)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index d5808a1f3..df635a249 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -523,6 +523,7 @@ bool PrintObject::invalidate_state_by_config_options( } else if ( opt_key == "layer_height" || opt_key == "first_layer_height" + || opt_key == "mmu_segmented_region_max_width" || opt_key == "raft_layers" || opt_key == "raft_contact_distance" || opt_key == "slice_closing_radius") { |