Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Thick bridges" prints thin and sparse bridges #9007

Closed
2 tasks done
espr14 opened this issue Oct 6, 2022 · 5 comments
Closed
2 tasks done

"Thick bridges" prints thin and sparse bridges #9007

espr14 opened this issue Oct 6, 2022 · 5 comments

Comments

@espr14
Copy link
Contributor

espr14 commented Oct 6, 2022

Description of the bug

"Thick bridge" ON creates thin and sparse bridges.

Project file & How to reproduce

thick bridges.3mf.zip

Let's start with default Prusa MK3S+ Quality 0.2 mm profiles and change external perimeter extrusion width to 1 mm. Now let's go through some combinations:

  1. thick bridges off, bridge flow 0.95: solid bridge with thick perimeter bridges
  2. thick bridges off, bridge flow 0.5: solid bridge with thick perimeter bridges
  3. thick bridges off, bridge flow 0.3: sparse bridge with thick perimeter bridges
  4. thick bridges on, bridge flow 0.95: sparse bridge with thin perimeter bridges
  5. thick bridges on, bridge flow 0.5: sparse bridge with thin perimeter bridges
  6. thick bridges on, bridge flow 0.3: sparse bridge with thin perimeter bridges

This is quite confusing.

Some examples:
thick bridges 1
thick bridges 2
thick bridges 3

Checklist of files included above

  • Project file
  • Screenshot

Version of PrusaSlicer

Version 2.5.0+win64

Operating system

Windows 10

Printer model

Prusa i3 MK3S+

@CodeMonkeyX
Copy link

I noticed a similar issue when trying 2.6 Alpha 6. I think it might be a bug.

I have "Thick Bridges" OFF.

If I set the bridge flow ratio to 0.7 then the bridges barely printed at all and made sparse bridges.
bridge_flow_0 7

Then if enter bridge flow 0.8 ratio I get completely different bridges. They are completely filled in now.
bridge_flow_0 8

That does not seem like what the behavior should be to me. Unless I am missing something I would expect 0.7 flow to only be slightly less dense than 0.8 not drastically different.

3dbenchy.zip

@parabelboi
Copy link

parabelboi commented Apr 19, 2023

I stumbled over the same problem with thick_bridges=off.

As stated in this (almost unrelated) issue (#10329), a tiny change in the extrusion width (in my case +3.7%) caused the bridge flow to be increased by more than 125%.

I think this is caused if thick_bridges=off and extrusion_width * layer_height > nozzle_diameter ^ 2 * Pi/4.
In that case the resulting bridge flow will be thicker than with thick_bridges=on.

If you try to compensate the overly thick bridges by reducing bridge_flow_ratio, you could end up with way-to-thin bridges at another part of the model.

The reason is, that the perimeter generator can create wider perimeters at some bridge, but not on the other.
Variable layer height might also cause this problem to appear "randomly".

I'd suggest to not try to workaround this by using bridge_flow_ratio (at least do not store the change permanently to your profile).

I hope I also found a very unintrusive fix:
If thick_bridges is disabled, just use the minimum flow of both calculation.

Update: The following change should be really fixing it (will be testing again):

diff --git a/src/libslic3r/LayerRegion.cpp b/src/libslic3r/LayerRegion.cpp
index d722f1e9c..056f24af7 100644
--- a/src/libslic3r/LayerRegion.cpp
+++ b/src/libslic3r/LayerRegion.cpp
@@ -32,17 +32,23 @@ Flow LayerRegion::bridging_flow(FlowRole role, bool force_thick_bridges) const
     const PrintRegion       &region         = this->region();
     const PrintRegionConfig &region_config  = region.config();
     const PrintObject       &print_object   = *this->layer()->object();
-    if (print_object.config().thick_bridges || force_thick_bridges) {
-        // The old Slic3r way (different from all other slicers): Use rounded extrusions.
-        // Get the configured nozzle_diameter for the extruder associated to the flow role requested.
-        // Here this->extruder(role) - 1 may underflow to MAX_INT, but then the get_at() will follback to zero'th element, so everything is all right.
-        auto nozzle_diameter = float(print_object.print()->config().nozzle_diameter.get_at(region.extruder(role) - 1));
-        // Applies default bridge spacing.
-        return Flow::bridging_flow(float(sqrt(region_config.bridge_flow_ratio)) * nozzle_diameter, nozzle_diameter);
-    } else {
-        // The same way as other slicers: Use normal extrusions. Apply bridge_flow_ratio while maintaining the original spacing.
-        return this->flow(role).with_flow_ratio(region_config.bridge_flow_ratio);
-    }
+
+    // The old Slic3r way (different from all other slicers): Use rounded extrusions.
+    // Get the configured nozzle_diameter for the extruder associated to the flow role requested.
+    // Here this->extruder(role) - 1 may underflow to MAX_INT, but then the get_at() will follback to zero'th element, so everything is all right.
+    const auto nozzle_diameter = float(print_object.print()->config().nozzle_diameter.get_at(region.extruder(role) - 1));
+    // Applies default bridge spacing.
+    const auto round_flow = Flow::bridging_flow(float(sqrt(region_config.bridge_flow_ratio)) * nozzle_diameter, nozzle_diameter);
+    // The same way as other slicers: Use normal extrusions. Apply bridge_flow_ratio while maintaining the original spacing.
+    const auto normal_flow = this->flow(role).with_flow_ratio(region_config.bridge_flow_ratio);
+
+    // If extrusion_width * layer_height > nozzle_diameter ^ 2 * Pi/4, "normal" flow can get much higher than the rounded flow
+    // In that case, bridges based on normal_flow would become thicker (and unusable) than with round_flow
+    // So, return rounded_flow to ensure that bridges are indeed thinner thick_bridges is disabled
+    if ((print_object.config().thick_bridges || force_thick_bridges) && (round_flow.mm3_per_mm() > normal_flow.mm3_per_mm()))
+        return round_flow;
+    else
+        return normal_flow;
 }

 // Fill in layerm->fill_surfaces by trimming the layerm->slices by layerm->fill_expolygons.

@kubispe1
Copy link
Collaborator

Hi, thanks for the issue @espr14 also thanks @parabelboi attached the pull request with your solution.
For now, we have detected a numerical bug in rounded extrusion calculation and it should be already fixed in our actual master.
You can check it with the next release.

@parabelboi
Copy link

parabelboi commented May 10, 2023

Hi, thanks for the issue @espr14 also thanks @parabelboi attached the pull request with your solution. For now, we have detected a numerical bug in rounded extrusion calculation and it should be already fixed in our actual master. You can check it with the next release.

Hi,

if I understood correctly, you are referring to a fix for the rounded model (which is "enable thick bridges").
But this bug-description clearly states that the problem also occurs when thick bridges were disabled.

cheers,
parabelboi

PS: Please also have a look at this analysis.

@Godrak
Copy link
Contributor

Godrak commented May 11, 2023

The fix affects bridge extrusion width both when thick bridges are enabled and disabled. Anytime the extrusion height gets bigger than its width, the code switches to use rounded extrusion model. However, there was a bug in the rounded extrusion model, which returned half the width it should have, which resulted in sudden jump into very thin bridges. We fixed the behavior, so when the extrusion height gets bigger than its width, the correct rounded extrusion parameters are applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants