Turn a 2D Image Into a 3D Model

53,553

301

166

Posted

Introduction: Turn a 2D Image Into a 3D Model

Ever want to take a 2D image and turn it into a 3D model? This instructable will show you how with a free script and Fusion 360.

What You'll Need

Fusion 360 (Mac / Windows)

What You'll Do

  1. Download and install Fusion 360. Click here to sign up for free as a Hobbyist / Enthusiast / Startup or as a Student or Educator.
  2. Get a quick orientation of the user interface.
  3. Download and install a script that will let you turn a 2D image into a 3D surface.
  4. Use the script to create a 3D surface for CNC milling.

Step 1: Why Fusion 360?

Fusion 360 is pretty much all I use nowadays in terms of 3D software. FULL DISCLOSURE: Fusion 360 is an Autodesk product, and Instructables is an Autodesk company, so this might seem like a biased choice. That's not exactly the case, and here's why:

  1. It's easy to learn. The UI has been carefully designed from the ground up to be clean, minimal, and simple. You can go from zero knowledge about 3D modeling to making simple objects in an afternoon.
  2. It's powerful. Once you get through the basics, there's really no limit to the complexity of the things you can design with it. It's easy to create simple models with it, but there's nothing holding you back from modeling a fully articulated gas engine if you want to.
  3. It's cross-platform. It's available on Mac and PC, and it's proven to be very stable on both platforms in my experience.
  4. It's great for CNC. Fusion has a super sophisticated CAM environment that lets you create all kinds of tool paths, which we'll get into later. It's really awesome to have the CAD and CAM together in the same program, because when you change your model, the tool paths update automatically.
  5. It's free. If you make less than $100K per year using it, you just renew with a startup license every year and keep using it free of charge.
  6. It's not a web app. Though all your files are backed up on the cloud and rendering is taken care of there, you don't have to rely on a high-speed internet connection to use the program.

I've been 3D modeling for over 13 years, and I can tell you honestly that this program is perfect for the kind of work I do: furniture, toys, machines, household products, etc. It makes digital fabrication a breeze, especially laser cutting.

There are a number of other programs out there that could be used to produce the same results, and if you're comfortable with something else (especially if you've already paid for it), there's no reason why you shouldn't stick with it. But if you haven't spent any money or invested time in another program, believe me when I say you won't be sorry you went with Fusion 360.

Step 2: Get Fusion for Free

If you haven't already, go to the Tools and Materials lesson in the CNC Class and follow the instructions there to download and install Fusion for free as a hobbyist / student / educator.

Step 3: The Fusion Interface

Fusion 360 has a great Youtube channel with lots of helpful videos. If you're the type of person who likes to learn software by going through every function it can perform, this channel is a good place to start. The overview here should get you pretty well oriented to the interface and give you an idea of how the program works.

But before we dive into a full-fledged 3D model, I'll quickly run through the interface.

PRO TIP: Use a 3-button mouse! It's so much easier than using a trackpad.

  1. Application bar: Access the Data Panel, file operations, save, undo and redo.
  2. Profile and help: In Profile, you can control your profile and account settings, or use the help menu to continue your learning or get help in troubleshooting.
  3. Toolbar: Use the Toolbar to select the workspace you want to work in, and the tool you want to use in the workspace selected.
  4. ViewCube: Use the ViewCube to orbit your design or view the design from standard view positions.
  5. Browser: The browser lists objects in your design. Use the browser to make changes to objects and control visibility of objects.
  6. Canvas and marking menu: Left click to select objects in the canvas (the space where you make your models). Right-click to access the marking menu. The marking menu contains frequently used commands in the wheel and all commands in the overflow menu.
  7. Timeline: The timeline lists operations performed on your design. Right-click operations in the timeline to make changes. Drag operations to change the order they are calculated.
  8. Navigation bar and display settings: The navigation bar contains commands used to zoom, pan, and orbit your design. The display settings control the appearance of the interface and how designs are displayed in canvas.

Step 4: Canvas Navigation

There are three ways to manipulate the view of your design:

  • Navigation Bar
  • ViewCube
  • Wheel button on a mouse

Navigation Bar

The navigation bar is positioned at the bottom of the canvas. It provides access to navigation commands. The menus on the right end control Display Settings and Layout Grid options.

To start a navigation command, click a button on the navigation bar.

Navigation Commands

  • Orbit: A set of commands that rotate the current view.
  • Look At: Views faces of a model from a selected plane.
  • Pan: Moves the view parallel to the screen.
  • Zoom: Increases or decreases the magnification of the current view.
  • Fit: Positions the entire model on the screen.

Display Settings

Set of commands that enables you to specify desired visual style, visibility of objects, or camera settings, for example.

Grid and Snaps

Commands that allow you to specify increments, grid settings, and show / hide the layout grid.

Viewports

Viewports are windows that display your design. You can show up to four viewports in the canvas at once. Displaying multiple viewports allows you to work in one view and see the changes from other camera positions.

ViewCube

Use the ViewCube to rotate the camera. Drag the ViewCube to perform a free orbit. Click faces and corners of the cube to access standard orthographic and isometric views.

Mouse: Use mouse shortcuts to zoom in/out, pan the view and orbit the view.

  • Scroll middle mouse button to zoom in or zoom out.
  • Click and hold the middle mouse button to pan the view.
  • Shift Key + middle mouse button to orbit the view.

Trackpad: If you have a Mac with a touchpad or an Apple Magic Mouse, you can use multi-touch gestures to navigate the view.

Step 5: Image-2-Surface Script

"Script" is shorthand for a bit of code that you can plug into the program to give it a new tool that wasn't included by the software developer. There are dozens of scripts that allow you to do some pretty awesome things.

To translate a 2D bitmap image to a 3D surface for CNC milling, we're going to use the Image-2-Surface (updated 03 / 2018) script written by Hans Kellner.

The script is very simple. All it does is translate the value (level of lightness or darkness) of a bitmap image to the height of a point on a mesh surface. The white parts of an image will be the highest points, and the black parts will be the lowest points. This script will work with any photo, but I find it's best to use grayscale images because it's easier to predict what it will look like in 3D.

INSTALL THE SCRIPT

First, download the Zip file attached belo and unzip it in a location of your choice. I would advise keeping it some place other than the Downloads folder, or any other folder that is regularly cleaned out.

To load the script in Fusion, follow these steps:

  1. Start Fusion 360 and then select the ADD-INS > Scripts and Add-Ins... menu item.
  2. The Scripts and Add-Ins dialog will appear and display the My Scripts and Sample Scripts folders.
  3. Select one of the My Scripts folders, then click on the + icon near the top of the dialog.
  4. Locate the Image2Surface.js file in the folder you copied, select it, and click Open. The script should now be installed and ready to be run.

Scripts and Add-Ins Menu

Step 6: Use the Image 2 Surface Script

RUN THE SCRIPT

After opening Fusion, I save the untitled file with a new name.

With my file saved, and the Workspace set to MODEL, I go to ADD-INS > Scripts and Add-Ins... I select Image2Surface from the list and click Run.

If

Santa Cruz Canyons File: 288 X 288 PX

SETTINGS

When you've selected your image, click OK and you'll get the Image2Surface script dialog. Here's a breakdown of the settings and what they mean. There's a lot of technical jargon that we won't get into here, but I find that a good place to start learning about this kind of thing is to just play around with the settings and see what happens. The settings shown in the screenshot below seem to yield the best results.

You may want to invert your image depending on what it is. When your settings are dialed in, click OK, and the script will make the surface. IMPORTANT: Export format must be set to OBJ in order for the surface to be usable for CNC work later.

Mesh created by the Image-2-Surface script by Hans Kellner

TROUBLESHOOTING

Is Fusion freezing or crashing when you try to run the script? Chances are, your image is too large. Keep it under 300 X 300 pixels and it shouldn't be a problem. The smaller the image, the faster the processing.

NON-WORKING SCRIPT

If the script isn't behaving as described even though you followed the instructions, I would suggest looking at this thread on the Autodesk Knowledge Base: https://knowledge.autodesk.com/support/fusion-360...

Usually when a script isn't working, it's because it wasn't installed properly.

Step 7: Convert Surface to T-Spline Geometry

The surface the script creates is a Polygon Mesh surface. This type of surface is made up of facets with edges and points. If you zoom in, you'll see that there are no curved surfaces.

This type of geometry can't be used to make g-code toolpaths, so we'll need to convert it to T-Spline geometry. A t-spline is a type of NURBS geometry that works with control points that affect a flexible surface.

You're going to need a T-Spline geometry to create your CNC tool path, so click the CREATE > Create Form tool from the menu. This tool takes you into the SCULPT workspace.

Next, click UTILITES > Convert and select Mesh Body in the Selection Filter. Now click the mesh surface that the script created and click OK. Now it's time to be patient and let the program do its work converting the surface to a T-Spline body- it might take a couple of minutes.

Click FINISH FORM and Fusion will go back to the MODEL workspace.

PLACE THE SURFACE WITHIN A BLOCK

In order to better visualize what you're going to cut out on the CNC, it's a good idea to create a solid form. First, select the surface in the Bodies folder in the BROWSER on the left-hand side of the screen. Then Right-Click anywhere on the screen and select Move from the menu.

Looking at the surface from the side, rotate it 90º so that the top of the surface is facing up.

The size of the surface is based completely on the original bitmap image, so now you'll need to scale it to fit the actual size of the piece you want to cut out. To do this, make sure the body is selected in the BROWSER and go to MODIFY > Scale in the menu. Click Point and select the model origin.

NOTE: You may need to turn on Origin in the browser in order to see it.

Looking at the surface from the Top view, change the Scale Factor so that the surface fits within the size of the piece you want to cut out. I'm going to use a 3" X 3" piece of wood, so I'm looking for a scale factor that will give me a SURFACE that's just slightly BIGGER than 3" X 3". I can see how big it is on the layout grid.

Now that the surface is in place, create a box to represent the material to be cut out. I'm using a 3" X 3" X .76" square, so I go to CREATE > Box and click the model origin as my starting point. The box command asks for a width, a depth, and a height, which you can enter by typing a number and pressing Tab.

I can see that the surface to be cut is actually taller than the material to be cut, so not I need to scale the surface down in the Y dimension. I use the Scale tool again, and change Scale Type to Non Uniform. This option will let you scale in any dimension independently. For Y Distance, Choose a number that gives you some breathing room for the surface to fit within the block.

To move the surface closer to the top of the block, Right - Click > Move the surface up in the Y direction so that it's just below the top of the block.

CREATE A SOLID SURFACE

With both the block and the surface in place, go to MODIFY > Replace Face. Like every other tool in Fusion, it tells you what it needs to work. First, select the Source Face, which in this case is the top surface of the block. Then, click Select under Target Faces and select the surface you just converted from the original mesh. Click Okay, then turn off the original body in the BROWSER and you'll see the finished surface that you'll be making on the CNC.

SHOW US WHAT YOU GOT

If you gave it a try, please post your results here!

82 People Made This Project!

Recommendations

  • Science of Cooking

    Science of Cooking
  • Pocket-Sized Contest

    Pocket-Sized Contest
  • Microcontroller Contest

    Microcontroller Contest
user

We have a be nice policy.
Please be positive and constructive.

Tips

6 Questions

0

I have been trying to install the image2 surface script but it shows "A single script or add-in cannot be identified in the selected folder.Please organize your programs so each script or add-in is in its own folder". Can you help me to figure out this??

Screenshot (76).png

Your tutorial is the best I have ever seen and i am going to try it out today with regards to creating a dental schematic illustration.

My question is however,

HOw do i animate this within Autodesk or by any means possible after saving the file? I don’t want to print it rather save it to add to a hitfilm express film or animate it.

It is a great challenge to me but all i need is an inward flowing of particles and within the cell, i want it to have that breakdown effect. To imply the particles are breaking down.

If i confused the question just the part on basically animating this 3D is a great point to start with.

Please please help me

For what you're trying to do, Fusion 360 is definitely the wrong tool. This is something you could do in Maya, 3D Max, Blender, or a number of other programs intended for motion graphics and animation.

With many of those programs, you can do 2D - 3D translation as a tool within the program or with a plug-in. I haven't used Maya in almost 10 years now, so I'm the wrong guy to ask!

I have to do a school project which requires a 3d model of an island i have attached the topographical map below

help would be awesome :)

screenshot-www.topomap.co.nz-2018.02.05-12-17-00.png

This particular image wouldn't give you the desired result because the script assigns height based on brightness. The darkest part of this picture is the text, so that will translate to a deep pit, and the lightest pixels are the cloudy parts in the water, so that will be the highest point.

What you really need is what's called a height map that's less than 300PX X 300PX. Here's a link to some examples: http://casual-effects.com/g3d/G3D10/build/data/heightfield/

australia-2048.jpg

i guess it would definitely work

I have to script installed, but how do you get your image into Fusion. I uploaded it to the data panel on the side, however I can not drag it onto the grid.

This is all done through the script, the Data Panel shouldn't even come into play. Did you follow the instructions?

hello i cant install the script because is not visible on computer help^^

8 Comments

First off, thank you so much for this amazing break down!

Secondly, does Fusion 360 work well with high detail pictures? I desire to make a silver charm for my wife. The picture I plan on using contains a lot of background detail (in addition to the two f us being in the photo) that I want to capture. I have used Blender, Inkscape, and Gimp to try and perfect my project, but to no avail. Thanks!

OK, I am stuck on installing the script. I get a message that "a single script cannot be identified in the selected folder. Please organize your programs so each script is in its own folder." I am sure the issue is the utils.js file which is in the same folder, what should I do with it?

To answer my own question, I moved utils.js to my desktop, registered the script as per the instructable, and then moved utils.js back into the folder. I am sure that is not how it is supposed to happen, but it seems to work fine.

Thanks for sharing your solution. Scripts act weird sometimes. When in doubt, delete and replace...

I have tried this method of download and delete about 5-6 times moved the utils and the other javascript files around nothing is happening. closed f360 opened praying and still get the same error he has. any help is appreciated

Hi could someone help me out. I have followed this step by step and yet seem to get a box saying 'hello script' and nothing else happens. If anyone could help that would be appreciated

So you are saying that the box created must be smaller than the contoured object AND the contoured object is then scaled to fit the smaller box?

Basically the box keeps the same width and depth and whatever the shape of the surface is that cuts through it gets stamped onto the top face of the box. The surface doesn't scale, the overhanging edges just get cut off.