Tuesday, September 7, 2010

SVG Mystery Breakthrough - Use PATHS not OBJECTS

It was an international effort; but, I believe we have found a work-around that allows you to import and cut SVG files as long as you have the free Inkscape or other program capable of editing SVG files.

First I want to thank the people that provided the input that resulted in finding this temporary solution.  Each of these people contributed shapes, testing and/or ideas that resulted in this discovery.  As I said, it truly was an international effort! 
Ruthie Gedalovitch - UK
Denise O'Connor - USA
Tina Mac Queen-Ladoucuer - Canada
Thomas Tweedie - Australia
Denise, I believe, was the first person that was able to get an SVG file to cut, so this let us know that it could be done.  But, the rest of us were having no such luck.  Ruthie then followed up with a Flower that she was able to cut correctly.  So, that encouraged us to dig deeper.  Thomas Tweedie still doesn't have his eCraft as yet.  But, what he DOES have is a great analytical mind and Adobe Illustrator, so he was able to create a test file that contributed to the effort and to dig deep inside my files to provide some insight.

But, Tina provided the file that broke this thing wide open.  I had a very simple file with very few commands that threw the eCraft each and every time I ran it.  But, Tina's file was big and complex.  Yet, it cut perfectly.  This led me to explore the underlying differences and what I discovered was that my file made use of an OBJECT to create the circle and Tina's file made use of a PATH to define her scalloped circle.

So, this prompted me to convert my Circle OBJECT into a PATH using Inkscape and importing the modified file into eCraftShop Pro.  And, BINGO!  Success!  Subsequent tests of building SVG files shows that SOME objects, like a box will work; but, other objects, like the circle will not work.  But, all PATHS, so far, seem to work.

Here is the SVG text for the file that does NOT work.  Notice that there is no section called 'path'.  Instead, the circle is defined as an object with an X and Y location and radius. 


Now, here is a view of the same basic file where the circle OBJECT was turned into a PATH.  Notice that the circle now has a beginning and end with NODES defined along the path to define its shape.

 Click Image to see full size

 While you can see that Inkscape made a very compact file into a very verbose file, that is not where the reasl differences lie.  The code at the very bottom of the example is the real meat of the find.  Notice that you can no longer find a Circle Object in this code.  Instead, at the very bottom, you find a PATH with a series of NODES that defines points along the path that draw the same circle we had before.

Apparently, eCraftShop Pro is able to decypher the circle as long as it's a path.  But, has trouble if the source SVG code defines the circle as an object.  So, our workaround, until Craftwell can deliver a patch that fixes this issue, is that if we try to import an SVG and it fails, we can bring that file into Inkscape and covert any offending objects into Paths and try it again.

If you do not have Inkscape, I would be happy to temporarily try to convert offending SVG files while we wait for a fix from Craftwell.  Just email them to me;  tmeeks(at)createandcut.com

We may find other reasons why an SVG file might not cut correctly.  But, at least we've identified one cause.  I hope this is helpful to you and I'm certainly hopeful that it is consistent as my limited tests have been.

4 comments:

Terri Torrez said...

Thanks for all your efforts. This has been amazingly informative. I really want a eCraft but I'm inclined to wait until the software has matured.

Two questions I'm really interested in. 1) how small can it cut on imported images? 2) can the current software cut true type fonts? If so, how small/intricatthanks.

Tom Meeks said...

At this point, it is probably best to wait if you are going to be counting on the software to do intricate fonts, etc.

There are many things that one can do with the eCraft even with the current software issues. And, if you had already purchased one I would definitely urge you to keep it. It is fundamentally a great machine.

But, given the things you are interested in doing, based on the questions you've asked, I would not feel comfortable urging you to purchase an eCraft right away.

eCraft is responsible to develope the software to the point where you are comfortable. And, I have every confidence that they will do so. When they have reached that plateau that will be the time to buy. Keep checking back here. We WILL keep their feet to the fire for both you and Craftwell's sake.

Thank you, Terri-Lynn for your encouragement. It DOES mean a lot because above all I DO want to be informative.

Ruthie said...

YAY - thanks for the shout out - I feel all important now! LOLx

Well done you for finally figuring out where the issue lies!

Rx

Unknown said...

I feel important too even though I did very little :)
I really appreciate all the work you've done!