Hexaflexamaps

Hexaflexamaps

Looking through a very old copy of Martin Gardner’s Mathematical Games, I stumbled upon his article about Flexagons and thought “what would these look like with maps on them?”. This is what they look like (at a really low resolution), but it is much more fun to make your own…

Video of hexaflexamap flexing.

You can either start with this pre-made image, or download a ruby script (requires RMagick and proj4r) and you can make your own.The pre-made image shows the area around CloudMade’s London offices in three styles; Web maps style, Mobile maps style and the award-winning OpenCycleMap style. Web maps style is a clean, general-purpose style showing the rich dataset that OpenStreetMap provides. Mobile maps style is a simple, high-contrast style which is ideal for low-resolution devices. The OpenCycleMap style is a specialist style created for cyclists using data from OpenStreetMap to highlight cyclepaths, bike parks, cycle shops and other features that are relevant to cyclists.

To assemble, you’ll need scissors and glue or tape. Start by printing the image.

The printed hexaflexamap.

Now cut out the image.

The hexaflexamap after being cut out.

Fold along the centreline so that maps are showing on both sides, except for two triangles at the ends.

After folding into a single strip.

Holding the hexaflexamap by the near end in the picture above, fold the rest of the strip behind at the first join between two different map styles.

After the first fold.

Fold behind again after the next change in map style.

After the second fold.

Bring the tail end (on the right above) on top of the head.

Fold the white tab visible above and fold underneath, so that it faces the white tab that we started with and glue them together with paper glue. Tape also works, but thickens the hexaflexamap, which can make it more difficult to flex later on.

After gluing.

After waiting for the glue to dry, fold the hexaflexamap along its lines of symmetry and pinch one of the visible seams.

Pinching a seam.

Looking into the centre, you should now be able to open out the hexaflexamap to reveal a new layer!

The new layer.

Have fun with hexaflexamaps!

Hexaflexamaps

November 12th, 2008 - Posted by Matt Amos in ruby, tips | | 15 Comments

15 Responses to ' Hexaflexamaps '

Subscribe to comments with RSS or TrackBack to ' Hexaflexamaps '.

  1. Thomas Wood said,

    on November 12th, 2008 at 10:57 pm

    Wow, quite awesome.
    Although I’m getting “./flexagon.rb:57:in `url’: undefined method `+’ for nil:NilClass (NoMethodError)” when calling with no args.

  2. britta said,

    on November 13th, 2008 at 8:35 am

    ooooh, flexagons are fun! i haven’t tried making hexagonal ones yet, but i recently learned how to make tetra-tetra flexagons and i put a map on mine: http://jeweledplatypus.org/cgi-bin/blosxom.cgi/text/summermapbook.html

  3. matt said,

    on November 13th, 2008 at 10:08 am

    @Thomas: Ooops! Fixed a bug in the default arguments. Please try downloading the new version of the script.

  4. Thomas Wood said,

    on November 13th, 2008 at 12:16 pm

    Yeah, spotted the bug, I’ve also modified the code to give an option to ‘pan’ or use the 3 tilesets.
    Might be useful as a compact streetmap.


  5. on November 13th, 2008 at 2:39 pm

    [...] Hexaflexamaps [...]


  6. on December 3rd, 2008 at 2:21 am

    [...] of the mapping blogs I follow, CloudMade, turned up a cute little diversion in the form of a way to generate trihexaflexagons, where each of the three faces is a layer on the map: “hexaflexamaps”, [...]


  7. on December 7th, 2008 at 10:59 am

    [...] la cocotte , et celui dans lequel on mets ses doigts…Le terme technique c’est Flexagon(Oui maintenant vous étes grand, il faut des mots complexe pour rédefinir, ce que vous appeliez [...]

  8. Andrew Nicolaou said,

    on January 29th, 2009 at 2:49 pm

    This looks great. I want to try out the script myself but running ‘ruby flexagon.rb’ gives me the following errors:

    dyld: lazy symbol binding failed: Symbol not found: _pj_init
    Referenced from: /Library/Ruby/Gems/1.8/gems/proj4rb-0.3.0/lib/proj4_ruby.bundle
    Expected in: dynamic lookup

    I’ve installed proj 4.6.1 from source and proj4rb 0.3.0 as a gem with no errors. Can anyone help? Are there perhaps some environment variables I need to set?

  9. kehan said,

    on February 26th, 2009 at 10:10 am

    Wow – one nice idea is to use this as an invite to an event! different resolutions maybe as people get closer.


  10. on May 8th, 2009 at 11:27 pm

    [...] war heute zu Besuch hier, und irgendwie wurden wir durch einen Eintrag im CloudMade Blog über Hexaflexamaps inspiriert eine Zoombare Papier Karte zu Basteln. Das Falt-Video über ein ähnliches Gebilde war [...]

  11. Alex said,

    on May 8th, 2009 at 11:30 pm

    This is so cool. Inspired by that, we did a printed but zoomable city map!

    http://self.mestrona.net/blog/2009/gedruckter-zoombarer-stadtplan/

  12. Alex said,

    on June 10th, 2009 at 2:33 pm

    Was anybody able to use the .rb script in Ubuntu?

  13. Alex said,

    on June 10th, 2009 at 2:38 pm

    I think I need to install proj4rb, but it fails. Any hints?

    gem install proj4rb
    WARNING: Installing to ~/.gem since /var/lib/gems/1.8 and
    /var/lib/gems/1.8/bin aren’t both writable.
    WARNING: You don’t have /home/user/.gem/ruby/1.8/bin in your PATH,
    gem executables will not run.
    Building native extensions. This could take a while…
    ERROR: Error installing proj4rb:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.8 extconf.rb install proj4rb
    checking for pj_init() in -lproj… no
    creating Makefile

    make
    cc -I. -I. -I/usr/lib/ruby/1.8/i486-linux -I. -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -I/sw/include -c projrb.c
    projrb.c:2:22: error: projects.h: No such file or directory
    projrb.c:3:22: error: proj_api.h: No such file or directory
    projrb.c:26: error: expected specifier-qualifier-list before ‘projPJ’
    projrb.c: In function ‘proj_free’:
    projrb.c:36: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c:37: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c: In function ‘proj_alloc’:
    projrb.c:45: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c: In function ‘proj_error_message’:
    projrb.c:58: warning: initialization makes pointer from integer without a cast
    projrb.c: In function ‘proj_initialize’:
    projrb.c:87: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c:89: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c:90: error: invalid type argument of ‘unary *’ (have ‘int’)
    projrb.c: In function ‘proj_has_inverse’:
    projrb.c:108: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c: In function ‘proj_is_latlong’:
    projrb.c:119: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c: In function ‘proj_is_geocent’:
    projrb.c:130: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c: In function ‘proj_get_def’:
    projrb.c:141: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c:141: warning: passing argument 1 of ‘rb_str_new2’ makes pointer from integer without a cast
    projrb.c: In function ‘proj_forward’:
    projrb.c:153: error: ‘projLP’ undeclared (first use in this function)
    projrb.c:153: error: (Each undeclared identifier is reported only once
    projrb.c:153: error: for each function it appears in.)
    projrb.c:153: error: expected ‘;’ before ‘pj_point’
    projrb.c:154: error: ‘projXY’ undeclared (first use in this function)
    projrb.c:154: error: expected ‘;’ before ‘pj_result’
    projrb.c:157: error: ‘pj_point’ undeclared (first use in this function)
    projrb.c:159: error: ‘pj_result’ undeclared (first use in this function)
    projrb.c:159: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c:161: error: invalid type argument of ‘unary *’ (have ‘int’)
    projrb.c: In function ‘proj_inverse’:
    projrb.c:183: error: ‘projXY’ undeclared (first use in this function)
    projrb.c:183: error: expected ‘;’ before ‘pj_point’
    projrb.c:184: error: ‘projLP’ undeclared (first use in this function)
    projrb.c:184: error: expected ‘;’ before ‘pj_result’
    projrb.c:188: error: ‘pj_point’ undeclared (first use in this function)
    projrb.c:190: error: ‘pj_result’ undeclared (first use in this function)
    projrb.c:190: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c:192: error: invalid type argument of ‘unary *’ (have ‘int’)
    projrb.c: In function ‘proj_transform’:
    projrb.c:236: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c:236: error: ‘_wrap_pj’ has no member named ‘pj’
    projrb.c: In function ‘Init_proj4_ruby’:
    projrb.c:495: error: ‘DEG_TO_RAD’ undeclared (first use in this function)
    projrb.c:499: error: ‘RAD_TO_DEG’ undeclared (first use in this function)
    projrb.c:503: error: ‘PJ_VERSION’ undeclared (first use in this function)
    make: *** [projrb.o] Error 1

    Gem files will remain installed in /home/user/.gem/ruby/1.8/gems/proj4rb-0.3.0 for inspection.
    Results logged to /home/user/.gem/ruby/1.8/gems/proj4rb-0.3.0/ext/gem_make.out

  14. matt said,

    on June 10th, 2009 at 2:45 pm

    Alex, it looks like you need the “proj” package, which has the libproj headers. After that, the gem install should work.

  15. Alex said,

    on June 11th, 2009 at 11:56 am

    thank you, matt, that solved it!

Leave a reply