Edited wiki page SVGImport through web user interface.
authorkyberneticist@gmail.com
Tue, 14 Jan 2014 21:54:39 +0000
changeset 374 8473f5d4d817
parent 373 0f9322acd00a
child 375 b1b18eeea04e
Edited wiki page SVGImport through web user interface.
SVGImport.wiki
--- a/SVGImport.wiki	Tue Jan 14 11:20:29 2014 +0000
+++ b/SVGImport.wiki	Tue Jan 14 21:54:39 2014 +0000
@@ -24,7 +24,7 @@
 
 4) Save and Quit
 
-5) Open in an editor and verify there is one path. Change sodipodi:namedview's ID attribute to id="base" - this is to work around a bug in the current stable Inkscape (0.48.3.1) extensions tool which was crashing it. Note that I haven't tested this workaround. su_v says this is the correct way to do it because apparently id="base" is a reserved name for namedview in sodipodi - which seems like a rather common and collision-likely name.  I had misread him and changed the path's id to base, and that seemed to work fine.  If changing namedview doesn't work, try renaming the path instead.
+5) Open in an editor and verify there is one path. Change sodipodi:namedview's ID attribute to id="base" - this is to work around a bug in the current stable Inkscape (0.48.3.1) extensions tool which was crashing it.  This is probably fixed in 0.48.4. Note that I haven't tested this workaround. su_v says this is the correct way to do it because apparently id="base" is a reserved name for namedview in sodipodi - which seems like a rather common and collision-likely name.  I had misread him and changed the path's id to base, and that seemed to work fine.  If changing namedview doesn't work, try renaming the path instead.
 Make sure all those groups are removed.
 
 6) Open the file in Inkscape again, Click on the path again, then go to Extensions->Modify Path->Flatten Beziers and flatten out the curves to your taste. Default of 10 seems fine most of the time, but for small curved objects you might want something like 5.  Keep in mind, the more the approximation, the more points that Hedgewars has to draw, which can be rough on the engine and network communication.
@@ -37,6 +37,8 @@
 The coordinates should now be rounded for use by the crude script in (10) unless you plan to handle that yourself in some way.  Here is a vim one-liner to do it.
 {{{:s/[0-9][0-9.]*/\=float2nr(floor(submatch(0)*1))/g}}}
 
+Also, it is probably a good idea to remove duplicate points.  Here's a regex for that. {{{s/\(L\d\+ \d\+ \)\1/\1/g}}}  - you should run that a couple of times, then {{{s/M\(\d\+ \d\+ \)L\1/M\1/g}}}.  That just cuts down on a bit of redundancy.
+
 
 9) Convert the path data.  Here is a crude script to do that.  Note this one uses a line size of 1 (that's the 0x01 business).
 If you want larger lines you can pick anything between 0x00 and 0x3F.  That's 6-636.  See the [DrawnMapFormat] wiki page.