Skip to content

About

Python tool that converts QR codes to DXF files with clean, closed contours — ready to extrude in CAD software like Autodesk Inventor

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QRCode2DXF

A small Python script that generates QR codes as DXF files with clean, closed outline contours — ready to extrude in CAD programs like Autodesk Inventor.

Background

I needed a simple workflow to engrave QR codes into surfaces in Autodesk Inventor (e.g. for 3D printing). The most direct way in Inventor is to import a DXF into a sketch and extrude from there. This script automates that: it generates a QR code, traces the outer contours of the black regions, and writes them as closed polylines into a DXF — no internal edges, so direct extrusion just works.

QR code extruded in Autodesk Inventor

Dependencies

  • qrcode — QR code generator
  • ezdxf — DXF library for Python
  • pillow — PNG reference image generation

Setup

# Clone the repository
git clone https://github.com/mgiesen/QRCode2DXF.git

# Open the repository
cd QRCode2DXF

# Create a virtual environment
python3 -m venv .venv

# Activate the virtual environment
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Usage

All output files (DXF + PNG reference) are written to the output/ directory, which is recreated on each run.

# Single QR code (default 30x30mm)
python qr2dxf.py "https://example.com"

# With edge length in mm
python qr2dxf.py "https://example.com" --size 50

# Batch: text file with one URL per line
python qr2dxf.py --batch urls.txt --size 40

About

Python tool that converts QR codes to DXF files with clean, closed contours — ready to extrude in CAD software like Autodesk Inventor

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages