<p>Very interesting idea!
There may be a way to do this semi-automatically, but I believe it's not yet a part of any slicer.</p>

<p>My suggestion would be:</p>

<ul>
<li>Export file as .stl (Fusion 360)</li>
<li>Use a DLP slicer to create images of the layers (CHITUBox)</li>
<li>Calculate the area of each of the images (Matlab - I think?)</li>
<li>Calculate the required infill percentages for having the same mass on each layer (Excel)</li>
<li>Open the model in PrusaSlicer, create a single "height range modifier" (PrusaSlicer)</li>
<li>Save the project as .3mf (PrusaSlicer)</li>
<li>Extract the .3mf file (7 Zip)</li>
<li>Create the neccessary "layer config ranges" texts for PrusaSlicer (Excel)</li>
<li>Inject that text into an extrated .3mf file (Notepad++)</li>
<li>Pack the .3mf file again (7 Zip)</li>
<li>Slice the resulting file (PrusaSlicer)</li>
</ul>

CC BY-SA 4.0
2020-01-06T13:46:36.750Z
2020-01-06T13:46:36.750Z
towe
<p>I think you have a major XY problem. The amount of material per layer is not what determines the part strength. Unless additional material is placed in a manner that reinforces against the stress you're designing for, it's just wasted. Moreover, infill in particular is not terribly useful this way, as infill has to rest upon the support of existing infill below it. If you suddenly increase infill density at a particular layer, it will not provide any significant additional strength because the added lines will be unsupported and will not bond strongly to anything. Even the next layer above them, and the next after that for quite a few layers, will not bond well because the unsupported lines can just bend downward when the nozzle goes over them, rather than providing a surface for the newly deposited material to press firmly against and bond to.</p>

<p>Generally, infill is not your main source of part strength anyway. I would start out (especially if you can test; if this is a one-off thing, the material cost is not going to be an issue anyway and just go with overkill) by increasing the number of wall lines (wall thickness). Walls generally provide the most strength, and the amount of material used will be proportional to cross-sectional perimeter rather than area, which typically will vary "linearly" rather than "quadratically" (I use these terms loosely since I don't know right off how to make it rigorous - what the independent variable should be thought of as being). My usual default (and I believe Cura's) is 2 walls; I would expect 4-5 to be very strong, and as long as you keep at least 15-20% infill, probably stronger than what you'd get by any increase in infill percent.</p>

CC BY-SA 4.0
2020-01-06T15:01:29.063Z
My idea was to use a cubic or gyro infill, which I expected to be suited for variable changes. Hexagon is surely better for compressive forces like I have, but as you say, it is based on stacking of adjacent layers which would not be my case. I'll think more about the issues you raised.
FarO
CC BY-SA 4.0
2020-01-06T16:07:34.433Z
**All** types of infill (and FDM deposition in general) are based on pressing adjacent layers together; it's just a matter of whether the new layer 100% coincodes with the lines of the previous one, of whether it's only partially overlapping. But wherever you have lines in the new layer that don't at least mostly overlap with ones in the previous layer, you'll have weaker structure. As a rule of thumb, you want the lines of the new layer to deviate by at most around 1/2 the extrusion line width from the lines below them.
R.. GitHub STOP HELPING ICE
CC BY-SA 4.0
2020-01-06T16:43:28.090Z
Then the best solution would be to do something like https://www.youtube.com/watch?v=q0YsC53mFvY where solid infill is placed along the lines of stress.
FarO
CC BY-SA 4.0
2020-01-06T17:06:06.090Z
@FarO: That looks like it's using modifier meshes, which only works well if you have isolated parts that can be independently supported to use different infill for. Otherwise, I would skip slicer generation of infill entirely and instead design your model hollow with whatever infill structure you want to use. A cheap approximation of this is just putting very thin gaps inside your model (otherwise leaving it solid) wherever you want to generate walls rather than infill.
R.. GitHub STOP HELPING ICE
CC BY-SA 4.0
2020-01-06T14:48:07.333Z
2020-01-06T14:48:07.333Z
R.. GitHub STOP HELPING ICE
<p>I am designing a part with a material which can bear up to a certain stress. </p>

<p>To keep the stress within the design limits, I need to ensure a certain surface of solid material per layer, in other words a minimum amount of extruded filament per layer and a smoothly changing infill ratio so that the infill can transmit the load efficiently to the neighbouring layers.</p>

<p>The part has an irregular shape and I cannot simply increase the infill ratio for the whole object because the part is big and it would cost more time and filament. I also cannot build straight pillars of solid material inside the part because there are no regions which are suitable for a continuous pillar.</p>

<p>How can I calculate and apply a smoothly changing infill ratio or in general how to ensure that each layer is made of at least a certain amount of material?</p>

<p>I use Prusa Slicer for slicing and Fusion 360 for the design.</p>

<p>Related questions about variable infill, which however don't answer my question because I need to specify the amount of material and because I need a smoothly changing infill ratio:</p>

<p><a href="https://3dprinting.stackexchange.com/questions/6522/different-infill-in-the-same-part">Different infill in the same part</a></p>

<p><a href="https://3dprinting.stackexchange.com/questions/7025/slic3r-can-i-vary-the-infill-percentage-for-different-heights-of-my-model">slic3r: Can I vary the infill percentage for different heights of my model?</a> </p>

<slicing><infill>
How to slice a model to ensure at least a certain amount of filament per layer?
FarO
# How to slice a model to ensure at least a certain amount of filament per layer?

(Asked by: username_0 on 2020-01-06)

I am designing a part with a material which can bear up to a certain stress.

To keep the stress within the design limits, I need to ensure a certain surface of solid material per layer, in other words a minimum amount of extruded filament per layer and a smoothly changing infill ratio so that the infill can transmit the load efficiently to the neighbouring layers.

The part has an irregular shape and I cannot simply increase the infill ratio for the whole object because the part is big and it would cost more time and filament. I also cannot build straight pillars of solid material inside the part because there are no regions which are suitable for a continuous pillar.

How can I calculate and apply a smoothly changing infill ratio or in general how to ensure that each layer is made of at least a certain amount of material?

I use Prusa Slicer for slicing and Fusion 360 for the design.

Related questions about variable infill, which however don't answer my question because I need to specify the amount of material and because I need a smoothly changing infill ratio:

[Different infill in the same part](https://3dprinting.stackexchange.com/questions/6522/different-infill-in-the-same-part)

[slic3r: Can I vary the infill percentage for different heights of my model?](https://3dprinting.stackexchange.com/questions/7025/slic3r-can-i-vary-the-infill-percentage-for-different-heights-of-my-model)

**Tags:** slicing, infill

---

## 2 answers

### Answer by username_1 on 2020-01-06. Score: 0 | Accepted answer

Very interesting idea!
There may be a way to do this semi-automatically, but I believe it's not yet a part of any slicer.

My suggestion would be:

* Export file as .stl (Fusion 360)
* Use a DLP slicer to create images of the layers (CHITUBox)
* Calculate the area of each of the images (Matlab - I think?)
* Calculate the required infill percentages for having the same mass on each layer (Excel)
* Open the model in PrusaSlicer, create a single "height range modifier" (PrusaSlicer)
* Save the project as .3mf (PrusaSlicer)
* Extract the .3mf file (7 Zip)
* Create the neccessary "layer config ranges" texts for PrusaSlicer (Excel)
* Inject that text into an extrated .3mf file (Notepad++)
* Pack the .3mf file again (7 Zip)
* Slice the resulting file (PrusaSlicer)


---

### Answer by username_2 on 2020-01-06. Score: 2

I think you have a major XY problem. The amount of material per layer is not what determines the part strength. Unless additional material is placed in a manner that reinforces against the stress you're designing for, it's just wasted. Moreover, infill in particular is not terribly useful this way, as infill has to rest upon the support of existing infill below it. If you suddenly increase infill density at a particular layer, it will not provide any significant additional strength because the added lines will be unsupported and will not bond strongly to anything. Even the next layer above them, and the next after that for quite a few layers, will not bond well because the unsupported lines can just bend downward when the nozzle goes over them, rather than providing a surface for the newly deposited material to press firmly against and bond to.

Generally, infill is not your main source of part strength anyway. I would start out (especially if you can test; if this is a one-off thing, the material cost is not going to be an issue anyway and just go with overkill) by increasing the number of wall lines (wall thickness). Walls generally provide the most strength, and the amount of material used will be proportional to cross-sectional perimeter rather than area, which typically will vary "linearly" rather than "quadratically" (I use these terms loosely since I don't know right off how to make it rigorous - what the independent variable should be thought of as being). My usual default (and I believe Cura's) is 2 walls; I would expect 4-5 to be very strong, and as long as you keep at least 15-20% infill, probably stronger than what you'd get by any increase in infill percent.

> **Comments:**
> **username_0**: My idea was to use a cubic or gyro infill, which I expected to be suited for variable changes. Hexagon is surely better for compressive forces like I have, but as you say, it is based on stacking of adjacent layers which would not be my case. I'll think more about the issues you raised.  
> **username_2**: **All** types of infill (and FDM deposition in general) are based on pressing adjacent layers together; it's just a matter of whether the new layer 100% coincodes with the lines of the previous one, of whether it's only partially overlapping. But wherever you have lines in the new layer that don't at least mostly overlap with ones in the previous layer, you'll have weaker structure. As a rule of thumb, you want the lines of the new layer to deviate by at most around 1/2 the extrusion line width from the lines below them.  
> **username_0**: Then the best solution would be to do something like https://www.youtube.com/watch?v=q0YsC53mFvY where solid infill is placed along the lines of stress.  
> **username_2**: @FarO: That looks like it's using modifier meshes, which only works well if you have isolated parts that can be independently supported to use different infill for. Otherwise, I would skip slicer generation of infill entirely and instead design your model hollow with whatever infill structure you want to use. A cheap approximation of this is just putting very thin gaps inside your model (otherwise leaving it solid) wherever you want to generate walls rather than infill.  

---

