<p>To draw a circle, you need to approximate the circle as a sufficient number of line segments. This requires computing or using a table of sine and cosine values for each angle step. Then you just emit a sequence of <code>G1</code> commands.</p>
<p>Some printer firmware also supports arc drawing commands you could use instead in principle, but support is not widespread, and the quality of the results varies enough that I would not recommend trying to do it this way.</p>

CC BY-SA 4.0
2021-11-23T14:10:09.557Z
2021-11-23T14:10:09.557Z
R.. GitHub STOP HELPING ICE
<p>While many 3D printers support using G2 and G3 for circles and arcs, most people are not used to them because the STL files consist entirely of flat triangles (straight lines).</p>
<p>If you want a simple 2D circle, see the following for help:</p>
<p><a href="https://marlinfw.org/docs/gcode/G002-G003.html" rel="nofollow noreferrer">https://marlinfw.org/docs/gcode/G002-G003.html</a></p>
<p><a href="https://makezine.com/2016/10/24/get-to-know-your-cnc-how-to-read-g-code/" rel="nofollow noreferrer">https://makezine.com/2016/10/24/get-to-know-your-cnc-how-to-read-g-code/</a></p>
<p><a href="https://reprap.org/wiki/G-code#G2_.26_G3:_Controlled_Arc_Move" rel="nofollow noreferrer">https://reprap.org/wiki/G-code#G2_.26_G3:_Controlled_Arc_Move</a></p>
<p>Note: it can take a while to get used to the I and J parameters.</p>

CC BY-SA 4.0
2021-11-23T17:12:11.257Z
2021-11-23T17:12:11.257Z
Davo
<p>I thought I am not bad at Google, but simply I am unable to find a G-code for doing circular motion for nozzle cleaning. It is possible to write a simple circular motion in G-code?</p>

CC BY-SA 4.0
2021-12-25T21:43:44.817Z
Marlin's g-code reference is so good that I don't Google for this kind off information anymore; I go rightly to it.
mguima
<g-code>
Drawing simple circle in G-code
user66638
# Drawing simple circle in G-code

(Asked by: username_0 on 2021-11-23)

I thought I am not bad at Google, but simply I am unable to find a G-code for doing circular motion for nozzle cleaning. It is possible to write a simple circular motion in G-code?

**Tags:** g-code
> **Comments:**
> **username_1**: Marlin's g-code reference is so good that I don't Google for this kind off information anymore; I go rightly to it.  

---

## 2 answers

### Answer by username_2 on 2021-11-23. Score: 2

To draw a circle, you need to approximate the circle as a sufficient number of line segments. This requires computing or using a table of sine and cosine values for each angle step. Then you just emit a sequence of `G1` commands.

Some printer firmware also supports arc drawing commands you could use instead in principle, but support is not widespread, and the quality of the results varies enough that I would not recommend trying to do it this way.


---

### Answer by username_3 on 2021-11-23. Score: 1

While many 3D printers support using G2 and G3 for circles and arcs, most people are not used to them because the STL files consist entirely of flat triangles (straight lines).

If you want a simple 2D circle, see the following for help:

<https://marlinfw.org/docs/gcode/G002-G003.html>

<https://makezine.com/2016/10/24/get-to-know-your-cnc-how-to-read-g-code/>

<https://reprap.org/wiki/G-code#G2_.26_G3:_Controlled_Arc_Move>

Note: it can take a while to get used to the I and J parameters.


---

