<p>This answer should have been a comment, except I have included the relevant code.</p>

<p>To answer question 2, at a guess, <code>bridge</code> is simply a boolean (<code>bool</code>) that specifies whether there is a bridge or not.</p>

<p>From <a href="https://github.com/alexrj/Slic3r/blob/master/xs/src/libslic3r/Flow.hpp#L32" rel="nofollow noreferrer">Flow.hpp line 32</a></p>

<pre><code>/// Represents material flow; provides methods to predict material spacing. 
class Flow
{
    public:
    float width, height, nozzle_diameter;
    bool bridge;

    Flow(float _w, float _h, float _nd, bool _bridge = false)
        : width(_w), height(_h), nozzle_diameter(_nd), bridge(_bridge) {};
</code></pre>

<p>Additionally lines <a href="https://github.com/alexrj/Slic3r/blob/master/xs/src/libslic3r/Flow.hpp#L68" rel="nofollow noreferrer">68-73</a>, may also be of interest:</p>

<pre><code>    private:
    static float _bridge_width(float nozzle_diameter, float bridge_flow_ratio);
    /// Calculate a relatively sane extrusion width, based on height and nozzle diameter.
    /// Algorithm used does not play nice with layer heights &lt; 0.1mm. 
    static float _auto_width(FlowRole role, float nozzle_diameter, float height);
    static float _width_from_spacing(float spacing, float nozzle_diameter, float height, bool bridge);
</code></pre>

<p>However, your best bet, to get an accurate answer to <em>both</em> of your questions, is to contact <a href="https://github.com/alexrj" rel="nofollow noreferrer">Alessandro Ranellucci - alexrj</a>, and ask him - as he is is the designer of the Slic3r code. When you get a reply, maybe you would like to post the answer here... it may be useful for someone else.</p>

CC BY-SA 3.0
2017-05-22T01:19:14.763Z
2017-05-22T01:25:23.560Z
2017-05-22T01:25:23.560Z
Greenonline
<p>I'm doing research on changing the fill density into the air gap width, adjacent strand spacing, or whatever, instead of using the fill density, as it will give me more precise controls.</p>

<h2>Question 1:</h2>

<p>All I can work out is from Slic3r's the source code in <code>~/Slic3r/xs/src/libslic3r/Flow.cpp</code>,</p>

<p><a href="https://github.com/alexrj/Slic3r/blob/master/xs/src/libslic3r/Flow.cpp#L58" rel="nofollow noreferrer">Link to Flow.cpp source code</a></p>

<pre><code>/* This method returns the centerline spacing between an extrusion using this
   flow and another one using another flow.
   this-&gt;spacing(other) shall return the same value as other.spacing(*this) */

float Flow::spacing(const Flow &amp;other) const {
   assert(this-&gt;height == other.height);
   assert(this-&gt;bridge == other.bridge);

   if (this-&gt;bridge) {
      return this-&gt;width/2 + other.width/2 + BRIDGE_EXTRA_SPACING; //Line A
   }
   return this-&gt;spacing()/2 + other.spacing()/2;                   //Line B
}
</code></pre>

<p>If I am right, will changing <code>Line A</code> or <code>Line B</code>, be the right way to change its infill adjacent strand spacing? </p>

<h2>Question 2:</h2>

<p>And since we're on this topic, what does the <code>bridge</code> variable represent?</p>

<slic3r><infill>
Does anyone know how Slic3r determines its infill adjacent strand spacing, instead of using fill density?
Jiong Le
# Does anyone know how Slic3r determines its infill adjacent strand spacing, instead of using fill density?

(Asked by: username_0 on 2017-05-20)

I'm doing research on changing the fill density into the air gap width, adjacent strand spacing, or whatever, instead of using the fill density, as it will give me more precise controls.
Question 1:
All I can work out is from Slic3r's the source code in ~/Slic3r/xs/src/libslic3r/Flow.cpp,
Link to Flow.cpp source code
/* This method returns the centerline spacing between an extrusion using this
   flow and another one using another flow.
   this->spacing(other) shall return the same value as other.spacing(*this) */

float Flow::spacing(const Flow &other) const {
   assert(this->height == other.height);
   assert(this->bridge == other.bridge);

   if (this->bridge) {
      return this->width/2 + other.width/2 + BRIDGE_EXTRA_SPACING; //Line A
   }
   return this->spacing()/2 + other.spacing()/2;                   //Line B
}

If I am right, will changing Line A or Line B, be the right way to change its infill adjacent strand spacing? 
Question 2:
And since we're on this topic, what does the bridge variable represent?

**Tags:** slic3r, infill

---

## 1 answers

### Answer by username_1 on 2017-05-22. Score: 2

This answer should have been a comment, except I have included the relevant code.
To answer question 2, at a guess, bridge is simply a boolean (bool) that specifies whether there is a bridge or not.
From Flow.hpp line 32
/// Represents material flow; provides methods to predict material spacing. 
class Flow
{
    public:
    float width, height, nozzle_diameter;
    bool bridge;

    Flow(float _w, float _h, float _nd, bool _bridge = false)
        : width(_w), height(_h), nozzle_diameter(_nd), bridge(_bridge) {};

Additionally lines 68-73, may also be of interest:
    private:
    static float _bridge_width(float nozzle_diameter, float bridge_flow_ratio);
    /// Calculate a relatively sane extrusion width, based on height and nozzle diameter.
    /// Algorithm used does not play nice with layer heights < 0.1mm. 
    static float _auto_width(FlowRole role, float nozzle_diameter, float height);
    static float _width_from_spacing(float spacing, float nozzle_diameter, float height, bool bridge);

However, your best bet, to get an accurate answer to both of your questions, is to contact Alessandro Ranellucci - alexrj, and ask him - as he is is the designer of the Slic3r code. When you get a reply, maybe you would like to post the answer here... it may be useful for someone else.


---

