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
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:
| Grid | Colour | Default spacing | Purpose |
|---|---|---|---|
| Minor (cut) | Blue | 100 mils (0.100 in) | Snap points for cut-line endpoints |
| Major | Orange | 1.000 in (10 minor) | Reference boxes, axis labels |
| Drill offset | Dark green | ½ cut-snap, centred | Snap 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).
Colour Key
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 point | Adds 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:
- Double-click the last point
- Click the same point twice
- Press ESC
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.
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
- Select one or more items.
- Right-click → Move.
- A white ghost of the selection appears immediately, anchored at the lowest-left point of the selection.
- Move the mouse to the destination — the ghost follows, snapping to the cut grid.
- 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.
Copy & Paste
Copy
- Select items.
- Right-click → Copy.
- Left-click once to set the anchor point. The items are saved to the copy buffer and the selection clears. Nothing moves.
Paste
- Right-click → Paste (only visible when the buffer is non-empty).
- The ghost follows the mouse with the copy anchor under the cursor.
- Left-click to place a copy. The mode stays active — click again to place another copy.
- Press ESC or right-click to exit Paste mode.
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.
- Select the items you want to move (the "pulled" region).
- Right-click → Stretch.
- The selected items ghost in white; connecting segments ghost in grey dashes to show how they will stretch.
- Left-click the destination to commit. All selected items translate by the same delta; connecting Segs have their shared endpoint pulled along.
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.
| Button | Effect |
|---|---|
| Rot CCW | Rotate 90° counter-clockwise around a pivot you click |
| Rot CW | Rotate 90° clockwise around a pivot you click |
| H Flip | Mirror left↔right around a vertical axis through the pivot |
| V Flip | Mirror 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
| Key | Action |
|---|---|
| U or u or Backspace | Undo 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.
Grid Settings
Open via Grid → Grid Settings… or Ctrl+G.
| Setting | Effect |
|---|---|
| Measure | English (inches / mils) or Metric (mm) |
| Cut snap | Spacing of the cut grid — typically 100 mils, 50 mils, or 25 mils |
| Board size | Width × Height in major boxes |
Resizing edges with the keyboard
| Key combo | Edge 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
| Action | Effect |
|---|---|
| Scroll wheel forward / ↑ | Zoom in 2× around mouse pointer |
| Scroll wheel back / ↓ | Zoom out 2× — stops at full-grid view |
| Scrollbars | Pan 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 item | Shortcut | Action |
|---|---|---|
| Load .wrk… | Ctrl+O | Open a .wrk file |
| Save .wrk | Ctrl+S | Save to the current path (prompts if new) |
| Save .wrk As… | — | Save to a new path |
| Deduplicate Drills | — | Remove duplicate drill points at the same location |
| Deduplicate Cut Lines | — | Remove 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.
~/workFiles/ if that directory exists, otherwise the current directory.G-code Export
Select File → Save .gcode. EZCUT generates two separate files:
| File | Contents |
|---|---|
<name>.gcode | Cut-line pass — spindle down, trace segments, spindle up |
<name>_drl.gcode | Drill pass — move to each hole and plunge |
After generating the G-code, EZCUT briefly draws the tool path on the canvas:
- ► Solid yellow arrows — the spindle is cutting along this segment
- - - → Dashed yellow arrows — the spindle is moving (not cutting) to the next start point
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:
| Template | Default | Written |
|---|---|---|
| Start | G90 G20 M3 S1000 G1 Z0.05 F30 G1 X0 Y0 | Once at file start |
| Drill | G1 Z0.05 F30 G1 Xx Yy | Once per drill point; x/y → coordinates |
| CutLine | G1 Z-0.012 F3 (G1 Xx Yy) G1 Z0.05 F30 | See below |
| End | G1 X0 Y0 M5 | Once at file end |
CutLine template syntax
The CutLine template uses parentheses to split the output into three parts:
prefix (per_point) suffix
- prefix — emitted once when a new chain starts (e.g.
G1 Z-0.012 F3to plunge) - per_point — emitted for every point in the chain with lowercase
xandyreplaced by the actual coordinates - suffix — emitted once at the end of each chain (e.g.
G1 Z0.05 F30to retract)
Clicking Apply & Save G-code saves the templates and immediately launches the G-code export flow.
Keyboard Reference
| Key | Action |
|---|---|
| Ctrl+O | Load .wrk |
| Ctrl+S | Save .wrk |
| Ctrl+G | Grid Settings dialog |
| Ctrl+K | G-code Templates dialog |
| Ctrl+Q | Exit |
| U / u / Backspace | Undo |
| Enter (on canvas) | Redo |
| ESC | Cancel 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:
| Mode | Meaning |
|---|---|
2 | Chain start — first point of a cut segment |
3 | Chain continue — intermediate point |
4 | Chain end — last point of a cut segment |
5 | Drill 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