diff --git a/src/libslic3r/Brim.cpp b/src/libslic3r/Brim.cpp index de6486869..a7835f3e9 100644 --- a/src/libslic3r/Brim.cpp +++ b/src/libslic3r/Brim.cpp @@ -806,7 +806,7 @@ double configBrimWidthByVolumes(double deltaT, double adhension, double maxSpeed } //BBS: config brimwidth by group of volumes -double configBrimWidthByVolumeGroups(double adhension, double maxSpeed, const std::vector modelVolumePtrs, const ExPolygons& expolys) +double configBrimWidthByVolumeGroups(double adhension, double maxSpeed, const std::vector modelVolumePtrs, const ExPolygons& expolys, double &groupHeight) { // height of a group of volumes double height = 0; @@ -824,7 +824,7 @@ double configBrimWidthByVolumeGroups(double adhension, double maxSpeed, const st } auto bbox_size = mergedBbx.size(); height = bbox_size(2); - + groupHeight = height; // second moment of the expolygons of the first layer of the volume group double Ixx = -1.e30, Iyy = -1.e30; if (!expolys.empty()) { @@ -843,8 +843,8 @@ double configBrimWidthByVolumeGroups(double adhension, double maxSpeed, const st double thermalLength = sqrt(bboxX * bboxX + bboxY * bboxY) * SCALING_FACTOR; double thermalLengthRef = Model::getThermalLength(modelVolumePtrs); - double height_to_area = std::max(height / Ixx * (bbox2.size()(1) * SCALING_FACTOR), height / Iyy * (bbox2.size()(0) * SCALING_FACTOR)); - double brim_width = adhension * std::min(std::min(std::max(height_to_area * maxSpeed / 24, thermalLength * 8. / thermalLengthRef * std::min(height, 30.) / 30.), 18.), 1.5 * thermalLength); + double height_to_area = std::max(height / Ixx * (bbox2.size()(1) * SCALING_FACTOR), height / Iyy * (bbox2.size()(0) * SCALING_FACTOR)) * height / 1920; + double brim_width = adhension * std::min(std::min(std::max(height_to_area * maxSpeed, thermalLength * 8. / thermalLengthRef * std::min(height, 30.) / 30.), 18.), 1.5 * thermalLength); // small brims are omitted if (brim_width < 5 && brim_width < 1.5 * thermalLength) brim_width = 0; @@ -915,17 +915,17 @@ static ExPolygons outer_inner_brim_area(const Print& print, if (currentModelVolumePtr != nullptr) groupVolumePtrs.push_back(currentModelVolumePtr); } if (groupVolumePtrs.empty()) continue; - + double groupHeight = 0.; // config brim width in auto-brim mode if (has_brim_auto) { - double brimWidthRaw = configBrimWidthByVolumeGroups(adhension, maxSpeed, groupVolumePtrs, volumeGroup.slices); + double brimWidthRaw = configBrimWidthByVolumeGroups(adhension, maxSpeed, groupVolumePtrs, volumeGroup.slices, groupHeight); brim_width = scale_(floor(brimWidthRaw / flowWidth / 2) * flowWidth * 2); } for (const ExPolygon& ex_poly : volumeGroup.slices) { // BBS: additional brim width will be added if part's adhension area is too small and brim is not generated float brim_width_mod; - if (brim_width < scale_(5.) && has_brim_auto) { + if (brim_width < scale_(5.) && has_brim_auto && groupHeight > 10.) { brim_width_mod = ex_poly.area() / ex_poly.contour.length() < scaled_half_min_adh_length && brim_width < scaled_flow_width ? brim_width + scaled_additional_brim_width : brim_width; } diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 2b5a7f1c8..73acda3b4 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -745,7 +745,6 @@ bool doesVolumeIntersect(VolumeSlices& vs1, VolumeSlices& vs2) if (vs1.volume_id == vs2.volume_id) return true; if (vs1.slices.size() != vs2.slices.size()) return false; - double offsetValue = 0.4 / SCALING_FACTOR; for (int i = 0; i != vs1.slices.size(); ++i) { if (vs1.slices[i].empty()) continue; @@ -766,7 +765,7 @@ bool groupingVolumes(std::vector objSliceByVolume, std::vector groupIndex(objSliceByVolume.size(), -1); - double offsetValue = 0.4 / SCALING_FACTOR; + double offsetValue = 0.15 / SCALING_FACTOR; for (int i = 0; i != objSliceByVolume.size(); ++i) { for (int j = 0; j != objSliceByVolume[i].slices.size(); ++j) {