svg export issues

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
seb_kuzminsky
Posts: 11
Joined: Thu Feb 09, 2012 5:41 am

Re: svg export issues

Post by seb_kuzminsky »

Thanks for the pull Shoogen, and thanks for the guidance Yorik!

Tonight I'll try to make some parts again and see what else I run into :-)
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: svg export issues

Post by NormandC »

Hi guys,

I admit to not understanding everything that's been said. The matter of svg units (mm vs. pixels) is a good one, and I wish we wouldn't settle on status quo (as it's been the case ?).

There is one important problem that has not been addressed yet in FreeCAD, printing in real scale. Due to exactly what seb_kuzminsky said, it is currently impossible to print out an svg produced by the Drawing module in real scale.

I've looked into Inkscape too, and I have found no way to get an svg produced by FreeCAD' Drawing module to be converted to real scale without having to scale all objects manually. But even then, having to go to Inkscape for that is a hassle. It would really be useful if we could get a way to print out a page in the scale it's supposed to directly from FreeCAD.

I'm talking about this because I'm about to work on a home project in FreeCAD, and wish to print drawing views to scale...
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: svg export issues

Post by shoogen »

https://blueprints.launchpad.net/inksca ... real-units
https://bugs.launchpad.net/inkscape/+bug/170738
Maybe we need a third option 'scale to 90dpi (for inkscape)' as long as the viewbox support doesn't respect real world units.
EDIT

The bugs mentioned above only consider the automatic conversion of units in inkscape. So inkscape shouldn't make any problems here.
in the long run printing from FreeCAD is a disireable feature. But someone has to choose a svg renderer.
cairo, webkit??
Last edited by shoogen on Sat Feb 11, 2012 10:15 pm, edited 2 times in total.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: svg export issues

Post by NormandC »

Ouch, second bug is almost 7 years old and still no change. :|

But anyway, I still think we shouldn't need to open another program (Inkscape) to print something generated by FreeCAD, or what's the use of the Drawing module?
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: svg export issues

Post by yorik »

I don't totally understand the problem... When inkscape opens a drawing that is in another unit, it scales it to 90dpi, okay. But what is wrong when you export from the Drawing page? I think if you put things there at 1:1 scale, they should be in the SVG doc at 1:1 too, no?
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: svg export issues

Post by shoogen »

normandc wrote:There is one important problem that has not been addressed yet in FreeCAD, printing in real scale. Due to exactly what seb_kuzminsky said, it is currently impossible to print out an svg produced by the Drawing module in real scale.
Do the results differ in any way when you compare CAM output and drawing (old style) output?
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: svg export issues

Post by NormandC »

yorikvanhavre wrote:I don't totally understand the problem... When inkscape opens a drawing that is in another unit, it scales it to 90dpi, okay. But what is wrong when you export from the Drawing page? I think if you put things there at 1:1 scale, they should be in the SVG doc at 1:1 too, no?
Take a look. Attached zipped svg was exported from the Drawing workbench.

I still think that users should not be forced to install another software so they can print their drawings to the scale they want. The Drawing module should allow that, like in any other software. Here's a screen capture of a Drawing page in A format (US letter which is similar to A4) along with the Print Preview. You can clearly see that it won't print to the correct scale, it's not even worth trying. And there is nothing I can do to correct this within FreeCAD.

Image

As for Inkscape, no it's not 1:1. Here's the original svg opened in Inkscape:

Image
It looks fine, but look at the Document Properties window: its size is 279,40 x 215,9 pixels. But it should be 279,4 x 215,9 millimeters to print to scale.

How the heck do I do that??? Because if I select "US Letter" as page size, look at the size of the template in the page now:

Image

So I have to scale everything on the page manually, and calculate by how much so it prints right.

Now, if I attempt to print the document as is, here's what the Printing dialog tells me:

Image
It considers the page to be 60,9 x 79,9mm! ANd I have no way to set a page format. The Paper size field is greyed out showing "custom".
Attachments
Index_Arm_v4.svg.zip
(8.66 KiB) Downloaded 45 times
Last edited by NormandC on Sun Feb 12, 2012 4:25 am, edited 1 time in total.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: svg export issues

Post by NormandC »

shoogen wrote:Do the results differ in any way when you compare CAM output and drawing (old style) output?
Sorry but I have no idea what you mean in either case.
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: svg export issues

Post by shoogen »

Attachments
a3-land-pdfoutput.zip
PDF Output from QT and from Inkscape for the a3-landscape template
(67.72 KiB) Downloaded 39 times
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: svg export issues

Post by yorik »

Okay, now I understand.
I think shoogen's changes should solve the problem. I'll give it a bit of testing
Post Reply