Question: how g code is generated?
Answer: Most g-code is automatically generated by a slicing program such as Cura. Because there are hundreds or thousands of movements involved in producing a 3D print, the g-code can be hundreds of pages long. ... Programs such as Repetier Host can be used to write G-codes to create plugins for use in Cura.