Skip to content
OPQAI.
Sourced advanced / ✍️ Content Creation Free tools

Generate Pen Plotter Vectors with Txt2plotter and an LLM

Job to be done: Generate centerline vector graphics for pen plotters from text prompts

🇳🇬 Ways to use this in Nigeria

Ideas to get you started, adapt to your situation.

  • 9-5 employee

    Produce clear, centerline schematics for engineering reports or architectural blueprints, ensuring high-quality vector graphics for professional documentation and presentations.

  • Student

    Generate precise technical diagrams for your engineering or architecture project, creating clean centerline vectors for professional submission or physical plotting.

  • Entrepreneur

    Design unique, minimalist line art for custom merchandise like t-shirts or art prints, ensuring crisp vector output for screen printing or actual pen plotting.

What this is, in plain English

A pen plotter is a machine that draws with a real pen on paper, following lines you give it. For that, you need “centerline vectors”: art made of single, clean lines (like a pen stroke), not filled shapes. AI image generators usually produce pictures that, when traced, come out as hollow, double-stroked outlines, which plot badly. This workflow gets around that: you use an AI to write a “technical drawing” style prompt, generate the image with a model that keeps lines clean (Flux.2-dev), then run a Python tool that extracts true single-line (centerline) vectors.

Be honest about the level: this is an advanced, maker-and-coder project. You run an image model and a Python tool, and the author’s exact scripts are not all spelled out in the source. This page explains what it does, what it is good for, and the realistic shape of doing it, so you can decide if it is for you.

What you can use it for

  • Technical diagrams. Clean schematics or blueprints for engineering and architecture work.
  • Minimalist line art. Single-line illustrations for posters, logos, or art prints.
  • Merch designs. Crisp line art that screen-prints or plots well on t-shirts and prints.
  • Actual pen-plotter art. Drawings a plotter can render physically without messy double strokes.
  • The reusable idea: “rewrite the prompt for a clean-line style, then extract centerlines” applies to any line-art-for-plotting task.

Tools you need

  • An LLM (freemium): ChatGPT, Claude, or Gemini, to rewrite your idea into a technical-drawing-style prompt.
  • Flux.2-dev (free): an open-source image model that holds straight lines and geometry better than most, which matters for vectors.
  • Python (free): to run the centerline-extraction tool that turns the image into plotter-ready vectors.

How it actually works

The trick is shaping the image for clean lines, then extracting centerlines (not tracing outlines). The realistic shape:

  1. Rewrite your idea into a technical-drawing prompt. Ask any LLM to restyle it:

    Rewrite this idea into an image-generation prompt for a pen plotter. Aim for clean
    single lines, geometric shapes, and a minimalist technical-drawing look:
    [your original idea]

    You should get a sharper, style-specific prompt.

  2. Generate the image with Flux.2-dev. Set up Flux.2-dev (the author used a 4-bit version to run lighter) and feed it your prompt. You get an image with clean, coherent lines.

  3. Extract centerline vectors with the Python tool. Run the author’s Python tool (the txt2plotter approach) on that image. Instead of tracing outlines, it pulls out true centerlines and saves vector files (like SVG) your plotter can draw.

Words you’ll see, explained

  • Pen plotter: a machine that draws with a real pen, following vector paths.
  • Vector graphics: images made of lines and curves (not pixels); SVG is a common format.
  • Centerline: a single line down the middle of a stroke, what a pen actually draws.
  • Double stroke / hollow line: what tracing tools produce, an outline of a line, which plots as two passes.
  • Flux.2-dev: an open-source image model that keeps lines clean.
  • LLM: large language model, the AI used here to restyle the prompt.

Original source

Based on a Show HN post by tsanummy, who built a Python tool to bridge AI image generation and pen plotters, specifically solving the problem of getting usable centerline vectors.

Notes & variations

  • Do you even need AI? For simple geometric designs, drawing vectors directly in a tool like Inkscape may be quicker. This shines for richer, AI-imagined line art.
  • Free-tier alternatives: any LLM’s free tier handles the prompt rewriting; other open image models exist, though line quality varies.
  • Common pitfall: tracing an AI image with a normal tool (Inkscape’s trace, Potrace) gives hollow, double-stroked lines unfit for plotting. The whole point is generating centerline data instead.
  • Tip for better results: experiment with “technical drawing” and “blueprint” keywords in your prompt rewrite to push the model toward cleaner geometry.

Keep going

More Content Creation workflows