SVGs imported from iDraw lose width

an open source, web based CAM package that works!
Post Reply
greggyb
Posts: 4
Joined: Sat Jun 15, 2013 5:47 pm

SVGs imported from iDraw lose width

Post by greggyb » Sat Jun 15, 2013 6:08 pm

I'm using iDraw [1] to create SVGs. I use the pen tool to create very simple paths. Export to SVG, and import into MakerCam, and I lose width. MakerCam realizes that there are paths, and it gets their heights right, but they all have a width of 1px.

Image

Image

I import my SVG into Inkscape and it displays fine. I re-save as an SVG, and get the same result in MakerCam. (I even tried 'Convert Object to Path', though they should already be paths).

I can create an SVG from scratch in Inkscape and successfully import into MakerCam. It seems that an SVG should be an SVG, regardless of where it's created. What are the variables in creating and saving an SVG that might cause MakerCam to accept it if it originates from one program, but not from another?

Thanks.

[1] http://www.indeeo.com/idraw/

WillAdams
Posts: 8514
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: SVGs imported from iDraw lose width

Post by WillAdams » Sat Jun 15, 2013 9:10 pm

Please post an svg from iDraw --- it's XML, so we can compare its output w/ Inkscape.
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

greggyb
Posts: 4
Joined: Sat Jun 15, 2013 5:47 pm

Re: SVGs imported from iDraw lose width

Post by greggyb » Mon Jun 17, 2013 3:33 pm

I discovered a work around. I import into Inkscape, then use Inkscape to export to Plain SVG.

Didn't know that SVGs are XML. Very cool. Here are the two files:
Attachments
chicago-flag-inkscape-plain.svg.xml
SVG opened in inkscape, saved as "plain svg"
(74.22 KiB) Downloaded 111 times
chicago-flag.svg.xml
the original, from iDraw
(73.46 KiB) Downloaded 117 times

WillAdams
Posts: 8514
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Re: SVGs imported from iDraw lose width

Post by WillAdams » Mon Jun 17, 2013 4:06 pm

Okay, I've looked at this, and the problem seems to be that iDraw is handling its paths using a ``L'' parameter which uses absolute coordinates or some such:

Code: Select all

<path d="M69.818,370.105 L97.532,377.309 L104.785,349.835 L112.662,377.021 L139.895,370.201 L120.443,390.374 L140.923,411.421 L112.642,403.89 L105.265,431.71 L97.34,403.775 L70.25,410.211 L89.559,390.662 L69.818,370.105 z" fill-opacity="0" stroke="#000000" stroke-width="1"/>
Whereas the plain SVG from InkScape emits them as additive points:

Code: Select all

<path
       d="m 69.818,370.105 27.714,7.204 7.253,-27.474 7.877,27.186 27.233,-6.82 -19.452,20.173 20.48,21.047 -28.281,-7.531 -7.377,27.82 -7.925,-27.935 -27.09,6.436 19.309,-19.549 -19.741,-20.557 z"
       id="path3731"
       style="fill-opacity:0;stroke:#000000;stroke-width:1" />
and apparently MakerCAM doesn't handle paths described as iDraw does.

I guess the thing to do would be to file a bug report on GitHub for MakerCAM to have this path description style handled by MakerCAM --- should be a pretty easy fix (if you encounter a ``L'', subtract the previous number to the new one?)).

Glad you found a work-around.

William
Shapeoko 3XL #0006 w/Makita RT0701 Router w/0.125″ and ¼″ Elaire precision collets
Nomad 883 Pro #596 (bamboo)

greggyb
Posts: 4
Joined: Sat Jun 15, 2013 5:47 pm

Re: SVGs imported from iDraw lose width

Post by greggyb » Wed Jun 19, 2013 10:08 pm

This is great. Thanks so much for the quick feedback.

Post Reply