Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Image 2 Surface Script for Fusion 360

79 REPLIES 79
SOLVED
Reply
Message 1 of 80
hanskellner
20110 Views, 79 Replies

Image 2 Surface Script for Fusion 360

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
79 REPLIES 79
Message 2 of 80
daniel_lyall
in reply to: hanskellner

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

Message 3 of 80
hanskellner
in reply to: daniel_lyall

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
Message 4 of 80
daniel_lyall
in reply to: hanskellner

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

Message 5 of 80
hanskellner
in reply to: hanskellner

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
Message 6 of 80
daniel_lyall
in reply to: hanskellner

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

Message 7 of 80
hanskellner
in reply to: daniel_lyall

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
Message 8 of 80
hanskellner
in reply to: hanskellner

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
Message 9 of 80
RandyKopf
in reply to: hanskellner

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!
Message 10 of 80
Anonymous
in reply to: hanskellner

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

Message 11 of 80
marshaltu
in reply to: Anonymous

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 360 Developer
Autodesk, Inc.

Message 12 of 80
Anonymous
in reply to: marshaltu

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

Message 13 of 80
marshaltu
in reply to: Anonymous

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 360 Developer
Autodesk, Inc.

Message 14 of 80
Anonymous
in reply to: marshaltu

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

Message 15 of 80
marshaltu
in reply to: Anonymous

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 360 Developer
Autodesk, Inc.

Message 16 of 80
Anonymous
in reply to: hanskellner

Hi Marshal,
Finally got it to work. Thanks for all your help.
Cheers
Ash
Message 17 of 80
Anonymous
in reply to: marshaltu

Hi Marshal

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

Ash

Message 18 of 80
vendramini.br
in reply to: hanskellner

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

Message 19 of 80
hanskellner
in reply to: vendramini.br

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
Message 20 of 80
Anonymous
in reply to: hanskellner

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report