Engraving QR-Codes with CNC Lasers
This Program lets you generate G-Code for engraving QR-Codes with a CNC Laser.
A Python 3 installation and the PyQRCode library. You can install the PyQRCode-Library with "pip install PyQRCode". (And a CNC Laser Cutter of course)
Open the qrGen.py file with your text editor, adjust the parameters, execute it, and a new .nc-file should appear. That's your G-Code. Run this with your Laser and you should get a nice QR-Code.
This is the Data that should be encoded into the Code. If you use only Caps, numbers, space, $, %, *, +, -, ., /, and :, a smaller Encoding is used which makes the QR-Code smaller.
This is the Error correction Level used. The Levels possible are L, M, Q or H. The Levels correspond to the error Tolerances of 7%, 15%, 25% or 30% of data Loss that can be tolerated. If you choose a higher error tolerance, the Code gets bigger but can be scanned more reliably.
This specifies how wide the quiet Zone around the Code should be. Normally, this is 4 modules wide.
This lets you scale the whole program up or down.
This inverts the dark and bright areas of the QR-Code. Useful if you want to Laser stamps or remove protective coating to etch.
This is the spacing between the Lines the laser uses to raster solid Black
The Default starting Position is the lower left of the code. If you set it to "ul"/"upperLeft", it starts in the upper left corner. If you set it to "ur"/"upperRight", it starts in the upper right corner. If you set it to "lr"/"lowerRight", it starts in the lower right corner. If you set it to "c"/"center", it starts in the Center of the Code.
If this is enabled, the Laser draws vertical lines at the borders of rastered black regions.
If this is enabled, the Laser moves into the black region it lasered before turning off to avoid burning the edge if disabling the laser takes some time.
If this is enabled, the Laser burns a small dot at machine zero at the start of the Program. Only useful if startPos is not "center", or you will have a dot in your Code.
If this is enabled, the Laser burns a dot in each of the Corners of the quietZone
If this is enabled, the Laser draws a Box around the quietZone
If this is enabled, the Laser draws a Box around the QR-Code
This string contains the G-Code to enable the Lase. use \n for new line.
This string contains the G-Code to disable the Lase. use \n for new line.
This string contains the G-Code to burn a dot with the Laser.
The Speed used for travelling while the Laser is disabled in your machine's speed unit.
The Speed used for cutting while the Laser is enabled in your machine's speed unit.
If this is enabled, the laser will trace the outline of the QR-Code that will be engraved before starting engraving to show the user the space needed. Like codeBox but not supposed to be actually cut into the Material. The CNC-Machine pauses after this to allow user to abort program before actually cutting by executing the user-supplied machinePause G-Code.
If this is enabled, the laser will be enabled while running the outline demo. This is useful if you can reduce your Laser power to be able to see the dot and see the area that will be engraved without actually engraving. If this is disabled, the Laser will trace the outline of the QR-Code without enabling the Laser.
This is the G-Code used to pause the machine after showing the outline with outlineDemo. If this is empty, the engraving will start immediately after showing the outline, so make sure this is correct and tested.