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?
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?
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"
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.
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.