How can I transform a 2d image into a 3d model?

I would like to transform a 2d image into a 3d model. For example. i would like to place a sports team logo line drawing into sketchup, and then use the push/pull tool to pull up areas of the logo to make it into a 3d model.

I do not know how to even get a 2d image into sketchup so i’ll need quite basic help.

3 Likes

I assume you have a raster image of the logo. You can import that into SketchUp using File>Import and then trace it with the various drawing tools as needed to create the faces for Push/Pull.

Select Use as image in the Import window, select the file and import it.

ok, so its just a case of basically redrawing the image right?

Yes. Basically. The Raster image by itself is not geometry that SketchUp can recognize.

Ok thanks. Is there any tools that i could download that would make/help sketchup identify shapes in images?

I’m very much a beginner when it comes to the drawing tools.

No. You might find a raster to vector converter that you could use to create a vector file and then import the DXF/DWG file into SketchUp but they often create jagged edges due to the pixels in the original image. You might be able to smooth the edges depending on the converter. If the image is a PNG with transparent pixels, TIG’s Image Trimmer could at least create the outline between transparent and opaque pixels but it wouldn’t be able to create edges between colored regions.

If you can create a high-quality color BMP image, there is a plugin which will import it for you. For example, here’s the letter “B” imported from a 893 x 943 image (the higher the resolution, the better the result):

You can download the plugin from here:

https://sites.google.com/site/spirixcode/code/spirix_bmp_tracer.rbz

Once installed, it should show up on the Extensions menu as “BMP Tracer”.

14 Likes

Jim, that’s cool. Does it create edges between various colors, too?

1 Like

In the example above, I used black pixels (i.e. RGB = 000000) to indicate the geometry I wanted to import. You can have many colors and it will ignore anything but the ones with the values specified. Multiple imports require a different set of RGB values each time from the same image.

[added] Here’s some info from the Ruby console about the example above:

Reading b.bmp (2016-07-04 09:11:05 -0700)
FO: 54
Width:893 Height:943
Closing b.bmp (2016-07-04 09:11:06 -0700)
Original: 5032 (2016-07-04 09:11:06 -0700)
Smoothed: 149 (2016-07-04 09:11:06 -0700)
Loop 1 Done (2016-07-04 09:11:06 -0700)
Original: 966 (2016-07-04 09:11:06 -0700)
Smoothed: 32 (2016-07-04 09:11:06 -0700)
Loop 2 Done (2016-07-04 09:11:06 -0700)
2 Loops Completed (2016-07-04 09:11:07 -0700)

Well, isn’t that cool! Thanks Jim.

5 Likes

Edit: Ok, i installed that extension, When importing my BMP image it doesn’t load in the model area.

Download the RBZ file and then, in SketchUp, under Window, find Preferences>Extensions. Click on Install Extension…, navigate to the file, select it and choose Open and click the affirmative responses after that. It will install and be loaded and appear in the Extensions menu.

Yes i just found that moments before you had posted, and i edited my previous post too.

Try zooming back. When I made the Superman logo, I initially though the same thing. Then I hit Zoom Extents and there it was.

I also got this out of his tool!
very nice Jim.

Hello, is it also possible on a QR-code?
The Tracer gives not a nice result.

I’d imagine that a QR code needs to be pretty accurate. As they all appear to be a standard grid of 21 squares x 21 squares, the easiest way I can think of would be to simply draw a 21x21 grid using the Sandbox’s From Scratch tool. Simply paint each square either white of black then hide all the lines.

Here’s an example next to a QR jpg I pulled off the Net. I haven’t hidden the lines yet…obviously.

QR.skp (189.9 KB)

Thank you Alan,
I only can’t push/pull the black parts.
Its for 3D printing the QR-code.

You need to use a high resolution image to get a good scan … for basic squares and rectangles like you find in a QR code, you should set the tolerance to something less than 0.5. Using this 24-bit color BMP file (zipped for upload):

qr.zip (53.0 KB)

You get this as a result: qr1.skp (90.2 KB)

You will still need to extrude each face with the Push/Pull tool for 3D printing.

1 Like

The terrain mesh for the QR pattern is a Smooved surface (it has invisible diagonals in each square)
You’ll need to select it all and Soften/Smoothe it to UNsoften the edges. Then (if you have it) you can run ThomThom’s Cleanup script to merge coplanar faces and remove stray line…otherwise you’ll have to delete them manually. After that, you can Push-Pull entire blocks of black squares.

Edit: I didn’t realise you needed to extrude the pattern to 3D. In which case…rather than using the terrain tool, it might be easier to simply draw a square, then copy/array it 20 times laterally, then the entire line 20 times vertically. That way you’ll avoid all the diagonals.

3 Likes