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 »

The .svg exported with drawing-wb looks like

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:freecad="http://www.freecadweb.org/wiki/index.php?title=Svg_Namespace"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="297mm"
   height="210mm"
   viewBox="0 0 297 210"
   version="1.1"
   id="svg2"
   sodipodi:version="0.32"
   inkscape:version="0.48.5 r10040"
   sodipodi:docname="A4_Landscape.svg"
   inkscape:output_extension="org.inkscape.output.svg.inkscape">
  <!-- Working space 10 10 287 200 -->
  <!-- Title block 147 153 287 200 -->
  <metadata
     id="metadata849">
    <rdf:RDF>
      <cc:Work
EDIT
So it looks like the dimensions of the exported .svg are different... causing the scaling?
User avatar
wandererfan
Veteran
Posts: 6307
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Testing TechDraw

Post by wandererfan »

HoWil wrote:Here it is (the file was prior included)
We already know that the original included file has the wrong page size. I wanted the output from the two other versions you tested with. If they put out the wrong page size then there is a build problem somewhere because master branch now produces the correct page size for an A4 template.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Testing TechDraw

Post by HoWil »

Current I do have access to the following systems:

OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10646 (Git)
Build type: None
Branch: (detached from 732bd85)
Hash: 809758b7395f8e591a8a196459bf5a014a864aaf
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0

yields:

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: Unnamed</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>
##########################
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10056 (Git)
Build type: Unknown
Branch: femdev
Hash: aebf667a60194df8a454fb70af72bbc4f0194911
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0

yields

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: Unnamed</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>
##########################
in Virtualbox:
OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9802 (Git)
Build type: None
Branch: master
Hash: bef81531eeb61b31d23b9603364511b76f1f9633
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

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: Unnamed</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>
##########################
in Virtualbox (system above updated/upgraded to current version):
OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10646 (Git)
Build type: None
Branch: (detached from 732bd85)
Hash: 809758b7395f8e591a8a196459bf5a014a864aaf
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0

yields

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: Unnamed</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>
Maybe others could test this on Linux as well!!

Steps to reproduce the above:
Start FC
change in Part-wb
draw a cube-solid
in data-view change the length of the solid to 200mm (this step is only needed if you want to see my results for a 200mm long beam)
change to Techdraw
insert new default drawing
insert new view of the Part and insert a dimensions on the 200mm edge
export the drawing as .svg
edit the .svg with a text-editor and copy/past the first lines here.

BR,
HoWil
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Testing TechDraw

Post by HoWil »

And the two versions from another machine as the above related to this post https://forum.freecadweb.org/viewtopic. ... 30#p167282
###############################################################
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

yields

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: Unnamed</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>

###############################################################
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

yields

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: Unnamed</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>
User avatar
wandererfan
Veteran
Posts: 6307
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Testing TechDraw

Post by wandererfan »

The only way I can get a wrong page size is by using a version prior to this:

OS: Ubuntu 12.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9893 (Git)
Build type: debug
Branch: HoWil
Hash: 64d0eb95f306495d678a9f8daba43e159f0b3486
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
OCC version: 7.1.0
(Page size fix installed - 64d0eb95 - 2017-01-30)

Don't know what to tell you at this point. Open to suggestions.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Testing TechDraw

Post by HoWil »

no one else using Ubuntu 16.04.2? or at least another linux other than 16.04 and 12.04? Have tested all my systems but all on 16.04 show the same behaviour.
Thanks in advance,
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: SVG export failing ?

Post by r-frank »

Splitted for better readability.

Please make seperate posts for seperate topics ...
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
Chris_G
Veteran
Posts: 2593
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Testing TechDraw: SVG export failing ?

Post by Chris_G »

Hi,
Here is what I get :

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: Unnamed</desc>
FC info :

Code: Select all

OS: Ubuntu Zesty Zapus (development branch)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10661 (Git)
Build type: None
Branch: master
Hash: 3b6020cda8fb91b3de33cf812975f1bd2f29cac1
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
User avatar
wandererfan
Veteran
Posts: 6307
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Testing TechDraw

Post by wandererfan »

HoWil wrote:no one else using Ubuntu 16.04.2? or at least another linux other than 16.04 and 12.04? Have tested all my systems but all on 16.04 show the same behaviour.
Finally got a machine up and running on 16.04 and I CAN reproduce your results. Try adding this to the TechDraw section of your "user.cfg" and let me know what results you get.

Code: Select all

            <FCParamGroup Name="Rez">
              <FCFloat Name="Resolution" Value="10.000000000000"/>
            </FCParamGroup>
It seems to fix the problem here :D , but I don't know why :cry:

wf
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Testing TechDraw: SVG export failing ?

Post by HoWil »

Chris_G wrote:Hi,
Here is what I get: ...
Thx Chris _G and Thx wandererfan for taking and testing this serious/ly. I do a lot of laser cutting for work and also private and this is absolutely a showstopper. Thx again.
r-frank wrote:Splitted for better readability.
Please make seperate posts for seperate topics ...
Thx Roland. It was not my intention to overtake the original thread. Good decision. Maybe
"Testing TechDraw: scaled SVG export" is a better title.

I am on my way home and will test the suggested.
BR
Howil
Post Reply