Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 1.09 KB

generate_gcode.md

File metadata and controls

18 lines (13 loc) · 1.09 KB

5. Generate GCode

This step basically just uses the attributes added by the modifiers to generate the GCode.
For example, it generates the infill pattern for all parts defined in the attribute "infill".

In many cases each modifier has a counterpart renderer.

The actual GCode is built using a GCode builder.

There is one problem I had: the generated gcode produced many small steps in some places which made the printer slow down and hang many times.
At first I searched a bit in the (current) cura sources and found a Simplify-method. I ported it over without any idea what it does.

But it didn't do exactly what I wanted. It somehow smoothes the model a bit and therefore reduces the slice time a bit, but not enough to avoid the problem.
So after some research I found that the PrusaSlicer uses the DouglasPeucker right before generating the GCode.
So I implemented it myself (it's a relatively easy recursive algorithm) and yes, now the printer prints everything smoothly.