EZCUT

A CNC cut-line and drill-point layout editor for PCBs and panel work — Python / Tkinter, single file, runs anywhere.

Overview

EZCUT lets you draw cut lines and drill points on a snap grid, then export two G-code files — one for the spindle cutting pass and one for the drill pass. You load and save layouts as plain-text .wrk files.

The window has three areas: the canvas (the drawing area), the status bar at the bottom (shows file, object counts, grid size, and current mode), and the menu bar at the top (File, Grid, Gcodes).

All interaction is mouse-driven. Left-click places or selects. Right-click opens the radial mode menu. ESC cancels whatever is in progress.

Download & Requirements

⇩ Download EZCUT0_8_36.py

EZCUT is free software. It runs on Windows, macOS, and Linux — anywhere Python is available. It requires Python 3.9 or later and uses only the standard library (no extra packages to install). Tkinter is included with most Python distributions.

If Python is not already on your machine, download it from python.org. On the download page, choose the installer for your operating system and follow the instructions. On Windows, tick "Add Python to PATH" during installation.

Once Python is installed, open a terminal (Command Prompt / PowerShell on Windows, Terminal on macOS/Linux) and run:

python EZCUT0_8_36.py

On some systems the command may be python3 instead of python.

The Grid

EZCUT displays two overlapping snap grids:

GridColourDefault spacingPurpose
Minor (cut)Blue100 mils (0.100 in)Snap points for cut-line endpoints
MajorOrange1.000 in (10 minor)Reference boxes, axis labels
Drill offsetDark green½ cut-snap, centredSnap points for drill holes

Default board size is 7 × 4 inches. The origin (0, 0) is at the bottom-left. Coordinates increase right (+X) and up (+Y), matching standard CNC convention.

Resize the board with the Shift / Ctrl + arrow keys (see Grid Settings).

Units: Internally all coordinates are stored as integers at 2,540,000 counts per inch, so 1 mil = 2,540 counts and 1 µm = 100 counts. You will never see these numbers directly — the grid and file use plain inch or mm strings.

Colour Key

Green — cut-line start point
Cyan — cut-line segment
Yellow — cut-line end point
Red — drill point
White — selected item
White (ghost) — move / paste preview

Right-Click Menu

Right-clicking anywhere on the canvas opens a 3-column radial popup centred on the mouse. The mouse lands on the Return cell so you can close the menu with a single right-click if you change your mind.

Moving the mouse outside the popup dismisses it without any change. Clicking a cell picks that action.

Row 4 (Move / Stretch / Copy) only appears when items are selected. Paste only appears when the copy buffer is non-empty. The transform cells (Rot CCW, Rot CW, H Flip, V Flip) only appear when items are selected or a move/paste ghost is live.

Add Mode

In Add mode every left-click either extends a cut line or places a drill point. The grid snap determines which:

Click lands nearest to…Action
A cut-grid pointAdds a cut-line vertex. A rubber-band preview line follows the mouse.
A drill-grid point (no drill already there)Places a drill hole immediately.
A drill-grid point (drill already there)Snaps to the cut-grid instead.

Finishing a cut line

A cut segment ends when you:

Press Backspace to remove the last placed point and step back one vertex.

Select Mode

Point click: click on or near a cut segment or drill point to select it (it turns white). Click in empty space to deselect all.

Rubber-band: left-drag to draw a selection rectangle. Everything fully inside the rectangle is added to the selection.

Add+Select (Auto on): In Add mode with Auto enabled, clicks that land more than 20% of a snap interval from any grid point act as Select instead of Add. Rubber-band drags are additive — they union with the current selection rather than replacing it. Press ESC or click empty space to clear.

Delete Mode

Click anywhere on a cut segment or on a drill point to delete that single item. The click finds the nearest object — you do not need to click exactly on the line.

If items are already selected when you pick Delete from the menu, they are deleted immediately without a further click.

Auto Mode

Auto is a toggle on the Add mode. When active, the status bar shows Add+Select. Toggling it off shows Add.

The practical effect: you can draw new lines and select/rubber-band existing ones without switching modes. A click near a grid point draws; a click away from the grid selects.

Move

  1. Select one or more items.
  2. Right-click → Move.
  3. A white ghost of the selection appears immediately, anchored at the lowest-left point of the selection.
  4. Move the mouse to the destination — the ghost follows, snapping to the cut grid.
  5. Left-click to place. The originals are removed and the items land at the new position.

Press ESC or right-click to cancel Move without committing.

Transforms during Move: While the ghost is live you can open the right-click menu and pick Rot CCW / Rot CW / H Flip / V Flip. The ghost will transform in place. Click the pivot point when prompted, then continue moving.

Copy & Paste

Copy

  1. Select items.
  2. Right-click → Copy.
  3. Left-click once to set the anchor point. The items are saved to the copy buffer and the selection clears. Nothing moves.

Paste

  1. Right-click → Paste (only visible when the buffer is non-empty).
  2. The ghost follows the mouse with the copy anchor under the cursor.
  3. Left-click to place a copy. The mode stays active — click again to place another copy.
  4. Press ESC or right-click to exit Paste mode.
Repeated paste: Paste stays active after each placement so you can tile the same shape multiple times quickly.

Stretch

Stretch is like Move, but cut segments that connect selected items to non-selected items are stretched rather than translated whole. This lets you widen a section of your layout without breaking connectivity.

  1. Select the items you want to move (the "pulled" region).
  2. Right-click → Stretch.
  3. The selected items ghost in white; connecting segments ghost in grey dashes to show how they will stretch.
  4. Left-click the destination to commit. All selected items translate by the same delta; connecting Segs have their shared endpoint pulled along.
Only one endpoint shared: A linking Seg stretches only when exactly one of its endpoints is inside the selection. Segs that are fully selected translate whole, just like in Move.

Press ESC or right-click to cancel Stretch.

Rotate & Flip

These appear in the top row of the right-click menu when a selection or live ghost exists.

ButtonEffect
Rot CCWRotate 90° counter-clockwise around a pivot you click
Rot CWRotate 90° clockwise around a pivot you click
H FlipMirror left↔right around a vertical axis through the pivot
V FlipMirror up↔down around a horizontal axis through the pivot

After picking a transform, the status bar shows "click pivot point". Click any cut-grid point to apply. When used on a live Move/Paste ghost the transform applies to the ghost without committing it.

Undo / Redo

KeyAction
U or u or BackspaceUndo last action
Enter (on canvas)Redo

The undo stack stores the full state of objs[] before each mutating action. It is cleared whenever a new action is committed after an undo.

Note: Transforms applied to a live ghost (before committing Move/Paste) are not individually undoable — the undo records the committed state.

Grid Settings

Open via Grid → Grid Settings… or Ctrl+G.

SettingEffect
MeasureEnglish (inches / mils) or Metric (mm)
Cut snapSpacing of the cut grid — typically 100 mils, 50 mils, or 25 mils
Board sizeWidth × Height in major boxes

Resizing edges with the keyboard

Key comboEdge moved
Shift+↑Top edge up (board taller)
Shift+↓Top edge down (board shorter)
Shift+→Right edge right (board wider)
Shift+←Right edge left (board narrower)
Ctrl+↓Bottom edge down (extends below origin)
Ctrl+↑Bottom edge up
Ctrl+←Left edge left (extends left of origin)
Ctrl+→Left edge right

The data origin (0, 0) stays fixed on screen as edges move.

Zoom & Pan

ActionEffect
Scroll wheel forward / Zoom in 2× around mouse pointer
Scroll wheel back / Zoom out 2× — stops at full-grid view
ScrollbarsPan when canvas is larger than the window

Zoom-in limit: at least one major square must remain visible on each axis. Zoom-out limit: the baseline scale where the full grid fits the window.

File I/O (.wrk)

Menu itemShortcutAction
Load .wrk…Ctrl+OOpen a .wrk file
Save .wrkCtrl+SSave to the current path (prompts if new)
Save .wrk As…Save to a new path
Deduplicate DrillsRemove duplicate drill points at the same location
Deduplicate Cut LinesRemove duplicate overlapping segments

The .wrk file is plain text. Lines starting with ; are comments and are preserved on save. Lines starting with # or unparseable lines trigger a "Removing strange lines" warning on load.

EZCUT files default to ~/workFiles/ if that directory exists, otherwise the current directory.

G-code Export

Select File → Save .gcode. EZCUT generates two separate files:

FileContents
<name>.gcodeCut-line pass — spindle down, trace segments, spindle up
<name>_drl.gcodeDrill pass — move to each hole and plunge

After generating the G-code, EZCUT briefly draws the tool path on the canvas:

The overlay disappears automatically when you close the save dialog. Take a screenshot first if you want to keep the view.

The save dialog lets you choose Save or Skip for each file independently, then Close.

Routing algorithm

Both the cuts pass and the drill pass use a greedy nearest-neighbour route starting from the point closest to the machine origin (0, 0). For cut segments the algorithm picks the unvisited segment whose nearest endpoint is closest to the current spindle tip, then enters that endpoint and cuts to the other end. This produces a practical, low-travel-distance path without the overhead of a full TSP solver.

G-code Templates

Open via Gcodes → G-code Templates… or Ctrl+K. Four template strings control the output:

TemplateDefaultWritten
StartG90 G20 M3 S1000 G1 Z0.05 F30 G1 X0 Y0Once at file start
DrillG1 Z0.05 F30 G1 Xx YyOnce per drill point; x/y → coordinates
CutLineG1 Z-0.012 F3 (G1 Xx Yy) G1 Z0.05 F30See below
EndG1 X0 Y0 M5Once at file end

CutLine template syntax

The CutLine template uses parentheses to split the output into three parts:

prefix (per_point) suffix

Clicking Apply & Save G-code saves the templates and immediately launches the G-code export flow.

Keyboard Reference

KeyAction
Ctrl+OLoad .wrk
Ctrl+SSave .wrk
Ctrl+GGrid Settings dialog
Ctrl+KG-code Templates dialog
Ctrl+QExit
U / u / BackspaceUndo
Enter (on canvas)Redo
ESCCancel current operation / clear selection
Backspace (in Add mode)Remove last placed vertex
Scroll wheel / Zoom in / out
Shift+↑↓→←Grow/shrink top or right edge
Ctrl+↑↓→←Grow/shrink bottom or left edge

.wrk File Format

Plain text, one record per line:

; comment line (preserved on save)
<row>  <mode>  <x_in>  <y_in>

Mode codes:

ModeMeaning
2Chain start — first point of a cut segment
3Chain continue — intermediate point
4Chain end — last point of a cut segment
5Drill point

Blank lines are silently skipped. Non-matching content triggers the "Removing strange lines" dialog on load.

Example:

; Hall Effect Sensor board
1  2  0.100  0.100
2  3  0.500  0.100
3  4  0.500  0.500
4  5  0.300  0.300

Tips & Tricks

Working from the origin: Place your most important feature near (0, 0). The G-code router starts there and the machine home position is the origin.
Stretch vs Move: Use Move when you want to relocate a group of items wholesale. Use Stretch when those items are part of a larger connected layout and you want neighbouring segments to flex rather than break.
Deduplication: If you load an older file or paste repeatedly, run Deduplicate Drills and Deduplicate Cut Lines from the File menu before exporting G-code to avoid the spindle revisiting the same spot.
Screenshot the tool path: After exporting G-code, the yellow path overlay is shown briefly before the save dialog. If you want to keep a record of the routing order, take a screenshot of the canvas before clicking anything in the dialog.
Copy buffer persists: The copy buffer survives mode changes and is only cleared when EZCUT exits or you load a new file. You can copy a footprint, place many instances with Paste, then switch to Add mode to draw traces between them — the buffer remains ready.