Diary SiteMap RecentChanges About Contact 2008-06 Calendar

Search:

Matching Pages:

2008-06-26 mkhexgrid

So I’m trying to build mkhexgrid.

  1. libpng ok
  2. ignore libjpg for the moment ok
  3. FreeType 2 ok
  4. libgd sucks – I had to configure and build this inside a X11 session!
  5. fortunately I already have libz! :)
  6. and I need the Boost C++ Libraries – I had too add -I/Users/alex/Source/boost_1_35_0 to CPPFLAGS in the Makefile
  7. mkhexgrid ok

The X11 dependency was surprising. I assume there’s a better way to do it, but I don’t know what it is. The error I got without X11:

Pyrobombus:~/Source/gd-2.0.36RC1 alex$  gcc -DHAVE_CONFIG_H -I. -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng12 -g -O2 -MT gdft.lo -MD -MP -MF .deps/gdft.Tpo -c gdft.c  -fno-common -DPIC -o .libs/gdft.o
gdft.c:1405:35: error: fontconfig/fontconfig.h: No such file or directory
gdft.c:1468: error: parse error before '*' token
gdft.c:1468: error: parse error before '*' token

I also noticed that SVG output required px units, which is not true. I submitted the following patch to version 0.1.1:

diff -c /Users/alex/Source/mkhexgrid-0.1.1/grid.cpp\~ /Users/alex/Source/mkhexgrid-0.1.1/grid.cpp
*** /Users/alex/Source/mkhexgrid-0.1.1/grid.cpp~	Wed Jan 10 14:37:42 2007
--- /Users/alex/Source/mkhexgrid-0.1.1/grid.cpp	Thu Jun 26 14:06:37 2008
***************
*** 646,652 ****
              throw runtime_error(string(o) + " is not in px");
           break;
        case SVG:
!          if (u != "px") throw runtime_error(string(o) + " is not in px");
           break;
        case PS:
           if      (u == "pt") ;               // 1 point per point :)
--- 646,657 ----
              throw runtime_error(string(o) + " is not in px");
           break;
        case SVG:
!          if      (u == "pt") ;               // 1 point per point :)
!          else if (u == "cm") d *= 72/2.54;   // ~28.35 points per cm
!          else if (u == "mm") d *= 72/25.4;   // ~2.835 points per mm
!          else if (u == "in") d *= 72;        // 72 points per inch
!          else throw runtime_error(string(o) +
!             " has unrecognized unit `" + u + "'");
           break;
        case PS:
           if      (u == "pt") ;               // 1 point per point :)

Diff finished.  Thu Jun 26 14:08:15 2008

I just used copy & paste to use the same code that was available for PS output.

And finally this is the specfile I used for my map:

output=svg
outfile=hex-layer.svg
hex-side=1in
rows=8
columns=5
grid-color=B3B3FF
coord-color=B3B3FF
coord-size=10pt
coord-distance=0.7in
coord-column-start=21
coord-row-start=11

Yay!! :)

Tags:

Comments

I also found a python extension to generate hex maps in Inkscape via the Cartographers’ Guild thred index. There seems to be a bug that prevents the hexes from actually having coordinates. I’d have to investigate.

AlexSchroeder 2008-08-01 00:53 UTC

Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.

Show Google +1