singwina / heekscad

Automatically exported from code.google.com/p/heekscad
Other
0 stars 0 forks source link

Svg import issues with inkscape svgs #362

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Import the attached svg file which was made in inkscape

What is the expected output?
The design you get when opening it in another svg editor

 What do you see instead?
The attached bad_import.png

What version of the product are you using? On what operating system?
I compiled the git repository about 2 days ago

Please provide any additional information below.

The problem appears to be with importing paths which don't bother to put in the 
letter commands for every action, which svg.cpp assumes that they do. In the 
svg spec is says that instead of writing

<path d="M -2.8571429,1052.3622 l 748.57143,1055.2193 l 745.71429,0.93361119 l 
-8.5714286,6.6478969 l -365.71429,535.21933 l 220,698.07647">

it is also valid to write 
<path d="M -2.8571429,1052.3622 l 748.57143,1055.2193 745.71429,0.93361119 
-8.5714286,6.6478969 -365.71429,535.21933 220,698.07647">

in fact inkscape just writes
<path d="M -2.8571429,1052.3622 748.57143,1055.2193 745.71429,0.93361119 
-8.5714286,6.6478969 -365.71429,535.21933 220,698.07647">
so it seems that the default command is 'l'

I have edited svg.cpp, so it seems to work with my files, I also had to change 
how it dealt with relative coordinates in cubics ('c') - the spec says that all 
the coordinates in the command are relative to the previous point, but the code 
assumed they were relative to one another.

I don't know if my code is right, but it seems to work. 

  cheers

Original issue reported on code.google.com by d...@nakedscientists.com on 27 Aug 2011 at 12:15

Attachments:

GoogleCodeExporter commented 9 years ago
cool! thanks for the changes. we will check them out and push them to the git 
repo.

Original comment by ddfalck2...@yahoo.com on 27 Aug 2011 at 2:29

GoogleCodeExporter commented 9 years ago
your changes have been merged with master on the git repo.

Thanks!

Original comment by ddfalck2...@yahoo.com on 27 Aug 2011 at 5:34