diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index 1d77aa4716..c8429a3dc2 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -3089,7 +3089,7 @@ int CLI::run(int argc, char **argv) else { partplate_list.reset_size(old_printable_width, old_printable_depth, old_printable_height, false); } - partplate_list.set_shapes(make_counter_clockwise(current_printable_area), current_exclude_areas, bed_texture, height_to_lid, height_to_rod); + partplate_list.set_shapes(make_counter_clockwise(current_printable_area), current_exclude_area, current_extruder_areas, bed_texture, height_to_lid, height_to_rod); //plate_stride = partplate_list.plate_stride_x(); } diff --git a/src/libslic3r/BuildVolume.cpp b/src/libslic3r/BuildVolume.cpp index c0ff6c3912..6755a433bf 100644 --- a/src/libslic3r/BuildVolume.cpp +++ b/src/libslic3r/BuildVolume.cpp @@ -114,7 +114,7 @@ BuildVolume::BuildVolume(const std::vector &printable_area, const double if (extruder_shape.size() >= 4 && std::abs((poly_area - double(extruder_volume.bbox.size().x()) * double(extruder_volume.bbox.size().y()))) < sqr(SCALED_EPSILON)) { - extruder_volume.type = Type::Rectangle; + extruder_volume.type = BuildVolume_Type::Rectangle; extruder_volume.circle.center = 0.5 * (extruder_volume.bbox.min.cast() + extruder_volume.bbox.max.cast()); extruder_volume.circle.radius = 0.5 * extruder_volume.bbox.size().cast().norm(); } @@ -134,13 +134,13 @@ BuildVolume::BuildVolume(const std::vector &printable_area, const double prev = p; } if (is_circle) { - extruder_volume.type = Type::Circle; + extruder_volume.type = BuildVolume_Type::Circle; extruder_volume.circle.center = scaled(extruder_volume.circle.center); extruder_volume.circle.radius = scaled(extruder_volume.circle.radius); } } - if (m_type == Type::Invalid) { + if (m_type == BuildVolume_Type::Invalid) { //not supported currently, use the same as bed extruder_volume.same_with_bed = true; extruder_volume.type = m_type; @@ -428,25 +428,25 @@ BuildVolume::ObjectState BuildVolume::check_object_state_with_extruder_area(con if (!extruder_volume.same_with_bed) { switch (extruder_volume.type) { - case Type::Rectangle: + case BuildVolume_Type::Rectangle: { BoundingBox3Base build_volume = extruder_volume.bboxf.inflated(SceneEpsilon); if (m_max_print_height == 0.0) build_volume.max.z() = std::numeric_limits::max(); BoundingBox3Base build_volumef(build_volume.min.cast(), build_volume.max.cast()); - return_state = object_state_templ(its, trafo, false, [build_volumef](const Vec3f &pt) { return build_volumef.contains(pt); }); + return_state = object_state_templ(its, trafo, false, true, [build_volumef](const Vec3f &pt) { return build_volumef.contains(pt); }); break; } - case Type::Circle: + case BuildVolume_Type::Circle: { Geometry::Circlef circle { unscaled(extruder_volume.circle.center), unscaled(extruder_volume.circle.radius + SceneEpsilon) }; return_state = (m_max_print_height == 0.0) ? - object_state_templ(its, trafo, false, [circle](const Vec3f &pt) { return circle.contains(to_2d(pt)); }) : - object_state_templ(its, trafo, false, [circle, z = m_max_print_height + SceneEpsilon](const Vec3f &pt) { return pt.z() < z && circle.contains(to_2d(pt)); }); + object_state_templ(its, trafo, false, true, [circle](const Vec3f &pt) { return circle.contains(to_2d(pt)); }) : + object_state_templ(its, trafo, false, true, [circle, z = m_max_print_height + SceneEpsilon](const Vec3f &pt) { return pt.z() < z && circle.contains(to_2d(pt)); }); break; } - case Type::Invalid: + case BuildVolume_Type::Invalid: default: break; } diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 1046109e70..acbfbc34fd 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -716,7 +716,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config) // sanity check if(m_preheat_steps < 1) m_preheat_steps = 1; - m_result.backtrace_enabled = m_preheat_time > 0 && (m_is_XL_printer || (!m_single_extruder_multi_material && extruders_count > 1)); + m_result.backtrace_enabled = m_preheat_time > 0 && (m_is_XL_printer || (!m_single_extruder_multi_material && filament_count > 1)); assert(config.nozzle_volume.size() == config.nozzle_diameter.size()); m_nozzle_volume.resize(config.nozzle_volume.size()); @@ -5198,10 +5198,11 @@ void GCodeProcessor::update_slice_warnings() std::vectornozzle_hrc_lists(m_result.nozzle_type.size(), 0); // store the nozzle hrc of each extruder - for (size_t idx = 0; idx < m_result.nozzle_type.size(); ++idx) + for (size_t idx = 0; idx < m_result.nozzle_type.size(); ++idx) { nozzle_hrc_lists[idx] = m_result.nozzle_hrc; if(nozzle_hrc_lists[idx] <= 0) nozzle_hrc_lists[idx] = Print::get_hrc_by_nozzle_type(m_result.nozzle_type[idx]); + } for (size_t idx = 0; idx < used_filaments.size(); ++idx) { int filament_hrc = 0; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 7c8d55341f..9d934b1afb 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -689,7 +689,7 @@ class Print; bool m_wiping; bool m_flushing; bool m_wipe_tower; - float m_remaining_volume; + std::vector m_remaining_volume; bool m_manual_filament_change; //BBS: x, y offset for gcode generated diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index df4c3ca53f..e71e4e06e6 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -1094,8 +1094,9 @@ bool GLVolumeCollection::check_outside_state(const BuildVolume &build_volume, Mo { std::vector inside_extruders; state = plate_build_volume.check_volume_bbox_state_with_extruder_areas(bb, inside_extruders); - } + } break; + } case BuildVolume_Type::Circle: case BuildVolume_Type::Convex: //FIXME doing test on convex hull until we learn to do test on non-convex polygons efficiently. diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index 086ee1a6f8..1587b6aff4 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -2098,7 +2098,7 @@ bool PartPlate::check_outside(int obj_id, int instance_id, BoundingBoxf3* boundi // Orca: For sinking object, we use a more expensive algorithm so part below build plate won't be considered if (plate_box.intersects(instance_box)) { // TODO: FIXME: this does not take exclusion area into account - const BuildVolume build_volume(get_shape(), m_plater->build_volume().printable_height()); + const BuildVolume build_volume(get_shape(), m_plater->build_volume().printable_height(), m_extruder_areas); const auto state = instance->calc_print_volume_state(build_volume); outside = state == ModelInstancePVS_Partly_Outside; } @@ -3743,7 +3743,7 @@ void PartPlateList::reinit() void PartPlateList::update_plates() { update_all_plates_pos_and_size(true, false); - set_shapes(m_shape, m_exclude_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); + set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod); } int PartPlateList::create_plate(bool adjust_position)