Edited wiki page SVGImport through web user interface.
--- a/SVGImport.wiki Mon Jun 25 13:02:47 2012 +0000
+++ b/SVGImport.wiki Mon Jun 25 13:03:47 2012 +0000
@@ -24,17 +24,17 @@
4) Save and Quit
-6) Open in an editor and verify there is one path. change the path ID attribute to id="base" - this is to work around a bug in the current stable Inkscape extensions tool which was crashing it. Make sure all those groups are removed.
+5) Open in an editor and verify there is one path. change the path ID attribute to id="base" - this is to work around a bug in the current stable Inkscape extensions tool which was crashing it. Make sure all those groups are removed.
-7) 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.
+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.
-8) Save and Quit again
+7) Save and Quit again
-9) Edit the file, and delete everything but the path data. You should have a one-line file starting with something like M1234.3 456.78L3298.3 9023.34 and so on. The coordinates should now be rounded unless you plan to handle that yourself in some way. Here is a vim one-liner to do it.
+8) Edit the file, and delete everything but the path data. You should have a one-line file starting with something like M1234.3 456.78L3298.3 9023.34 and so on. The coordinates should now be rounded 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}}}
If instead you have a format like M 1234.678,9875.323 2345.0,123.45 - you'll want to convert if you want to try the crude script in (10) - otherwise a smarter script would be needed. Here's a Vim one-liner for that syntax {{{s/\(\d\) \(\d\)/\1 L\2/g}}} and {{{s/,/ /g}}}
-10) 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).
+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 0x01 and 0x3F. That's 16-636. See the map format wiki page.
{{{
#!/usr/bin/perl
@@ -57,7 +57,7 @@
}}}
{{{script pointdata > hwpointdata}}}
-11) qCompress the data.
+10) qCompress the data.
{{{g++ -I /usr/include/qt4 -I /usr/include/qt4/QtCore qcompress.cpp -lQtCore}}}
{{{
#include <QFile>
@@ -75,7 +75,7 @@
}}}
{{{./a.out hwpointdata hwpointdata.Z}}}
-12) Convert to base64 and you're done!
+11) Convert to base64 and you're done!
{{{base64 -w0 hwpointdata.Z > mynewhedgewars.hwmap}}}