Welcome! Log In Create A New Profile

Advanced

2D bmp to 3D conversion... How do you do it?

Posted by roygpa 
2D bmp to 3D conversion... How do you do it?
October 11, 2012 10:33AM
have been playing around with printing a few 3D logos for friends (college and pro American football teams) and found a program called b2G that will convert monochrome .bmp file to stl file. Then I clean up the stl file in meshlab and reduce the number of triangles to a point that slic3er won't choke on it. Then print it. The whole process is a pain in the butt.

I have attached an example.

My question is, Is there an easier way to convert a 2D image into a 3D stl file? Any experience b2g not converting to stl file when you push the button to do so?

P.S.: I realize that copying team logos is frowned upon in most places, but I am just doing a few and will soon move onto to something else. I know that doesn't make it any more legal.

Thanks

Roy

Edited 1 time(s). Last edit at 10/11/2012 10:33AM by roygpa.
Re: 2D bmp to 3D conversion... How do you do it?
October 11, 2012 12:05PM
Might also be useful for this thread aswel..

Aha, image magick(often used via the `convert` and `mogrify` commandline) has a text output. It isn't afaik directly something that can be put in a .scad file though.. Looking for tables, of course.
Re: 2D bmp to 3D conversion... How do you do it?
October 11, 2012 12:43PM
Really one of those stupid things they fail to add basic features. Similar to them not adding `-grayscale`(d'oh) so you have to do `-colorspace Gray` which you never remember to do.(like a zillion oddly named linux commands) Maybe someone that doesn't suck at shellscript/perl can turn the silly text output from `convert` into a table..
Re: 2D bmp to 3D conversion... How do you do it?
October 11, 2012 01:21PM
The given file can be compiled with `gcc table_ize.c -o table_ize`, and then to use convert and then this program:
convert yourimage.supported_format yourimage.txt # Convert it to text
cat yourimage.txt | ./table_ize width height > yourimage.dat # Convert it into a table.
Didnt bother reading the width&height from the file, you have to provide it.

The .dat file should be usable in openscad, using the 'surface' thing linked before. Hopefully it isn't shitty.. Also i dont know how to do it in windows. I guess that is why all those stupid websites where you upload stuff you can damn well do on your own computer exist..
Attachments:
open | download - table_ize.c (692 bytes)
Re: 2D bmp to 3D conversion... How do you do it?
October 11, 2012 02:45PM
I use Shapeways Create 2D to 3D.


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Re: 2D bmp to 3D conversion... How do you do it?
October 17, 2012 01:00PM
I wrote a python export plugin for gimp to generate openscad surfaces :

[pastebin.com]


here is a grab of a heightfield source image and the resultant image in openSCAD:

[lh3.googleusercontent.com]

-Rob A>
Re: 2D bmp to 3D conversion... How do you do it?
October 17, 2012 05:08PM
Cool. Maybe make an 'engraving in 3d model' wiki page.

Stupid question: How do i use it? According to the wikibook, i must 'simply', but one does not simply. Frankly i am also against simplying.

I'd prefer to use it from the commandline, possibly as a python lib. How would i get it to find those things it wants to import?

Edited 1 time(s). Last edit at 10/17/2012 05:10PM by Jasper1984.
Re: 2D bmp to 3D conversion... How do you do it?
October 24, 2012 01:29PM
Jasper1984 Wrote:
-------------------------------------------------------

> Stupid question: How do i use it? According to the
> wikibook, i must 'simply', but one does not
> simply. Frankly i am also against simplying.

Assuming you have gimp with python support installed, just save the file as openscad_surface_export.py in your plugin folder.

Then after creating/opening an image, perform a file>save as (gimp 2.6) or file>export (gimp 2.8) and give it the extension .dat

-Rob A>
Re: 2D bmp to 3D conversion... How do you do it?
August 05, 2015 01:29AM
As far as I know the best way to do this is using www.selva3d.com
Its easy, automatic and free smiling smiley
Sorry, only registered users may post in this forum.

Click here to login