Glowforge is interpreting two SVGs with the same size box differently!

I believe that the DXFs coming out of Fusion are “unit-less” so any other app that ingests it has to determine what the units are and adjust it’s rendering appropriately. In Fusion when you bring in an external object like that you have to affirmatively set the units (as you do for new sketches).

I expect this behavior is a result of that.

1 Like

@Jules the issue is that any geometry that is in the fusion.svg file I uploaded will show up in the glowforge UI (and subsequently in your cuts) smaller than the actual measurements that show in inkscape. This does not happen for the hole.svg file. If you copy something that was rendering correctly in hole.svg to fusion.svg and upload fusion.svg, it will render too small . If you copy something from fusion.svg that was rendering too small to hole.svg it will render correctly. Perhaps you can just try it in inkscape, it is really easy to reproduce.

@jamesdhatch the issue occurs in the SVG not the DXF. It occurs even to new geometry that you generate in the SVG that never came from fusion.

1 Like

I’m not sure what your solution is going to be, but I think I can explain the problem…

Shapes in SVG are usually specified using unit-less coordinates. As has been mention already, different programs use different default sizes for these coordinates such as 1/72, 1/90, and 1/92 inch.

In order to set an actual size based on real-world units SVG uses a combination of the viewBox, width, and height attributes you’ll usually see near the top of the file.

The viewBox specifies four numbers which determine the coordinate system used in the drawing. The first two numbers are the x and y coordinates of the top-left corner and the second two numbers are the width and the height of the overall drawing area. The numbers are using the same unit-less coordinate system as the actual drawing.

The width and height attributes specify how big you want the drawing area to actually be and this can be specified using real-world units (mm in this case). In order to render (or cut) the drawing at the correct size, all of the coordinates in the drawing are scaled based on the ratio of the size of the viewBox and the size indicated by the width and height attributes.

In this case, both files have a width and height specified, but only File 2 has a viewBox. Without a viewBox, the correct scale factor can’t be determined so assumptions need to be made and one of 1/72, 1/90, or 1/92 inch will usually be used. If the program drawing (or cutting) uses a different scale than the program that made the file, you wind up with the wrong size.

In the file “hole test 2”, I see that the width and height attributes match the width and height in the viewBox. That means that all of the coordinates are in mm. It’s possible that adding a viewBox=“0 0 454.66 276.85999” to “Fusion Hole Test” (right below the height= line) will fix its size, but only if it is using mm as well.

Hope this helps!

4 Likes

Don’t know if it helped @miskaye, but it sure helped me. :smile: Great description. I’m going to study it.

I did find a possible clue when I tried to open the Fusion Hole.svg file in my version of Inkscape (v0.92.1 r15371).

I got this message when the file opened:

:

If you ignore the message, the file opens with an incorrectly sized result:

But if you choose either Set Viewbox, or Scale Elements in the popup when you open the SVG file, the sizing displays correctly in the Inkscape display:

And the results of those are reflected correctly when the file is loaded into the GFUI. The Inkscape file that had 90 ppi input into Inkscape was sized smaller than the ones that were scaled correctly at 96 ppi input.

Couple of questions…

  1. @miskaye…what version of Inkscape are you running? Is it an older version?
  2. Did you get that SVG file from somewhere else? (Download off web or anything along those lines? It might have been created with an older version.)
  3. If you wouldn’t mind zipping up your DXF file from Fusion and uploading it here, I’d like to run a couple of tests on the original file to see what it does. I almost feel like there’s something just out of reach…almost got it, but not quite.
3 Likes

That error message accurately reflects the scale difference we’re seeing between the two files. I’d say you found the cause.

I’m going to make a note of the 1 inch = 90px for olded Inkscape vs. 96px for newer Inkscape. This will definitely come up again.

1 Like

No matter what the file comes in as Look where the Green box is…


That shows you the size and location if the bottom left hand corner of anything you pick and you can go in and change those numbers to anything you want.

2 Likes

Okay…I think I have it. I did actually find the screen in Inkscape where bitmap dpi values are set, so this is the place you’ll want to check @miskaye.

I’m guessing that the input dpi is set to 90, and the output dpi is set to 96 in your Inkscape Bitmap handling preferences, which would account for the behavior shown. Inkscape is displaying it in the Inkscape program at one resolution, but exporting it at another, and the Glowforge interface is opening what it sees in the export.

(I might be wrong, I’m just theorizing here.)

In Inkscape, if you go to Edit > Preferences > Input/Output > Bitmaps and you set the values as shown below, I think you will see exactly the measurements in Inkscape that you get when you export the file. So what you see in Inkscape will then match what the Glowforge sees in the output file. (And that is for the current version of Inkscape (0.92) so you might want to start by updating that if you are using an older version.)

Make sure that the “Ask About Linking and Scaling” option is checked too…it will throw a warning if you have to rescale an SVG created in an older version of Inkscape.

Reload your DXF into Inkscape using the settings shown above, and see if that corrects the problem with your Fusion Hole test SVG. Let me know if it works. :slightly_smiling_face:

2 Likes

@bradxn, thank you that sounds right. @Jules, I am using inkscape .91 and didn’t see that dialog - maybe that was something recently addressed. I’ll upgrade and see how that affects it. I am skeptical that the bitmap settings would have any effect since there are no bitmaps in this file. Thank you. (I tried to send this last night but the forum made me wait a day)

1 Like

I upgraded to the latest inkscape (.92.3) and things have not improved, in fact it is worse because my workaround no longer works. Here is a file with an object that inkscape is showing has a height of 276 mm. When importing to glowforge it is showing a height of 297 mm and is therefore outside of the cutting area image fusion%20back

This is another SVG that inkscape and glowforge are reading differently - but unlike with the previous SVG, there is no warning in the latest inkscape. Can someone with illustrator reply with what illustrator shows as the height of the object from the above SVG?

Did you set your Inkscape Preferences to match the printout I gave you above? You will probably need to do that first and then import the DXF from Fusion. Make sure that you are keeping units consistent too - if you design in Fusion in mm, stick with mm in Inkscape to open it.

If you want to zip and upload the DXF file I can try one more time to figure out what’s going on, but I’m running out of ideas here.

(And when the Fusion_Back.svg is opened in Illustrator, it shows 295 mm for the height, 480 mm for the width, which is too wide to fit the bed anyway.)

What size specifically (in mm), are you creating it in Fusion?

You have something very wonky going on with the units in your SVG file. It’s simply a corrupted file.

Any time I try to change the display units, it keeps reverting back to pixels. Normally in Inkscape, say if you set display units to inches, you will see the numbers in the SCALE box automatically update to 25.400 because by default Inkscape likes to work in mm. This file however does not update the scale like that, and changing the units from pixels is futile. The changes just won’t stick like they should.

However I did get it to import into the GFUI at proper size after saving as Plain SVG file format. The screenshot below shows the imported file in the GFUI and on the right you can see the Inkscape Document Properties in the window behind the GFUI.

The fix for your issues is simply File>New and stop using “Save As” to create new files.

Here’s a bullet point workflow for importing Fusion DXF’s:

In Fusion:
1: Set Units to mm or in. Doesnt matter which, Inkscape plays nice with either.
2:Export DXF.

In Inkscape:
3: File>New
4: Document Properties> Display Units set to mm or in. You could use pixels but it’s a useless unit in the physical world.
5: Document Properties> Custom Page Size: Set units to in then set Width to 20" and Height to 12". This helps the GFUI read the scale properly if it can’t use the units embedded in the SVG file.
6:Import the DXF file and when the dialogue box comes up asking for Scale Factor, select the “Read From File” option. If the DXF is in Inches and the Inkscape file is in millimeters, or vice versa, Inkscape is going to scale it properly.

I’ve never had a scaling issue with this workflow.

4 Likes

Thanks @mpipes, have you confirmed this workflow continues to work in Inkscape .92.3? That
is the latest version and it seemed to be behaving differently, it generated the file you said is corrupted and behaving strange.

I’m using .92.2 on Mac, there is no .92.3 available for Mac yet… but yes this is the workflow I have used with my early production GF unit nearly 1.5 years now.

1 Like