export svg into inkscape

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!
thegavs
Posts: 21
Joined: Wed Apr 23, 2014 6:37 am

export svg into inkscape

Post by thegavs »

OS: Linux Mint 16 Petra
Platform: 64-bit
Version: 0.13.1830 (Git)
Branch: releases/FreeCAD-0-13
Hash: ec7636d7aaf2612e9b43cff5d6a424037d53e505
Python version: 2.7.5+
Qt version: 4.8.4
Coin version: 4.0.0a
SoQt version: 1.5.0
OCC version: 6.5.4

I have noticed some thing strange when exporting a sketch from freecad into inkscape. The imported sketch into inkscape is slightly underscale.

For example a simple sketch of a 30mm square will around 29mm when imported into inkscape. Not sure of where the problem lies could be freecad or inkscape.

attched is a screen shot of inkscape. the black square is imported from freecad the red square drawn in inkscape showing the differance.
30mm square red is inkscape black freecad import
30mm square red is inkscape black freecad import
snapshot1.jpeg (121.91 KiB) Viewed 6999 times
any ideas on how to get the import to be exactly to scale?

Thanks

Gavin
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: export svg into inkscape

Post by NormandC »

Have you checked the object properties to make sure of its dimensions? Might it not be that the imported object has an outline width of zero?
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: export svg into inkscape

Post by triplus »

After quick test i would say size depends on 3D view zoom factor? If that is true maybe there is a trick where you could set it to "1:1". If not i would guess you will have to do re-scaling in Inkscape.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: export svg into inkscape

Post by ulrich1a »

The most reliable method is to create a view in a Drawing page with a template and save this page. The objects in the drawing have the original dimension in mm also in inkscape, if the scale is set correct.

Exporting an object as Flat-svg adds a margin of 1% or something around the object.

Ulrich
thegavs
Posts: 21
Joined: Wed Apr 23, 2014 6:37 am

Re: export svg into inkscape

Post by thegavs »

would this be a bug or a feature? I think its a bug as the 1 percent seems random
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: export svg into inkscape

Post by ulrich1a »

thegavs wrote:would this be a bug or a feature? I think its a bug as the 1 percent seems random
It is at least intentionally encoded in the Draft workbench code for the export of a flattened SVG.
It may be usefull for printing that object, but I see also a disadvantage in using it for other purposes.

Ulrich
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: export svg into inkscape

Post by shoogen »

ulrich1a wrote:It may be usefull for printing that object, but I see also a disadvantage in using it for other purposes.
We got different modes of SVG export for different purposes.
Exporting the 3D view, will probably break the scale.
The flattened SVG output has two modes. One for display and printing and one for CAM. Both try to keep the scale. The latter one keeps the the absolute position as well.
Export of the a drawing is yet another mode of SVG output.
I'm willing to improve the SVG exporter. But I need to know what you are trying to achieve with the SVG.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: export svg into inkscape

Post by ulrich1a »

shoogen wrote:The flattened SVG output has two modes. One for display and printing and one for CAM.
I was not aware of the two modes. How would I get the CAM output mode? Is there a switch somewhere?

The flattened SVG without margin or even better with a user defined size in the export dialog has advantages, if you want to combine several of them in one technical SVG-drawing. I like also to try to define hatching patterns with a mm-scale. Those should have advantages in cases were the hatching needs to be scaled by millimeters.
It opens also the way to define SVG-symbols for drawings directly in FreeCAD.

Ulrich
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: export svg into inkscape

Post by shoogen »

ulrich1a wrote:
shoogen wrote:The flattened SVG output has two modes. One for display and printing and one for CAM.
I was not aware of the two modes. How would I get the CAM output mode? Is there a switch somewhere?
It is in the Draft Preferences http://www.freecadweb.org/wiki/index.ph ... references
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: export svg into inkscape

Post by yorik »

This makes me think we really should do something about these import/export formats one day... Users are usually not aware of which module which exporter belongs to, so finding documentation and preferences can be hard... But that's a subject for a separate thread.
Post Reply