Skip to content
Hackable Laser software for the K40 Stock-LIHUIYU laser boards.
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
locale Locale messages update. Feb 21, 2020
.travis.yml Update .travis.yml Dec 22, 2019 Documentation Tweaks Feb 6, 2020 Final Checks Against Machine Feb 18, 2020 Device split from Backend Feb 2, 2020 0.5.0 Feb 7, 2020 Paramode checks. Mar 5, 2020 ParaInit fail, raises ConnectionRefused Mar 5, 2020 Paramode checks. Mar 5, 2020 Frame capture webcam error moved. Mar 11, 2020 Fixed some more backend stuff, gui as module. Feb 1, 2020 <3.6, compatibility, -fstring Feb 15, 2020 Small grbl crash bug. Mar 9, 2020 Settings, and per device Properties Feb 2, 2020 Dxf less crashy Feb 28, 2020 JobsDialog Properties Feb 21, 2020 +PathProperty Feb 19, 2020 Webcam snapshot, fisheye D and K but no entry Feb 29, 2020 Locale messages update. Feb 21, 2020 Final Checks Against Machine Feb 18, 2020 Cursory GRBL Emulator. Feb 26, 2020 0.5.0 Feb 7, 2020
LICENSE Initial commit Jul 20, 2019 TransformEditor, +swap_xy Feb 25, 2020 Implemented @ command. Feb 24, 2020 GC mostly finished. Mar 3, 2020 Help with debugging. Feb 26, 2020 Couple tweaks to LaserSpeed Mar 9, 2020 Couple tweaks to LaserSpeed Mar 9, 2020 Correct Modification for Make Raster Mar 6, 2020 Convex Hull, Simple Traces. Mar 3, 2020 Correct Modification for Make Raster Mar 6, 2020 +TextProperty Feb 21, 2020 TransformEditor, +swap_xy Feb 25, 2020 Update Mar 3, 2020 Right-Left rastering. Feb 19, 2020 JobsDialog Properties Feb 21, 2020 Final Checks Against Machine Feb 18, 2020 TransformEditor, +swap_xy Feb 25, 2020 Actualize Correction, Tree key, Config Feb 16, 2020 Svg Parse with Transforms. Sep 20, 2019 Fixed svg.path bugs with tests. Oct 1, 2019 TransformEditor, +swap_xy Feb 25, 2020
install_run.bat Final Fixes Dec 26, 2019
requirements.txt Directly including svgelements Dec 27, 2019 Dxf corrections. Mar 7, 2020 Mass Elements Select Mar 11, 2020


Laser software for the Stock-LIHUIYU laserboard.

MeerK40t (pronounced MeerKat) is a built-from-the-ground-up MIT licensed open-source laser cutting software. It's a replacement for LaserDrw, Corel Laser, and K40 Whisperer. With the dual driver support it can run aside any of these programs. It's written in python and has precompiled versions for Windows, Mac OSX, and Raspberry Pi. Available:

  • Dual drivers, use either the Whisperer method or LaserDrw method.
  • Grid/Guides, Zoom and Pan scene Navigation (use middle mouse button, mouse wheel).
  • PPI Power modulation (Yes, power modulation for the M2 Nano)
  • Multi-K40 support.
  • Drag-and-Drop support for SVGs/Images.
  • On-the-fly job Processing
  • Multi-language support.
  • Modular/Hackable Add-On and Kernel API.
  • Pixel perfect curve cutting.
  • Command Line Interface


Easy Windows

Download MeerK40t.exe

Run: MeerK40t.exe

MeerK40t is compiled as a portable application. It doesn't need to install or do anything.

Run Batch File to Python.

Download the source and run with python.

  • Download click: "Clone or Download".
  • Click "Download Zip"
  • Unzip on your desktop, this should be the meerk40t-master directory.
  • Find install_run.bat in the meerk40t-master directory and run it.

The batch file checks and installs requirements and runs

pip install -r requirements.txt

The batch file avoids the command prompt.

Command Prompt Fallback

You need to use python and the requirements of wxPython pyusb and Pillow to run

Windows Instructions:

You will need python:

You will need Meerk40t:

  • Download click: "Clone or Download".
  • Click "Download Zip"
  • Unzip on your desktop, this should be the meerk40t-master directory.
  • Press Windows + R (to load run).
  • Type "cmd"
    • This should be a dos prompt at C:\Users\(Name)> location.
  • Type "cd Desktop"
  • Type "cd meerk40t-master
  • Type "python"
    • At this point it could fail in a couple ways. It could lack: wxPython. pyusb. Pillow. See Troubleshooting:

Troubleshooting Install


  • ModuleNotFoundError: No module named 'wx' means you need wxPython.
    • Type: pip install wxPython
  • ModuleNotFoundError: No module named 'usb' means you need pyusb.
    • Type: pip install pyusb
  • ModuleNotFoundError: No module named 'PIL' means you need Pillow.
    • Type: pip install Pillow


  • ImportError: cannot open shared object file: No such file or directory . libpng is not installed.
    • Type: sudo apt-get install libpng


The wxMeerK40t is the GUI and is written in wxPython. It's pretty easy to hack on and quite easy to improve. Linux and OSX need transformations to run the scene effectively and that requires wxPython 4.1+. ( )


Pulse Modulation

The stock controller is not known for having power control, MeerK40t gives it power control. How is this possible? I use software to pulse the laser. See the Wiki for additional details:'s-pulse-modulation-works%3F

This does not mean you should overpower your laser with the knob? NO. Leave that knob alone.

Most power modulation is done through hardware because most boards have the ability to process things and execute stuff. The Lhystudios (M2 Nano, etc) boards are different in that they are incredibly dumb. They execute very basic command directly on a micro-controller and do no planning or work directly on the device. This leaves everything to the software running the laser to constantly feed it new set of commands.


The MeerK40t driver interface uses either the LibUsb driver or the CH341DLL default windows driver.


The backend in MeerK40t is highly modular. Lending towards permitting replacing the backend or replacing a part of the backend.

There are three main parts for any backend system within MeerK40t, these are the Spooler, the Interpreter, and the Pipe.


Jobs are spooled like a printer spooler, so that jobs are performed in sequence. You can add additional jobs to a spooler while it's still running the first job.


The main interpreter is the LhymicroInterpreter which converts LaserCommands into low level Lhymicro-GL code Any Interpreter is tasked with converting such commands usable sets of bytes.


The system is agnostic with regard to where the data is going and should end up. Which the K40Controller is most used and default pipe. It doesn't have to be, and what to do with the code when we have it, is not a question with just one answer.


SVG Paths.

The SVG library is a separate project based in svgelements which can be retrieved pip install svgelements. It is, in part, derived from code I wrote for mathandy/svgpathtools, which is a tools expansions of regebro/svg.path library. It's one of the most expansive and full implementations of SVG in python.

Curve Plotting

The LIHUIYU series of boards are connected to two stepper motors, these can step one step in either direction, or trigger both at the same time. So everything in the K40 are made of positions at 1000dpi. Every movement is a step either orthogonality or diagonally, this means there are no actual curves only a series of very tiny steps in 1 of 8 possible directions. This is where the Zingl Plotter comes in. The Beauty of Bresenham's Algorithm ( ) author, Zingl came up with a series of algorithms based on Bresenham's insights, which natively allows these curve plotting operations to be performed directly with the native shapes themselves. This means that there is no need to deal with more primitive or subdivided elements. If we have a large curve or small curve it will always have perfect precision because we can natively use the curves themselves.

MeerK40t will draw pixel perfect curves (except for Arc which could be off). Which means if your design contains a Cubic Bezier curve, the program will draw it flawlessly.

These are never subdivided into good-enough small line segments, and the curves are executed on the fly. And since no linearization is needed, the project internally stores everything as the curves they are, giving you access to high-level manipulations, and low-level extremely fast plotting.


The ability to drag and drop and display and modify job elements is critical to any good laser cutting application. Currently MeerK40t uses Pillow to load images. svgelements to load the SVG files. There an EgvParser from K40Tools to load EGV files. These loaders are registered in the kernel api and can be augmented with other formats quite easily. Requests for dealing with additional file formats can be easily addressed and integrated.


The project includes a RasterBuilder. It uses a highly debuggable methodology to build rasters. This gives MeerK40t the ability to overscan, perform bottom-to-top rasters, start from any corner, skip blank edge pixels, skip blank edge lines and makes the entire process extremely easy to troubleshoot or extend.

See notes on Rastering ( in the wiki.

Lhymicro-GL Interpreter

The Lhymicro-GL interpreter writes Lhymicro-GL code to be used in the stock firmware. This is done with the LhymicroInterpreter. It uses middle-level to low level on the fly writer, which tracks the local state of the device.

We can also adapt for edge conditions and alterations on the fly without any trouble. The interpreter tracks its current state and can perform the needed actions for state changes behind the scenes.


The core language internally used in MeerK40t is a backend-agnostic coding, which conveys spoolable commands. If you wish to write an add-on for MeerK40t that sends commands to the laser, or a backend for a different laser device, you will want to use these.

See notes on LaserCommands:

You can’t perform that action at this time.