Heightmap to STL
Description
Supported Image Formats: GIF, PNG (preferred), JPEG, BMP
Instructions
digitalmindsoft.eu/forums/showthread.php?8504-Tutorial-to-extract-heightmaps-from-Google-Earth-in-GEM
After you finished step 10 convert the image with heightmap2stl.
Usage:
java -jar heightmap2stl.jar 'path to imagefile' 'height of model' 'height of base'
Arguments:
'path': Path to the heightmap (png, jpegs,... )
'height of model': Z scale of the model. Height of the max elevation.
'height of base': Height of the base, the model stands on.
sourceforge.net/projects/heightmap2stl/?source=directory - Feel free to contribute.
Attached is a low resolution model of the above provided heightmap.
You must be logged in to post a comment.
Hi, thanks for the cool JAR : ) I have a problem, after converting the PNG to to STL file, I opened it in MakerWare. It seems the grid lines are drawn into the model, it goes right into the model. Am I doing something wrong?
[IMG]http://i40.tinypic.com/1j9a83....[/IMG]
Screen shot at
http://tinypic.com/view.php?pi...
Is there anything I can do in MicroDEM or GIMP that will result in
smaller STL file size? Right now I have a lot more resolution then I
need.
Also, do you have any tips on setting the heights so it's to scale?
I get this error when I run the script:
Processing - 3D Topo test.tga
java.lang.IllegalArgumentException: Empty region!
at javax.imageio.ImageReader.computeRegions(ImageReader.java:2689)
at com.sun.imageio.plugins.wbmp.WBMPImageReader.read(WBMPImageReader.java:184)
at javax.imageio.ImageIO.read(ImageIO.java:1422)
at javax.imageio.ImageIO.read(ImageIO.java:1282)
at com.heightmap.Main.main(Main.java:49)
I don't know what it means. Your script and the tga file are in the same directory, this is the command I typed:
java -jar heightmap2stl.jar "3D Topo test.tga" 10 100
I'm wondering how you made the base come out properly. I have been using your script on a height map I created and when I slice the file using slic3r and check out the layers it seems like the object gets chopped in 1/2 along the z axis on the xy plane (that is, it starts printing halfway up the object and doesn't print the bottom half). I tried editing the stl file in freecad and meshlab by raising the object to the z floor and nothing seems to work. Can you provide a step by step tutorial from creating the file to creating the g-code? I literally have been working for hours on this and can't find anything helpful. Thanks,
Mike
hey, thanks for posting this. I put a test png image into the program, just 256px strip that ranged from 0-255, and I found that the stl file that was generated was curved. So it seems that the relationship between greyscale value and height in this program is not linear? can you suggest a way to make it linear?
thanks!
amanda
I just discovered that the file can be imported directly into openscad. Open the .asc file that was downloaded from google earth.. open it with notepad.. delete the header part and save it as surface.dat
surface(file = "surface.dat", center = true, convexity = 20);
Note: You need a lot better computer than my laptop to render it.
This is pretty awesome.
I have a feature request: can you make it respect transparent pixels? If I have a transparent pixel in a GIF or PNG, make it a hole in the model (or outside the model if on the edge).
There are lots of non-rectangular things which can be modeled as 2D heightmaps, like medallions, sheriff's badges
, etc. This would open up a whole new set of tools for creating 3D objects: design in Photoshop or Illustrator, export as transparent PNG, and convert to STL.
Thanks, this is just what I needed. I've tried every 3d program I have and they all bail on my 1100x1500 binary height map. This program worked very well after I bumped up the memory limits in the JVM by passing -Xmx819200k on the command line (this is probably an unreasonably large number - I just needed it to be big enough to not exhaust the heap).
You can also use MICRODEM to simply export a 3D model (.OBJ) file of the displayed map. I used the GPS tool to enter real-world GPS coordinates for the 4 corners of my 40 acre property, then zoomed to that region
&
amp; exported a 3D model of it. This creates a VERY large file (mine was 205MB) which can then be edited in most 3D programs.
Alternately, you can also create a 3D height field (elevated mesh) using Rhinocerous, using a greyscale image of your property terrain data. ;) This creates a much smaller file to work with, as well.
I am getting the following error when I try to use heightmap2stl:
Ripped-Pants:Downloads username$ java -jar heightmap2stl.jar sandias.tga 100 3
File: sandias.tga
Model height: 100.0
Base height: 3.0
-----------------------
Processing - sandias.tga
java.lang.IllegalArgumentException: Empty region!
at javax.imageio.ImageReader.computeRegions(ImageReader.java:2689)
at com.sun.imageio.plugins.wbmp.WBMPImageReader.read(WBMPImageReader.java:184)
at javax.imageio.ImageIO.read(ImageIO.java:1422)
at javax.imageio.ImageIO.read(ImageIO.java:1282)
at com.heightmap.Main.main(Main.java:49)
I am on a Mac with OS X 10.6.8 and the following Java verison:
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
Can you specify how to install, and start the software?
after unjar on my mac...
thers just this bunch of files with strange endings (.class,.so,.h,)
.. nothing i can open with anything i have.
crossover wont recognise it as app either.
Its a terminal application, so just download it. Open your terminal, navigate to your download folder and start it with this command:
java -jar heightmap2stl.jar 'path to imagefile' 'height of model' 'height of base'
Example: java -jar heightmap2stl.jar image.png 50 5
Hope this helps.
Sounds interesting but I am clueless with what to do with these files
License

In my map, the highest point is 12441 ft and the lowest is 6800. if I make my base 10, what should I make the model height to be so the terrain stays to scale?