Image 2 Surface Script for Fusion 360

hanskellner
Autodesk

Image 2 Surface Script for Fusion 360

hanskellner
Autodesk
Autodesk

I've created a script for Fusion 360 that can be used to import an image and convert it to a mesh, sketch points, or sketch lines.

 

The following heightmap image of a portion of the moon was used to generate the following mesh and then t-spline:

 

Moon.jpg => MoonMesh.png => MoonTSpline.png

 

The t-spline version is the most flexible for changes and it can also be used in the CAM environment for milling.

 

The code and information is posted on Github:

 

https://github.com/hanskellner/Fusion360Image2Surface 

 

Note, because of limitations in Fusion on the size of meshes, I highly recommend using only very small images. For example, the moon image above is only 50x50 pixels. If you have an image that's large then create a smaller version of it then import that.

 

Cheers,

 

Hans



Hans Kellner
Senior Manager, Principal Engineer
7 Likes
Reply
Accepted solutions (3)
25,188 Views
79 Replies
Replies (79)

daniel_lyall
Mentor
Mentor

a.png

 

 

every time I try to run your script I get this error


Win10 pro | 16 GB ram | 4 GB graphics Quadro K2200 | Intel(R) 8Xeon(R) CPU E5-1620 v3 @ 3.50GHz 3.50 GHz

Daniel Lyall
The Big Boss
Mach3 User
My Websight, Daniels Wheelchair Customisations.
Facebook | Twitter | LinkedIn

0 Likes

hanskellner
Autodesk
Autodesk

Hi Daniel -

 

That issue has been fixed.  It arose on Windows platforms. Please grab the latest version from Github.  Sorry for the trouble.

 

H



Hans Kellner
Senior Manager, Principal Engineer
0 Likes

daniel_lyall
Mentor
Mentor

no problem its working good now thank you what are you doing next


Win10 pro | 16 GB ram | 4 GB graphics Quadro K2200 | Intel(R) 8Xeon(R) CPU E5-1620 v3 @ 3.50GHz 3.50 GHz

Daniel Lyall
The Big Boss
Mach3 User
My Websight, Daniels Wheelchair Customisations.
Facebook | Twitter | LinkedIn

0 Likes

hanskellner
Autodesk
Autodesk

I've created a gallery project for a "penny" that created using the script:

 

https://fusion360.autodesk.com/projects/penny-image-2-surface

 

I'm happy with the final result and now confident that the workflow I was aiming for when i created the script can be accomplished.

 

Penny CNC Size - IMG_3813.jpg



Hans Kellner
Senior Manager, Principal Engineer
1 Like

daniel_lyall
Mentor
Mentor

I have been playing with for the last few hours it`s quite good for making textures 


Win10 pro | 16 GB ram | 4 GB graphics Quadro K2200 | Intel(R) 8Xeon(R) CPU E5-1620 v3 @ 3.50GHz 3.50 GHz

Daniel Lyall
The Big Boss
Mach3 User
My Websight, Daniels Wheelchair Customisations.
Facebook | Twitter | LinkedIn

1 Like

hanskellner
Autodesk
Autodesk

That's great to hear!

 

Feel free to post an image. Always nice to see what people are making.



Hans Kellner
Senior Manager, Principal Engineer
0 Likes

hanskellner
Autodesk
Autodesk

I've updated the code to support "Invert Image" so that darker colors are raised and lighter colors lowered.  Therefore, white will be the lowest and black the highest.

 

SettingsDialog.png

 

Cheers!

 



Hans Kellner
Senior Manager, Principal Engineer
0 Likes

RandyKopf
Collaborator
Collaborator

This is a pretty cool project!  Thanks you did a great job with this. Wish Autodesk would make hieghtfield a standard thing to support.2016-03-22_22-12-16.jpgBilly_Jack_Poster_from_Photo_vectorized.png

 

Randy Kopf 

http://desktopartisan.blogspot.com/


If my post is helpful, press the LIKE Button If it resolves your issue, press Accept as Solution! Have a great day!
1 Like

Anonymous
Not applicable

Hi,

I was really looking forward to being able to use this script, however, as of the most recent update, Autodesk has removed the option to insert a javascript. This means that the script can no longer be used in Fusion 360. I know it is a big ask, but would it be possible to have the code rewritten in either C++ or Phython.

Thanks

Ash

0 Likes

marshaltu
Autodesk
Autodesk

Hello,

 

I would like to clarify that existing Javascript script/addin can be still run and used in Fusion. We removed the functionality to add new script/addin and help documents. You can add existing scripts by "+" button besides "My Scripts" or "My Add-Ins". 

 

Screen Shot 2017-08-24 at 10.29.41 AM.png 

 

Thanks,

Marshal



Marshal Tu
Fusion Developer
>
2 Likes

Anonymous
Not applicable

Hi Marshal,

I understand that existing javascripts can still be run on Fusion 360. However, I did not download/run the script before the update. This means that I would have to insert a new script, which can not be done as it is in the javascript language.

Thanks

Ash

0 Likes

marshaltu
Autodesk
Autodesk

Hello,

 

I should explain more clearly about how to add/run Javascript in new Fusion version. Though it isn't officially recommended to do so. The best approach would be move to Python/C++ language as you said.

 

1. Download Javascript script which you want to use.

2. Launch Fusion and invoke "Scripts & Add-in Manager" dialog.

3. The script should not in the list. Add them by "+" button(please note you have to select the folder which the script is located at).

4. Run the script. Even you can still edit the script if you want to customize it. 

 

So it doesn't matter if you didn't download/run the script before. 

 

Thanks,

Marshal



Marshal Tu
Fusion Developer
>
1 Like

Anonymous
Not applicable

Hi Marshal,

I have downloaded the script and created a new script, selecting the folder the javascript is located in. I moved all of the files into the new folder, however, when I click run, it just comes up with "Hello Script".

Thanks,

Ash

0 Likes

marshaltu
Autodesk
Autodesk

Hello,

 

I record a video to demo how to load/run an existing Javascript script. Please take a look and let me know if you still have issue.

 

http://autode.sk/2vbGI3i

 

PS: the video is recorded in Mac. It should be similar in Windows platform.

 

Thanks,

Marshal



Marshal Tu
Fusion Developer
>
0 Likes

Anonymous
Not applicable
Hi Marshal,
Finally got it to work. Thanks for all your help.
Cheers
Ash
0 Likes

Anonymous
Not applicable

Hi Marshal

Finally got it to work! Thanks for all your help.

Ash

0 Likes

Anonymous
Not applicable

I just would like to have more tips about how to create an perfect image ready to run at your fantastic script. My company is specialized in 3D printing topography and then Image2Surface makes total sense to me.

 

Thanks a lot.

Marcelo

www.otto3d.com.br

0 Likes

hanskellner
Autodesk
Autodesk

Hi Marcelo -

 

Good idea.  Especially now that Fusion 360 has better support for meshes.

 

Also, I'm working a new version of the script and will also be posting some examples and hints.  When it's ready I'll post a notice in this thread as well as a new post in "API and Scripts".

 

Thanks,

 

Hans



Hans Kellner
Senior Manager, Principal Engineer
0 Likes

Anonymous
Not applicable

Hey Hans.

 

I followed the instructions to add a JavaScript script and this script doesn't work. The script shows up in the "My Scripts" list but when I run the script, nothing happens.  I get no output when I try and run in in "Debug" mode.

 

I'm on a Mac, High Sierra 10.13.2 (17C88) and latest version of Fusion360.

 

Cheers!

 

--Ed

0 Likes