What actually makes an SVG ready for pen plotting?

I’ve been spending quite a lot of time preparing architectural line drawings for pen plotting, and one thing has become increasingly clear: an SVG that looks correct on screen is not necessarily a good SVG to send to a pen plotter.

Visually, two files can look almost identical. Mechanically, however, they can behave very differently.

Some of the things I now pay much more attention to are:

  • whether the drawing is made from actual strokes rather than filled shapes;
  • whether apparently simple lines are really single paths or complex outlined geometry;
  • how many separate paths the file contains;
  • whether there are duplicated or overlapping lines;
  • the order in which paths are drawn;
  • how much unnecessary travelling the carriage has to do between strokes;
  • whether different line weights can be separated cleanly for different pens.

The last point is especially important for the kind of drawings I’m working on.

I often want to use several technical pens in the same drawing — for example, fine, medium and heavier line weights — so I need the SVG to preserve enough structure to assign different parts of the drawing to different pens.

A file can therefore be perfectly valid SVG and still be rather inefficient for plotting.

For example, a drawing containing thousands of short paths may take much longer than expected, not because there is a huge amount of ink on the page, but because the machine spends so much time lifting the pen, moving, lowering it again and repositioning itself.

I’m also finding that path optimisation is a balance.

It is tempting to optimise everything as aggressively as possible, but I don’t want an optimisation algorithm to change the geometry of the drawing, merge lines that should remain separate, or alter the intended line hierarchy simply to save a few minutes.

So I’m beginning to think of a “plotter-ready SVG” as something slightly different from an ordinary vector file.

Ideally, I would want it to have:

  • clean single-line geometry where possible;
  • no unnecessary duplicate paths;
  • predictable stroke widths or colours;
  • sensible grouping or layer structure;
  • efficient path ordering;
  • minimal unnecessary pen-up travel;
  • geometry that remains unchanged by optimisation.

I’m curious how other people prepare their SVG files before plotting.

Do you clean and optimise them manually in Illustrator, Inkscape, Affinity Designer or another vector editor?

Do you use scripts or dedicated plotter software to reorder paths automatically?

And where do you draw the line between making a plot faster and preserving the original geometry exactly?

A useful distinction is between an SVG that is visually correct and one that is plotter-explicit: the latter makes the intended pen-down geometry, pen assignment, and drawing order unambiguous.

My preflight would be:

  1. Define the physical document

    • Confirm page size, units, viewBox, scale, and origin.
    • Remove or resolve transforms where possible.
    • Check that the artwork fits the actual machine’s usable area.
  2. Make the plotted geometry explicit

    • Use open or closed stroked paths for linework.
    • Convert text, effects, clipping, live shapes, and unsupported objects to paths.
    • Be cautious with filled shapes: a plotter may outline them, ignore the fill, or require a separate hatching step depending on the software.
    • Keep stroke colour or layer structure meaningful if it controls pen selection.
  3. Clean topology without changing intent

    • Remove exact duplicates and zero-length paths.
    • Detect coincident or nearly coincident segments, but review them before deleting.
    • Join path endpoints only when they are genuinely continuous and should be drawn as one stroke.
    • Avoid converting strokes to outlines unless the outline itself is what should be plotted.
  4. Separate optimisation from geometry editing

    • Path ordering and reversing a path are generally low-risk optimisations.
    • Merging paths, simplifying nodes, snapping endpoints, and removing “near duplicates” can change the drawing.
    • I would preserve an untouched source SVG and write the optimised result as a separate export.

For multiple pens, I would treat each pen as a separate plotting pass or explicit group, for example:

<g id="pen-fine" stroke="#111" fill="none">
  ...
</g>
<g id="pen-medium" stroke="#222" fill="none">
  ...
</g>

The colours themselves are not universal, of course; the important part is that the mapping is predictable in the plotting software. Optimising globally across all pens can produce a shorter route but a worse workflow if it causes frequent tool changes.

A practical ordering strategy is:

  • group by pen first;
  • within each pen, group by layer or semantic importance;
  • minimise pen-up travel within those groups;
  • allow path reversal when the geometry is unchanged;
  • preserve deliberate visual order where overlaps matter.

For architectural drawings, I would not let a generic optimiser freely merge everything. A long wall edge, a hatch, a dimension line, and a label may be geometrically adjacent but should remain separate because they have different pen assignments or meanings.

A good validation method is to compare three things:

  • the original SVG rendered normally;
  • the final SVG rendered normally;
  • a preview showing the actual pen-down sequence, including pen-up moves and pen changes.

Then run a small-scale or low-pressure test plot. A visually identical render cannot reveal excessive lifting, bad path order, or a pen assignment that the plotter software interprets differently.

The related discussion What tools do you use to prepare SVGs for pen plotting? may also be useful for comparing editor-based and scripted workflows. A final post documenting the working preflight rules and toolchain would make a valuable reference for future plotterfolk members.