Inkscape accuracy?

I am designing in OnShape and then exporting to DXF and using Inkscape to add engraving and details (I don’t have Illustrator on my machine, but my husband has it on his). My husband’s computer is the one next to the GlowForge, so I’ve been emailing him files to print for me. But when he opens them in Illustrator, the sizes are not correct. Stuff is too small by about (but not exactly) 75%. The sizes look about right in Inkscape, but maybe not perfect. I’ve confirmed that the drawing sheets in OnShape are at 1:1. Any other ideas about where to look to chase this discrepancy down?

Thanks!
-Elizabeth

Without more info it’s hard to be sure, but this is often a sign of mismatched scale/resolution/dpi settings. I’d start there.

3 Likes

Yep it sounds like there is a resolution discrepancy somewhere, like someone is working at 72dpi and the other is at 96dpi (which works out very closely to the 75% you mentioned).

Make sure everyone is working at 96dpi as that’s basically the default standard nowadays, and is what the GF app is expecting.

6 Likes

I’m @elizabeth’s husband, so let me fill in a few more details. She was making some boxes, and had OnShape set a kerf. So, for example, if a box was supposed to be 2.500" wide, the kerf compensation might make it 2.504". But after she sent me the file from Inkscape (where, AFAIK, she was mostly just joining the line segments and adding in some text), that dimension grew by around 133% (but not exactly). Inkscape would report it as something like 2.514", and the SVG (as opened in Illustrator) would be larger (I don’t remember the exact numbers; it might be something like 3.368" but I could be off by a bit). Worse, the aspect ratio of the SVG was not exactly as it should have been either.

I did a quick check in Inkscape to look at the settings and suggested changing it from pixels to inches for the document, but that did not help.

Also, when I opened the DXF file from OnShape directly in Illustrator, it looked fine – the dimensions were exactly as they should be (e.g., 2.504").

Where do you find scale/resolution settings in Inkscape?

Do you have the most recent version of Inkscape installed?
(I believe there were some scaling problems with older versions.)

Aside from that, if you set the artboard to 12" x 20", a lot of the scaling problems are overcome. From the tutorial:

Inkscape:

  1. Document Properties: Page = 20 " wide x 12" high.
  2. Inkscape automatically embeds raster images.
  3. Save the file as a Plain SVG type.

.

Don’t know if that will help but it can’t hurt to try. Don’t know what Onshape does to it’s DXF files.

2 Likes

OK. Inkscape does this annoying thing where by default, it is set to include the width of a stroke as part of the overall size of an object, instead of using the “center” of the path. You can change this setting in Inkscape though and see if it then reports the proper size:

It’s under Edit > Preferences > Bitmaps
“Default Export Resolution” and “Default Import Resolution” should both be set to 96dpi. In older versions of Inkscape that was set to 90dpi by default and it caused problems.

Also in Inkscape, set the document size to 20"x12"

6 Likes

I am not familiar with DXF format, but I did do some experimentation with SVG format going between Inkscape and Illustrator. .

IIRC, What I discovered is that Inkscape assumes a DPI value of 96, and will assue this even if there is a viewport element in the SVG that exactly specifies the mapping from physical to user coordinates. Illustrator assumes 72 dpi, but will respect the viewport values if they are there. So what you are describing sounds like exactly the same issue. GFUI assumes 96 dpi, like Inkscape, but unlike Inkscape it will respect the viewport values.

I also saw some mismatches importing an SVG into Fusion360. Things are either correct, or off by a ratio of 96/72 or 72/96. You can work around it by selecting the whole drawing in Inkscape, and then appending *R to the width and height values in the toolbar, where R is the correction ratio.

I would suggest looking into the Kiri Moto extension for OnShape. It has a slicer built into it and makes perfect SVGs that you can user right away or import into Inkscape.

Getting the DXF file resolution issue figured out also works, but I do like the extension.

2 Likes

Where do I find Kiri Moto (and what is it, exactly)? I searched the “Add Custom Features” section but didn’t find it.

It is a slicer and CAM software you can use for 3D printers, lasers or CNCs. You need to go to the App Store.

2 Likes

Found it - thank you! A new toy to play with. :smile:

Once you install it there are a few things to figure out, but check the help docs and forum. Good luck. @henryhbk introduced it to me.

Thank you! This was driving my absolutely nuts!

2 Likes

My experiments in this linked thread were all comparing outputs from Illustrator and Inkscape, rather than imports, but I think the same info applies:

The problems here are, I think, because the user coordinate mapping defined by width, height, and viewbox is is specified in pixels, not real dimensions. I.e., the width and height values either do not have a dimension label, or specify “px”. When saving from Illustrator (using Save As…) the width and height are also defined as pixels, but at 72 dpi.

Thus, importing an Inkscape-saved SVG (be sure to use “plain SVG” instead of “Inkscape SVG”) into Illustrator,all dimensions will grow by 96/72 and going the opposite direction will shrink by 72/96.

The GFUI uses 96 DPI by default, unless it sees a comment in the SVG indicating it was generated by Illustrator.

To enable the two of you to pass SVGs back and forth, editing them in Inkscape and Illustrator, change the width, height, and viewbox attributes as follows:

If the SVG came from Inkscape: width=“20in” height=“12in” viewBox=“0 0 1920 1152”

If the SVG came from Illustrator: width=“20in” height=“12in” viewBox=“0 0 1440 864”

This will mark the SVGs with 20x12 artboards at the correct user units for each. There may be a vertical shift between the two if the source artboard in Inkscape was not 12” high, since Inkscape flips the Y axis, having origin at lower left instead of upper left.

1 Like

So it sounds like I should stop cleaning up her Inkscape files in my Illustrator, and just send the Inkscape-produced SVG files directly to GFUI.

If you were only adjusting scale, I would agree with that statement.

1 Like