Skip to content

fra99le/Map2Globe

Repository files navigation

Map2Globe: Image to 3D Model Converter

Map2Globe is a command-line utility that takes as input an equirectangular projection global map and produces multiple STL files, one per color, for 3D printing.

Getting Started

Dependancies

Packages for these dependancies should exist for most Linux distributions and are available via macports on macOS.

  • libpng

In Debian Linux:

$ sudo apt-get install cmake libpng-dev

In macOS using macports:

$ sudo port install cmake libpng

Linux or macOS

Build from source with cmake:

$ git clone https://github.com/fra99le/Map2Globe.git
$ cd Map2Globe
$ cmake .
$ make

Build from source without cmake:

$ git clone https://github.com/fra99le/Map2Globe.git
$ cd Map2Globe
$ make -f Makefile.unix

Usage

Map2Globe is configured through command line options.

Command line options

Required

-m map.png Image file that contains the map.
-o directory Name of directory for STL output files.

Optional

-r radius Radius is the globe, in mm. (default: 37.5)
-n number Number of colors to reduce map to. (default: 5)
-c <list of RGB values> Explicitly list color space centroids.
-d depth.png Topography image.
-k levels Number of recursive subdivision allowed for topography enhancement (default: 3)
-i inner_radius Radius of inner sphere lacking surface detail, in mm. (default: 35.1)
-p length Minimum triangle size, in mm. (default: 0.1)
-s levels Number of recursive subdivisions when making initial sphere (default: 5)
-e levels Number of recursive subdivisions allowed for detail enhancement (default: 3)
-3 Subdivide each triangle into 3 sub-triangles.
-4 Subdivide each triangle into 4 sub-triangles. (default)
-7 Subdivide each triangle into 7 sub-triangles.
-z a:b[:c] Specify size of radius changes due to topographic map.
a: change in radius for zero value in topo map. (default: -2.0)
b: change in radius for 255 value in topo map. (default: 2.0)
c: color channel to use. (default: 1)
-h Show help information.

Examples

Simple Globe

Starting with the Blue Marble image, a globe can be produced with the following command.

$ ./m2g -m Blue_Marble_2002.png -n 5 -o Blue_Marble

This will create 5 STL files in the Blue_Marble subdirectory. The color of each STL file is given in RRGGBB format in the filename.

Specifying colors

In the above example, it should also output to the screen, something along the lines of:

Equivalent Commandline Options:
-c '#e3d7c1,#0a0a32,#a59f93,#6f6743,#354415'

By adding the -c option to the command-line options, the costly step of picking of the colors can be skipped. This can be useful when optimizing print time vs model size.

$ ./m2g -c '#e3d7c1,#0a0a32,#a59f93,#6f6743,#354415' -m Blue_Marble_2002.png -o Blue_Marble -r 35.0

Globe with Topography

By combining the Blue Marble image and an aligned topographic map, a globe with topography can be produced with the following command.

$ ./m2g -m Blue_Marble_2002.png -d World_elevation_map.png -r 35 -i 32 -z -2:2:1 -n 5 -o Blue_Marble_With_Elevationi

This will create 5 STL files in the Blue_Marble_With_Elevation subdirectory. The color of each STL file is given in RRGGBB format in the filename.

About

Convert world map image files into STL files for 3D printable globes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors