View Issue Details

IDProjectCategoryView StatusLast Update
0002062FreeCADBugpublic2015-12-15 13:17
Reporterchris33 Assigned Toyorik  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformlaptopOSwindow 8OS Versionx64
Product Version0.15 
Fixed in Version0.16 
Summary0002062: svg size different on import
Descriptionwrong dimensions to svg when converting faces from edges and then extrude
Steps To Reproducedraw a circle i used 16mm in diameter in a svg i used inkscape and seriff draw plus, the import it as svg in freecadthe convert edges to faces and extrude it 6mm the measure it comes out at 26.002mm o reverted back to stable 0.14 to see why and thats how found out it was that version
TagsNo tags attached.
FreeCAD Information

Relationships

has duplicate 0002090 closedyorik SVG import scaling is incorrect 

Activities

yorik

2015-04-19 04:26

administrator   ~0006045

Can you attach your SVG file here?

wmayer

2015-04-19 10:17

administrator   ~0006047

I can reproduce the behaviour. Load attached SVG file into FreeCAD using importSVG. Then:
edge=App.ActiveDocument.ActiveObject.Shape.Edge1
edge.Curve.MajorRadius # ==> 17.052650837221524
edge.Curve.MinorRadius # ==> 17.052650837221524

But the radius should be 8.0.

wmayer

2015-04-19 10:17

administrator  

Zeichnung-3.svg (Attachment missing)

wmayer

2015-04-19 10:23

administrator   ~0006048

Funny is when you make the circle 160mm in the SVG file and load this into FreeCAD then the radius (79.15139370954502) is almost correct.

yorik

2015-04-19 17:40

administrator   ~0006051

Beware that in the SVG file, the 160mm diameter circle is scaled (there is a transform attribute with a scale value of 0.3487078). So the result won't be 160mm anyway. There is no bug in FreeCAD there. If it's in the SVG file, it will be applied.

But, even when we remove that transform attribute, the result is scaled. There is indeed a scaling that occurs in importSVG.py below line 465. If a paper size is specified in the SVG file, a scaling factor is calculated. If not, a scaling occurs too... I don't remember why that was introduced, maybe shoogen will know better

yorik

2015-04-19 17:40

administrator   ~0006052

Reminder sent to: shoogen

Can you have a look at this shoogen?

shoogen

2015-04-25 09:58

developer   ~0006087

@Werner: The almost correct is due the fact the inkscape adds the linewidth to the diameter. (And due to a possible rounding in the 90dpi user units when exporting from inkscape with a limited number of decimal places)

@Yorik: The scaling should work correctly if the width and height is given in absolute Units and if the viewbox is specified.
The file Zeichnung-3.svg. Has millimeters given in the width and height attribute. But there is no viewbox information.
I have no idea how to interpret this file.

yorik

2015-05-07 20:46

administrator   ~0006126

Would it make sense to add a preferences setting to disable SVG import scaling? It would be an easy fix...

Related Changesets

FreeCAD: master d4f3cb72

2015-05-09 19:57:36

shoogen

Details Diff
use transformGeometry in importSVG

partly reverts f045df1ef374a5853b79acc062eef2c0667ed311 as workaround
for issue 0002062
Affected Issues
0002062
mod - src/Mod/Draft/importSVG.py Diff File

FreeCAD: master 3665b778

2015-09-06 04:35:52

yorik

Details Diff
Draft: Added a pref option to disable SVG page scaling on import - fixes 0002062 Affected Issues
0002062
mod - src/Mod/Draft/Resources/ui/preferences-svg.ui Diff File
mod - src/Mod/Draft/importSVG.py Diff File

Issue History

Date Modified Username Field Change
2015-04-18 21:30 chris33 New Issue
2015-04-19 04:26 yorik Note Added: 0006045
2015-04-19 10:17 wmayer Note Added: 0006047
2015-04-19 10:17 wmayer File Added: Zeichnung-3.svg
2015-04-19 10:23 wmayer Note Added: 0006048
2015-04-19 17:40 yorik Note Added: 0006051
2015-04-19 17:40 yorik Note Added: 0006052
2015-04-19 17:50 shoogen Assigned To => shoogen
2015-04-19 17:50 shoogen Status new => assigned
2015-04-25 09:58 shoogen Note Added: 0006087
2015-05-06 15:32 yorik Relationship added has duplicate 0002090
2015-05-07 20:46 yorik Note Added: 0006126
2015-05-09 20:31 shoogen Changeset attached => FreeCAD Master master d4f3cb72
2015-09-06 02:36 yorik Changeset attached => FreeCAD Master master 3665b778
2015-09-06 02:36 yorik Assigned To shoogen => yorik
2015-09-06 02:36 yorik Status assigned => closed
2015-09-06 02:36 yorik Resolution open => fixed
2015-12-15 13:17 yorik Fixed in Version => 0.16