A tale of two SVGs (Illustrator Export bug)

TL;DR: Use Save As to produce SVGs from Illustrator (as recommended by GF). Export is a hot mess.

There’s been a lot of discussion from time to time about using “Save As” SVG versus “Export As” in Illustrator. Glowforge recommends Save As, and there have been a few examples on the forum of broken SVGs produced by Export. I’m one of the people who used to prefer Export, because it puts real units in the file and it makes “prettier” looking source code. I figured the bugs were probably ironed out by now.

But I have here a new example, with the latest and greatest version of Illustrator 2020, that produces completely bogus output with Export. Note these four circles are exactly the same size (this is the original in Illustrator):

image

Save As… works fine:

image

But Export As… incomprehensibly shrinks one of the circles:

image

Now, while the SVG is definitely prettier in the exported SVG, it is also broken.

    <path d="M851.08,223.8326l.2664-.0482a2.9755,2.9755,0,1,1-1.9573,1.2778l.0014-.0022a2.977,2.977,0,0,1,1.9559-1.2756l.2636-.0482" fill="none" stroke="#000" stroke-miterlimit="11.3386"/>
    <path d="M849.935,126.797l-.17-.21a2.9774,2.9774,0,0,1,4.6436-3.7277l.0023.0029a2.9784,2.9784,0,0,1-2.3527,4.8388q-.1164-.0012-.2324-.0114a2.9765,2.9765,0,0,1-2.0608-1.1026l-.1673-.21" fill="none" stroke="#000" stroke-miterlimit="11.3386"/>
    <path d="M695.64,126.2046l-.15.2239a1.7745,1.7745,0,1,1,.0028,0l-.15.224" fill="none" stroke="#000" stroke-miterlimit="11.3386"/>
    <path d="M693.2045,223.9715l.2693.0085a2.9752,2.9752,0,1,1-1.3415.281l.0008,0a2.9747,2.9747,0,0,1,1.3407-.2807l.2693.0057" fill="none" stroke="#000" stroke-miterlimit="11.3386"/>

Among other anomalies, the first, second, and fourth path have an arc with a radius of 2.9755, and for some reason the third is 1.7745 instead.

The moral of the story is that rumors about “Export As… SVG” being broken in Illustrator are, sadly, still true. I am going to abandon my principles and switch back to Save As.

If anyone’s curious to reproduce this, here are the files.

badexport.zip (743.0 KB)

18 Likes

WTAF? :scream:

3 Likes

Yeah. Wasted a couple of hours and a couple of sheets of material because I thought my machine was going out of square or something.

3 Likes

You want to scream at Adobe “You had one job!”

7 Likes

Well, that is just annoying as all get out. I’m a devout “ignore GF suggestion of using Save As” guy myself.

Looking at your export file, it looks like you selected the circles then exported them. Try export the entire artboard and see if you get the same result.

I’ve gotten into the habit of iterating a lot of designs doing copy/paste from AI to the GFUI too. That looks like a whole different language. :slight_smile:

1 Like

Is there a reason you’re not copy/pasting from illustrator?

Eventually have to save/export or lose the file for editing.

1 Like

Sure, but better to save the native AI for future editing than as an SVG and lose some of the AI features.

1 Like

You can either trust me that I tried a lot of things and used the right settings, or you can experiment yourself with the file I supplied. :slight_smile:

3 Likes

There are plenty of reasons to save an SVG, including sharing with other people and ease of repeatable uploading the same file in the future.

FWIW, paste “works” with this file, but I’m not sure how much I will trust it going forward. I suppose that’s also a lesson here: carefully examine what’s on the screen before printing in case there are any glitches.

BTW, if you’re saying “how could you possibly have missed such an obvious discrepancy”, this is just a minimized test case from a much larger and more complicated file. When I uploaded this, it looked ok and I had no reason to suspect it until the screw didn’t fit in the hole. It’s only obvious when you know where to look and when you’re not complacent from hundreds of previous files working just fine.

6 Likes

That design looks really cool in my imagination–I’d sure like to see a photo when it’s finished!

3 Likes

Definitely trust you. You have shown you’re very meticulous. I’d just noticed some weirdness before exporting assets vs. exporting the entire board.

“Save as” actually makes the SVG files compatible with another tool I have

This is why I save both versions. I create an AI completely with welded and unwelded shapes for editing, then save an SVG file that is layered out and color coded for easy export.

1 Like

I know others have a strong dislike for adobe and PDF, I like it better for sharing or getting into the GFUI more than SVG because I see lots of SVG issues. Maybe if more people used PDF we’d see PDF issues, but I haven’t seen them.

But there’s more than one way to skin a cat and I’m just tossing out ways I do things.

2 Likes

It’s just my copy of @mark14’s matrix lamp with the addition of the circuit board I made on my CNC mill. I thought it would be fun to run it with minimal components, so I’m using just a single ATmega328, a resistor, and a capacitor, along with some Arduino code. I put up a rather long and boring video a while back that includes the world’s most overcomplicated way of adding four screw holes.

2 Likes

I use “Plain SVG” (vs. “Inkscape SVG”), it works perfectly in the UI and can be edited in Inkscape. The only thing I lose is layers, but by the time I get to printing, layers are not needed, I only use them during the design steps.

I would be quite frustrated with the consistency issues in AI. I can’t help but wonder why someone, somewhere hasn’t figured out what causes (and how to fix) the difference.

I don’t think there’s any issue taking a plain SVG (from Inkscape) and opening in AI, no?

2 Likes

I would love to hear a technical talk some day from the people at Glowforge who spend all day writing code to deal with these file formats. They must have some stories…

I’ve been watching a lot of game design retrospectives lately, it’s fascinating to hear what went into solving some of those challenges.

1 Like

I would be surprised if GF is writing their own interpreters.

G-Code has been around since the 50’s, and there are countless libraries for converting standard file formats.

The motion (and beam) adjustment and control stuff that goes on top is also standard for other applications, like CNC.

I stand corrected.

Heck no, I’m just pontificating. I’m certain they have stories anyway!!!

It’s probably frustration that various formats that supposedly support the same concept (scalable vectors) can’t agree!