SVG Import issues

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
leoheck
Veteran
Posts: 1225
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

SVG Import issues

Post by leoheck »

Hi, I am trying to import an SVG as geometry on FreeCad 18.2

I'm creating an SVG file on Inkscape, it is a shape with 20 x 20 mm.

When I'm importing it I can see 3 issues:

1. The (x) button on the "Select Module" popup window does not work. There is no way to cancel this operation.
2. The imported shape does not have the same size. It is being imported with 21.32 x 21.32 mm
3. It is not centered at the origin

Does anyone know how to fix/workaround the item #2?
Should I file a bug report?
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: SVG Import issues

Post by jmaustpc »

Please always post your version data in the manner explained in the forum rules link above, especially if you are talking about a suspected bug.
leoheck wrote: Tue Jul 16, 2019 2:49 am 2. The imported shape does not have the same size. It is being imported with 21.32 x 21.32 mm
its a well know issue, it's because Inkscape used to be 90dpi but changed to i think its 96dpi because that is correct according to the SVG standard.
leoheck wrote: Tue Jul 16, 2019 2:49 am Should I file a bug report?
there already is one, someone was talking about this just a few days ago.
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: SVG Import issues

Post by TheMarkster »

You could try to use Draft Scale. 90/96 would be the scale.
leoheck
Veteran
Posts: 1225
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: SVG Import issues

Post by leoheck »

Hi jmaustpc, thanks for the feedback, the complete version is this one.

Code: Select all

OS: Ubuntu 19.04
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.2.
Build type: Release
Python version: 3.7.3
Qt version: 5.12.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Please, when referencing something that already exists add the URL here so others can find what you are saying.
there already is one, someone was talking about this just a few days ago.
leoheck
Veteran
Posts: 1225
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: SVG Import issues

Post by leoheck »

TheMarkster wrote: Tue Jul 16, 2019 7:16 am You could try to use Draft Scale. 90/96 would be the scale.
Oh, I see, thanks for that. It is interesting, so Inkscape is using this 96 dpi standard and Freecad does not use it, is it true? Am I missing something?

I feel that the easy fix is to allow the user to select the right DPI scale while importing an SVG.

@jmaustpc Can you please share the issue you were referencing so, I can give my feedback there. Thank you.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: SVG Import issues

Post by openBrain »

leoheck wrote: Tue Jul 16, 2019 12:33 pm Please, when referencing something that already exists add the URL here so others can find what you are saying.
Cf. issue #3420

Maybe to solve your issue, you can try to temporarily modify the Inkscape document scale in Document properties. ;)
leoheck
Veteran
Posts: 1225
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: SVG Import issues

Post by leoheck »

I am trying to use the Draft Scale, but it looks like that it can be scaled up. I can't add floats there. The input field does not accept any coma (pt-BR) or dots (en-US) there.

EDIT: Interesting, this behavior happens when "Uniform scaling is selected". I can use floats if it is unchecked? BUG?

EDIT2: Unchecking it I can add floats but it changes the value to an integer as soon I leave the text field. =/
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: SVG Import issues

Post by kisolre »

There were some problems with locales which were fixed in dev version, might be something related?
leoheck
Veteran
Posts: 1225
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: SVG Import issues

Post by leoheck »

kisolre wrote: Tue Jul 16, 2019 1:50 pm There were some problems with locales which were fixed in dev version, might be something related?
Interesting, I will verify that by setting my computer units to English instead of pt-Br

Also, I made a 1 mm square in Inkscape. It was imported correctly with 10 mm.
However, my other SVG file, which is like a flower, that fits inside a 20 mm square, didn't respect the size as I said previously.
leoheck
Veteran
Posts: 1225
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: SVG Import issues

Post by leoheck »

I was already using English for everything. =/
I have to wait for the fix.

I can fix it externally on Inkscape as well.
But, what about the differences between the scale of my 2 objects, the flower-like was wrong while the square was right.

The only difference between them is that the square was created in Inkscape while the flower-like was created on a different tool, and resized on Inkscape to have the specific dimensions in millimeters.
Post Reply