<p>So let’s say I have the G-code file for 3D printing a cube, and I have a density function F(x,y,z). How would I change, in G-code, the density at each specific point in the cube, so it has the general distribution of the function?</p>
<p>I’m thinking of just changing the extrusion rate proportional to the density, but I would like something more accurate.</p>

CC BY-SA 4.0
2023-10-14T03:05:40.000Z
Could you please explain how a change in density relates to 3D printing?
agarza
CC BY-SA 4.0
2023-10-14T15:26:07.957Z
I apologize. I meant, if I wanted to 3D print, in GCode, a cube of a specified length which has a density distribution described some function F(x,,y,z)
MeltedStatementRecognizing
CC BY-SA 4.0
2023-10-15T21:13:16.103Z
Why do you want to do that? And what is the density? Is this related to the infill or the actual density? A G-code is sliced geometry containing the information of the selected options during slicing, if you change the extrusion modifier, your geometry will also change if applied to the walls.
0scar
CC BY-SA 4.0
2023-10-16T14:26:36.763Z
@0scar, I mean the actual density. I want the density of the cube to vary according to the function. I just thought it would be a fun project. Are you saying that if I change the density at the walls, I will have to change the shape of the cube?
MeltedStatementRecognizing
CC BY-SA 4.0
2023-10-17T10:23:02.010Z
If you change the extrusion modifier, the lines get wider, so you need to apply this to the infill only, otherwise you'll get a distorted print object.
0scar
<print-quality><g-code>
How to approximately change the density at a specific point in G-code
MeltedStatementRecognizing
# How to approximately change the density at a specific point in G-code

(Asked by: username_0 on 2023-10-13)

So let’s say I have the G-code file for 3D printing a cube, and I have a density function F(x,y,z). How would I change, in G-code, the density at each specific point in the cube, so it has the general distribution of the function?

I’m thinking of just changing the extrusion rate proportional to the density, but I would like something more accurate.

**Tags:** print-quality, g-code

> **Comments:**
> **username_1**: Could you please explain how a change in density relates to 3D printing?  
> **username_0**: I apologize. I meant, if I wanted to 3D print, in GCode, a cube of a specified length which has a density distribution described some function F(x,,y,z)  
> **username_2**: Why do you want to do that? And what is the density? Is this related to the infill or the actual density? A G-code is sliced geometry containing the information of the selected options during slicing, if you change the extrusion modifier, your geometry will also change if applied to the walls.  
> **username_0**: @username_2, I mean the actual density. I want the density of the cube to vary according to the function. I just thought it would be a fun project. Are you saying that if I change the density at the walls, I will have to change the shape of the cube?  
> **username_2**: If you change the extrusion modifier, the lines get wider, so you need to apply this to the infill only, otherwise you'll get a distorted print object.  

---

## 0 answers

