Bitmap to Mesh
Generates a 2D or 3D mesh from a bitmap image.
Bitmap to Mesh

Generates 2D or 3D meshes from bitmaps.

From heightmaps you can easily generate terrains or any other surface.

Image entities can be converted into 2D pixel grids.

Note! Generates two triangles per pixel!
250x250 pixel image generates a mesh of ~125K faces! ( 250 * 250 * 2 )

Menus & Toolbars

  • Draw » Mesh From Heightmap
  • Context Menu » Mesh From Heightmap
  • Context Menu » Mesh From Bitmap

Requirements

Related Links

CookieWare

I'd be happy if you donate a cookie (or a beer) if you find my plugins useful.

Reviews

Andy F's picture

Stuggling to get this to work on Sketchup 17 or 18, it doesn't allow me to select a depth.

Radya B's picture

Bitmap to Mesh plugin has succesfully installed, but the icons don't want appear in my Sketchup 2016 pro for mac.

ThomThom's picture

This extension doesn't have a toolbar. Please refer to the description for menu locations.

Matt B.'s picture

I can select my bitmap from the "Mesh from heightmap", and pick the origin and width, but when it asks me to select my depth it wont do anything. I can click all over the z axis or manually put in a value for the depth but it wont actually do anything. I get stuck at that point. What am I doing wrong?

ThomThom's picture

It might be that the tool isn't picking the inputpoint properly. Might be easier to explain this with an image, though it's not possible to use images on these comments. Can you repost in the SketchUp forums?

Im having the same issue as the user above. I watched your video and tried to follow it. The guy above is right; after inputing a depth nothing happens. Im going to repost this in the sketchup forums.

Pejman T's picture

Hi ThomThom
Note! Generates two triangles per pixel!

Is it possible to tweek the code not to sample all pixels ... !!!
an option for selecting resulation ..

for example on a 900x900 file , sample one pixel and jump 9 pixel .. so it samples 90x90 pixels from the file ...

your plugins are the best ..

hayesdavies's picture

It works!!!

I had to re-start SketchUp to find the extensions but that isn't unusual.

Thank you very much!

monstercolorfun c's picture

Thanks ThomThom! I was hoping it would make printable objects, but it makes only 2d heightmaps that are not editable to make a solid object? it would be cool to have a flat base from a quad and a triangle for each of the edgees to make a printable stl. awesome code thankyou.

hAHAH THANKS i just tried to use the shell tool to make the map 3d solid object, nice extension, except that i think it extrudes along normals.

Saksham K's picture

Thanks, I found it

Saksham K's picture

i installed that plugin u made but didnt appeared in the extensions menu
i even installed ttlib extension also but no change

-using su 2015 pro

ThomThom's picture

Not all extensions add their menus to the Extension menu. Refer to the description of the extension on this page and you will find that this extension adds menus to the Draw menu and the context menu.

Saksham K's picture

i installed that plugin u made but didnt appeared in the extensions menu
i even installed ttlib extension also but no change

-using su 2015 pro

NGUYENCUONG's picture

Thanks

Adam D.'s picture

Hi ThomThom -

Thanks for designing this plugin. I had a similar symptoms to what Denver R had, but I was able to discover my problem. The plugin fails reading the bitmap header when a 32-bit bitmap with alpha channel was generated (I used GIMP to do my bitmap conversion / save), but works fine with a 24-bit bitmap. You may wish to have the plugin specify that only 24-bit (or perhaps 16) is supported, as there are multiple bitmap formats. GIMP (and perhaps other tools) may default to the 32-bit bitmap.

When this occurs, the Ruby Console generates an error claiming the header error, but still progresses, allowing you to select a width (with a nil computed length). Then, upon selecting a depth, it throws another error, but still waits for you to select a depth, as if the plugin is hung, but SketchUp remains responsive.

Therefore, it may help to generate a pop-up error or simply advertise support for specific bitmap types. Thanks again for the plugin, nice job!

Adam

ThomThom's picture

Hi Adam. Thanks for the feedback. I've added an issue in my tracker for this.
On a side note, I don't think I've ever seen a BMP with alpha - I'm surprised anyone create BMPs like this. 24bit seem to be the common format. I would have though for images with transparency they use other formats like PNGs etc.

Adam D.'s picture

Good point, I was just as surprised to see it as you - but when I converted my TIFF under GIMP, it defaulted to a 32-bit bitmap. Perhaps this was because I started with a TIFF.

ThomThom's picture

That's a good possibility. If the TIFF was 32bit GIMP probably tried to preserve that.
I have an issue open for adding failure feedback: https://bitbucket.org/thomthom/bitmap-2-mesh/issue/1/no-user-feedback-wh...

PikaPhantom G's picture

I can’t do depth. Why?

hayesdavies's picture

Wow! That solves a few problems, that really works! Thanks, brilliant!

But not appaently in SU 2015.
Doesn’t show up in context menu or Draw menu.

And everything I try in 2013 turns out really rough and pointy even when the original image is smooth.
Should be great but a little rough.

Maxwell J's picture

I'm able to import the bitmap file but not much else. I'm using the free edition on my Mac and can't see any option to "create from heightmap", and have no 'plugin' menu bar. I'm wondering if this is an impossible process for the free Mac edition?
Kind of the same problem as Craig C except I have no visible plugin menu. When I 'right click :there don't appear to be any options to do what the extension says it does either.
Would really appreciate some advice. Cheers

ThomThom's picture

Please refer to the extension description to the location of the menus. For this one it's the Draw menu and context menu, Do you find it there?
If not, do you see it under Preferences > Extensions? What version of SketchUp are you using?

Maxwell J's picture

Hey there,

Thanks for helping me out. I have a ‘draw’ menu but no ‘context’ one.
I do see the extension under ‘preferences’, however.
I’m using version 14.1.1283.

Any help greatly appreciated.

Maxwell J

ThomThom's picture

The "context" menu is the right-click menu. So the extension is listed under the Preferences > Extensions list - but you're not seeing the menu items under Draw or the context menu?

Maxwell J's picture

That's correct.
Does it make much difference that I use a Mac?

ThomThom's picture

No, should work fine for Mac as well.
The extensions is enabled in the Extensions list?
Can you post back the exact version number?
Also, what version number is TT_Lib?

Maxwell J's picture

I'm not sure it's enabled but it shows in the list of extensions. There's not much else there to click or do except install additional extensions. I do keep seeing a prompt box saying that TT_Lib needs to be downloaded. I've already done it, I think. Although in truth, I have no idea how I'd check that.

ThomThom's picture

You can check under Preferences > Extensions. Make sure the extension is checked (enabled). And you will be able to see the version number as well.

Maxwell J's picture

I’m using version 14.1.1283.

Maurice B's picture

I don´t understand why it doesnt work in my case?
I just try your tool with drawing a simple circle in black with mspaint, save it as bmp, so this picture is realy poor and uncomplicated, only wite and black, just a circle.
When I use "mesh from hightmap" it generates 3d spikes all over the picture without any context to the drawn circle, it´s just a black circle on white, it seems that it is blind to see what´s there to do ? When I use mesh from bitmap it ALWAYS doesn´t come to an end, after 2 hours, the time panel freezes and I have to shut down SU with taskmanager, because it´s crashed.
I tested it with other very simple bitmaps, for example just a line or other simple drawings, every time the same spikes all over the bitmap or when I use mash to bmp it´s working time rises to eternity! I use SU 15.0.9350 64 bits, ttlib 2.9.13 and bmp to mesh 0.5.1 on win7homeprem.
Any idea?

*Update: It works now ;), but only when I save the pics as png, when I use bmp formats it does the described problems. The other problem is, when I use "mesh from hightmap" it is very quick, when I use with the same picture "mesh from bmp" it still shows working time until eternity, maybe I dont understand the difference between both functions, when to use which one and why it works so long with just a simple circle?

ThomThom's picture

Hm.. it might be that the BMP version you save as isn't being read properly. Can you start a thread on http://forums.sketchup.com/ attaching a sample image file. And perhaps a screenshot of what you see?
If you include "@thomthom" in the message I'll be notified as soon as you post.

Daniel Brastaviceanu's picture

Hi ThomThom!
It works well for me and I'm 3D printing Lithophane Memes and Selfies :)
There is a problem though:
The app groups the resulting mesh and faces
(I can enter and edit the group to build a frame and give it a closed volume for 3D printing,
But when I export to STL, the file is no good, I can't print it. So I have to Explode this Group)
Now when I explode it it takes like 30-45 minutes!!!
I can't figure out if it's the app that does that or if it's SketchUp but it's a big problem for me...
My question:
Is the ''grouping'' step crucial in the process or is it possible to remove this step easily?
It would be Great if the Grouping could be skipped if we need to 3D print or mill Lithophanes.
Thanks man!
Perhaps, for further improvements, you could make the app Merge Coplanar Faces and it would generate lighter Mesh. I usually Posterize my images into 30 shades of gray and there are lots of coplanar faces.

Denver R's picture

how does this work?
plugin does not appear in plugins menu.
although if I right-click on a bitmap i have the options of “mesh from bitmap/heightmap”
selecting either one will prompt a “pick depth” at which point the plugin decides to stop working.
Whether i click at a depth or type the dimension in, nothing happens.
The bitmap file is 600kb, which can possibly be too big...

ThomThom's picture

When you say "nothing happens". Is SketchUp still responsive?
If it is, can you try again but this time with the Ruby Console open and see if you get any errors?
Also, what SketchUp version do you have and what operating system?
The filesize isn't that much of an important factor - it's the width and height of the bitmap. How large is it?

현퇴 조's picture

can't make mesh.

after select bitmap,

point origin.

it draws red rectangle that is longlonglonglonglonglong along to y-axis

and nothing more happens

I did click, enter, enter after number all.
but nothing happens.

I'm using sku2014 make

ThomThom's picture

How big is the bitmap? After you click, is SketchUp still responsive? Large bitmaps will take a long time to process.

Have you tried keeping the Ruby Console open and checked if you get any error messages?

Søren R.'s picture

I have the same problem and I get this error:

SketchUp/Plugins/tt_bitmap2mesh/core.rb:276:in `onLButtonUp'
Error: #

ThomThom's picture

Does that happen with any image? Or a specific one?

Søren R.'s picture

Any image - but the different aproach suggested in this thread worked:

Importing the image, and then right clicking it and making a mesh from that.

ThomThom's picture

Hm... so which method is not working?

Trần V.'s picture

How to stop the process, some times it take tooo looooong and i want to stop it.

Vincent L.'s picture

I cant find any of the menu's your suggesting. Is that because I dont have Sketchup pro?
Tx.

logic's picture

I can get mine to work only if I do the actual height-map in blender then export it back into Sketchup via an .obj conversion after I get the terrain all imported in here, THEN I run the tt-bitmap2mesh.rb (which was load 'tt-bitmap2mesh.rb' loaded in the ruby console, and the TT lib in the extension dialog). It works that way but I would like to leave the whole trip to blender process out if I could....... OKAY, I wasn't clicking enough, THANK YOU ThomThom sir it's really cool.......(this is REALLY COOL!!!)

ماجد ا's picture

gooood

Daniel A's picture

you need to put how I can donate a beer!

Daniel de B's picture

Hi Thomthom,

I'm having troubles with the plugin… I simply can't pick or tape any width.
I'm using a Mac…

ciaociao

Jean-Etienne P.'s picture

Hi Daniel,

I also had the issue (on Mac too). The following recipe works:
1. import (File -> Import) the BMP
2. place it anywhere in the space
3. then you can "create from heightmap" in the menu

Hope this helps.
Jep

Kevin S's picture

Ok, maybe I misunderstood. I was hoping this was going to take the image I had that was black with transparency around the parts I wanted, and essentially turn it into a mesh which I could then extrude into the 3D shape that I'm after.

It took the 256 x 210 image and made a square with 256 * 210 * 2 triangles and ignored the colors and transparency altogether.

Is there not a simple way to take a 2D drawing and make a 3D solid out of it without having to trace it by hand?

Thanks.

Kevin S's picture

Craig, Mesh from Bitmap shows up for me on the right-click menu when you select an image that was imported into SU.
Would love to see that update mentioned with a slider to alter how many pixels are used for the triangles. I'm going to be using this a LOT and that would be very helpful.

Great plugin! Just waiting for it to finish.... :)

[edit]
Oh, and the ability to press ESC to stop the process would be most helpful.

Craig C's picture

Hi Thomthom, having an issue with the plugin. Installed via the extension warehouse and installed TTlib at the same time but nothing shows up in the plugins menu. Had a look via 'preferences- extensions and both the Bitmap to mesh and TTlib are present and ticked. Closed SK2013pro and reopened... same result.??