Testing TechDraw: SVG export failing ?

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Testing TechDraw

Post by HoWil »

wandererfan wrote:
HoWil wrote:I attached the two .svgs I just exported with fc techdraw and drawing-wb.
my TechDraw output:
<svg width="297mm" height="210mm"
viewBox="0 0 2970 2100"

your TechDraw output:
<svg width="301.752mm" height="213.36mm"
viewBox="0 0 297 210"

301.752 / 297 = 1.016
1.016 * 200 = 203.2

It appears your version of FC does not include this fix:
git commit 94a647a94c Fix Svg export page & text size in HiRez (merged Jan 29, 2017) which addressed this issue.

Your version seems to predate this version http://www.forum.freecadweb.org/viewtop ... =9&t=20385 since the viewBox numbers are only 3 digits instead of 4.

This confuses me a bit since your git version would seem to be new enough to include these changes.
Also the model is no old one. I created it yesterday or the day before.
BR
Howil
User avatar
wandererfan
Veteran
Posts: 6265
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Testing TechDraw

Post by wandererfan »

After a walk on the beach to clear my head and wait for a clean build of master, I get these results:
Part Measure on imported SVG
Part Measure on imported SVG
HoWil_CleanMaster.png (4.04 KiB) Viewed 2833 times
svg file:
...
<svg width="297mm" height="210mm"
viewBox="0 0 2970 2100" ...

So my guess would be that your build is broken somehow.

wf

OS: Ubuntu 12.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10611 (Git)
Build type: debug
Branch: master
Hash: 44a9ecd25f27ec3efe52c9de9c95ef2b3e19dd17
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
OCC version: 7.1.0
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Testing TechDraw

Post by NormandC »

HoWil wrote:
NormandC wrote:Hello HoWil,
Did you know that QCad can open SVG files? I have an AppImage of QCad 3.15 here.
Dear NormandC,
Why not using FC ;) .
Because you obviously thought FreeCAD is at fault, and I proved it was not so with a third-party program...
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Testing TechDraw

Post by HoWil »

NormandC wrote:
HoWil wrote:
NormandC wrote:Hello HoWil,
Did you know that QCad can open SVG files? I have an AppImage of QCad 3.15 here.
Dear NormandC,
Why not using FC ;) .
Because you obviously thought FreeCAD is at fault, and I proved it was not so with a third-party program...
Thx for the help.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Testing TechDraw

Post by HoWil »

wandererfan wrote:After a walk on the beach to clear my head and wait for a clean build of master, I get these results:

HoWil_CleanMaster.png

svg file:
...
<svg width="297mm" height="210mm"
viewBox="0 0 2970 2100" ...

So my guess would be that your build is broken somehow.

wf

OS: Ubuntu 12.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10611 (Git)
Build type: debug
Branch: master
Hash: 44a9ecd25f27ec3efe52c9de9c95ef2b3e19dd17
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
OCC version: 7.1.0
Sounds really bad. How to proceed? I myself only have ubuntu 16.04 systems at hand. Can test it on some other systems. Nevertheless my fc-installation is pretty clean since I re-installed it from ppa and removed all unnecessary macros and workbenches after another problem (https://forum.freecadweb.org/viewtopic. ... 23#p165574)
BR,
Howil
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Testing TechDraw

Post by HoWil »

wandererfan wrote: It appears your version of FC does not include this fix:
git commit 94a647a94c Fix Svg export page & text size in HiRez (merged Jan 29, 2017) which addressed this issue.

Your version seems to predate this version http://www.forum.freecadweb.org/viewtop ... =9&t=20385 since the viewBox numbers are only 3 digits instead of 4.

This confuses me a bit since your git version would seem to be new enough to include these changes.
Did test it on another machine with two different versions of FC, The current form ppa and a self-compiled from Bernd's FEM branch (FreeCAD_bhb) from 20170226:
  • OS: Ubuntu 16.04.2 LTS
    Word size of OS: 64-bit
    Word size of FreeCAD: 64-bit
    Version: 0.17.10611 (Git)
    Build type: None
    Branch: master
    Hash: 44a9ecd25f27ec3efe52c9de9c95ef2b3e19dd17
    Python version: 2.7.12
    Qt version: 4.8.7
    Coin version: 4.0.0a
    OCC version: 7.1.0

    OS: Ubuntu 16.04.2 LTS
    Word size of OS: 64-bit
    Word size of FreeCAD: 64-bit
    Version: 0.17.10305 (Git)
    Build type: Unknown
    Branch: femdev
    Hash: 99ba07bc814a85ccad6b3ed98b341a436720c87d
    Python version: 2.7.12
    Qt version: 4.8.7
    Coin version: 4.0.0a
    OCC version: 6.8.0.oce-0.17
Same Problem but hopefully it is helpful.
BR, HoWil
User avatar
r-frank
Veteran
Posts: 2180
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Testing TechDraw

Post by r-frank »

FreeCAD and inkscape seem to measure different.
While inkscape seems to measure the outer dimensions on objects,
FreeCAD uses the middle or the inner dimensions.

So the recommendation for exporting svg from inkscape to FreeCAD is
to set the stroke width (within inkscape) to "0" (zero).

If i understood correct you guys are facing exactly this ...
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
User avatar
wandererfan
Veteran
Posts: 6265
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Testing TechDraw

Post by wandererfan »

HoWil wrote:Did test it on another machine with two different versions of FC, The current form ppa and a self-compiled from Bernd's FEM branch (FreeCAD_bhb) from 20170226:
Can you show me the top of the SVG output from each case? This is the interesting bit:
<svg width="297mm" height="210mm"
viewBox="0 0 2970 2100" ...

Thanks
User avatar
wandererfan
Veteran
Posts: 6265
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Testing TechDraw

Post by wandererfan »

r-frank wrote:So the recommendation for exporting svg from inkscape to FreeCAD is
to set the stroke width (within inkscape) to "0" (zero).
I believe the problem is going the other direction: FreeCAD to Inkscape. Using ""snap cusp nodes" in Inkscape's measuring tool seems to go from centre to centre.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Testing TechDraw

Post by HoWil »

r-frank wrote:FreeCAD and inkscape seem to measure different.
While inkscape seems to measure the outer dimensions on objects,
FreeCAD uses the middle or the inner dimensions.

So the recommendation for exporting svg from inkscape to FreeCAD is
to set the stroke width (within inkscape) to "0" (zero).

If i understood correct you guys are facing exactly this ...
Nop, Inkscape can measure directly onto the path (middle of the seen line). There is a snapping option exactly for this Snap-ControlsBar->Snap nodes path and handles->Snap cusp nodes . Yes there is also an option to snap/measure the outer dimensions of a drawn element including the linewidth (bounding box) but this is not used here.
wandererfan wrote:Can you show me the top of the SVG output from each case? This is the interesting bit:
<svg width="297mm" height="210mm"
viewBox="0 0 2970 2100" ...

Thanks
Here it is (the file was prior included)

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="301.752mm" height="213.36mm"
 viewBox="0 0 297 210"
 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  version="1.2" baseProfile="tiny">
<title>FreeCAD SVG Export</title>
<desc>Drawing page: Page exported from FreeCAD document: mod_with_drawing</desc>
<defs>
<radialGradient gradientUnits="userSpaceOnUse" cx="270.583" cy="33.9" r="19.5714" fx="270.583" fy="33.9" xml:id="gradient1">
    <stop offset="0" stop-color="#ff6d0f" stop-opacity="1" />
    <stop offset="1" stop-color="#ff1000" stop-opacity="1" />
</radialGradient>
<radialGradient gradientUnits="userSpaceOnUse" cx="282.646" cy="29.149" r="19.5714" fx="282.646" fy="29.149" xml:id="gradient2">
    <stop offset="0" stop-color="#71b2f8" stop-opacity="1" />
    <stop offset="1" stop-color="#002795" stop-opacity="1" />
</radialGradient>
</defs>
...


If you need more please let me know,
BR,
HoWil
Post Reply