Plotting laser G-Code with turtle
This Program lets you simulate G-Code for CNC-Lasers by plotting them with the Python turtle module.
A Python 3 installation and some G-Code to plot.
Open the laserPlotter.py file with your text editor, adjust the parameters, execute it, and watch the plot appear.
If this is false, the G-Code will be executed one after the other, simulating the Lasers behaviour. If it is True, the end result will be shown immediately.
If this is enabled, the Travel of the Laser will be plotted too.
This feature attempts to model the burn in dots that appear if the Laser is enabled and doesn't mode. If the Laser is enabled and a G4 (Wait) Command is encountered, the Turtle will draw a dot, which size corresponds to the time of waiting.
Maximum size the waitBurn dots will have. The dots will approach this ceiling asymptotically.
Coefficient used to tune the waitBurn diameter calculation. The total Formula for waitBurn diameter is pointDia = maxBurnDia - (maxBurnDia * (e^(waitTime / -burnTimeCoefficient))).
The Color used for plotting Laser Cuts.
The Color used for plotting Laser Travel.
Speed of plotter for travel Moves. The Program determines if a move is travel with the G-Code (G0 is travel), not the Laser state.
Speed of plotter for cutting Moves. The Program determines if a move is for cutting with the G-Code (G1 is Cutting), not the Laser state.
Beginning of a G-Code that means the Laser gets enabled. Depends on your configuration which G-Code you use to enable your Laser.
Beginning of a G-Code that means the Laser gets disabled. Depends on your configuration which G-Code you use to disable your Laser.
The filename of the G-Code to open and plot.
The scale by which the plot is scaled. Since G-Code is most often in mm an turtle uses pixels, a scale of 1 would be hard to see for most application.
The amount the plot is shifted in x-Direction
The amount the plot is shifted in y-Direction