PDA

View Full Version : SVG hex grids



isomage
10-07-2010, 06:02 AM
I made a little online hex grid generator that outputs SVG files. It's just simple black line on transparency at the moment, but colors would be easy to include, as would hex numbering and so on. Because it's SVG you can scale it however you want without any distortion, load it in Inkscape or GIMP, etc., so some of you might find it useful.

I just did it for fun, but if anyone thinks this is worthwhile or has feature requests let me know and I might expand it into something better.

http://axiscity.hexamon.net/users/isomage/misc/svg-hex.cgi

mearrin69
10-07-2010, 08:20 AM
Awesome. Have some rep. Also, numbering would be a great addition I think. Could you make it so that you can select the font/size used...or so that the text items are "live" so they can be changed in Illustrator, etc.? That'd be cool.
M

ravells
10-07-2010, 03:54 PM
Excellent! Great for making boardgame maps! Thanks!

:: Edit :: This is so cool. Just generated a 100 x 100 hexgrid (which is as much as I'll ever need). Each hex is an individual object so I can use as many as I need. Fabulous! Have some rep! Numbering would be out of this world and very appreciated!

isomage
10-07-2010, 07:02 PM
I've added optional hex numbering, and the text elements are individually editable in inkscape (you can change the font, etc), so I assume they would be in Illustrator too.

Is it roughly what you guys were wanting?

isomage
10-07-2010, 08:34 PM
I just added color options for the grid and the numbering.

ravells
10-08-2010, 03:00 AM
This works like a dream in Drawplus. The colours don't really matter so much to me as I can set those myself, but could I request:

a. Is it possible to have the numbers on a separate layer to the hexes?
b. Is it possible to have different numbering options? For example without the comma or A0, A1, A2 etc where the letters correspond to columns. (trying to think of other conventions)
c. Is is possible to have an optional dot in the middle of each hex (again on a separate layer) to measure lines of sight? (I know some games use these).

I think this is a one of a kind application on the net, you should mention it on Boardgame Geek. I'm sure there are a lot of folks over there who would appreciate it.

isomage
10-08-2010, 05:37 AM
Is it possible to have the numbers on a separate layer to the hexes?

SVG doesn't seem to support layers, but it can handle groups of objects, so I've put the hexes and numbers in their own groups; see if that does the trick.


Is it possible to have different numbering options? For example without the comma or A0, A1, A2 etc where the letters correspond to columns. (trying to think of other conventions)

As a first step toward that, I've added a user-specified format string for the hex labels. The string can contain whatever characters you want, and the special symbols "%x" and "%y" will be replaced with the hex column and row, respectively. So the original formatting (column, comma, row) would be gotten with "%x,%y". If we figure out what other kinds of labels should be possible, I can extend the format options.


Is is possible to have an optional dot in the middle of each hex (again on a separate layer) to measure lines of sight?

Added an "enable guides" option, along with an associated color. The dots will be in their own group.

Steel General
10-08-2010, 07:13 AM
Neat stuff Isomage, not sure if I'll ever need it, but thanks for posting.

ravells
10-08-2010, 01:04 PM
I can't believe how quickly you're doing this....it's like magic! :)

The groups work fine in drawplus as do the centre dots.

The only thing (because I'm thick that way) that I can't work out is what to use to substitute the %x,%y to get different strings? Would it be possible to number the hexes sequentially across or down?

Cheers!

Ravs

mearrin69
10-08-2010, 01:25 PM
Awesome improvements!
M

isomage
10-08-2010, 08:57 PM
Would it be possible to number the hexes sequentially across or down?

It is now :) In a format string, %n will be replaced with the downward sequence number, and %N will be replaced with the across sequence number.

I added to the web page an explanation of how format strings work; hopefully it's a bit more clear, but let me know if there's anything I haven't explained well enough.

RobA
10-12-2010, 11:57 AM
SVG doesn't seem to support layers, but it can handle groups of objects,

That is how Inkscape implements layer/sub-layers.

Take a look at a layered example from inkscape and try to make your layer groups compatible.

-Rob A>

ravells
10-12-2010, 02:05 PM
It all works like a dream in Drawplus on the import!

hohum
10-17-2010, 09:18 AM
Sweet. By the way I love your stuff. I can't seem to get enough of hex maps. Have some rep.

ravells
10-17-2010, 02:29 PM
Oh Iso, I just thought of another potential improvement: Being able to determine the start number of the first hex so that if there are a number maps the user can make them continuous.

cheers

Ravs