SVG render error when copy/pasted

Just to report an SVG rendering issue when copy pasting it.
If you copy the SVG bellow and past it in glowforge UI, the top left side becomes weirdly rounded when it should be flat (see image bellow)

<svg id="a" xmlns="http://www.w3.org/2000/svg" width="30.3mm" height="15.2mm" viewBox="0 0 85.89 43.09">
<path style="fill:none; stroke:#00000; stroke-miterlimit:10;" d="M77.2,0.1c0,18.91-15.39,34.3-34.3,34.3S8.65,19.05,8.65.14h0s-8.5,0-8.5,0C.14,23.78,19.31,42.94,42.94,42.94h0c23.64,0,42.8-19.16,42.8-42.8h-8.5Z"/>

image

If that can help, I tried to copy/past it to illustrator and save it, it outputs a sliglty different SVG that renders properly on GF:

<svg version="1.1"  xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30.3mm" height="15.2mm" viewBox="0 0 85.9 43.1" style="enable-background:new 0 0 85.9 43.1;" xml:space="preserve">
<path style="fill:none;stroke:#000000;stroke-width:0.28;stroke-miterlimit:10;" d="M77.2,0.1c0,18.9-15.4,34.3-34.3,34.3S8.6,19,8.6,0.1l0,0H0.1c0,23.6,19.2,42.8,42.8,42.8l0,0c23.6,0,42.8-19.2,42.8-42.8C85.7,0.1,77.2,0.1,77.2,0.1z"/></svg>
1 Like

Weirdness! @emilyhuh ideas?

1 Like

Thanks for bringing this up @francois_dursus!

Have you tried opening the svg and saving it in basically any editor? I checked with our Engineering team and they said that should most likely solve the issue.

2 Likes

Yes as i said it works fine if i put it back in illustrator and save it (it outputs second SVG of my post). It’s not something that blocked me at all no worries :).

But I thought it was worth reporting it as it may mean there’s an SVG parsing issue at some level that may impact any design.

As the design in my report was very simple the mistake was clearly visible, but I’ll be less confident and tempted to double check every detail before printing in the future in case there would be a similar issue.

The peace of mind I had before that was something enjoyable :smile:

2 Likes

Appreciate you flagging! I did let the team know the details of your issue so I did pass this along for documentation, so thank you!

1 Like

Affinity Designer has the same bug. Your SVG is correct, but has a rather unusual sequence of commands:

S8.65,19.05,8.65.14
h0
s-8.5,0-8.5,0

which is valid, but a rather odd way to encode it. Normally an “s” command wouldn’t follow an “h” command. “h0” means “do nothing”. I can easily imagine a bug in which the interpreter erroneously discards the “h0” as seemingly inconsequential — but it’s not inconsequential, because the meaning of the second “s” command depends on the command that precedes it.

So, if the “h0” command is discarded (you can test this for yourself), you will get exactly the incorrect curve you’re observing.

6 Likes

Right up there with the way the GF interprets the even odds on some outputs that is technically correct but, not the normal way things get interpreted.

2 Likes

It’s been a minute since I’ve seen one, but we used to discover a lot of “interesting” behavior of Glowforge’s SVG interpreter. I’m reasonably confident now that if I stick to a well-trodden workflow and always “save as SVG” from Illustrator, I’m unlikely to get caught by any surprises, but you never know.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.