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: 

API Example: wrap a sketch around an object (true wrap, not just projection :)

6 REPLIES 6
Reply
Message 1 of 7
JesusFreke
458 Views, 6 Replies

API Example: wrap a sketch around an object (true wrap, not just projection :)

A few days ago I was trying to figure out a way to wrap a sketch onto a cylinder via the API, and decided that there wasn't a good way to do it. But a little bit later I was browsing around in the API looking for something else, and I stumbled across SurfaceEvaluator.getModelCurveFromParametricCurve, and the lightbulb came on.

 

It turned out to be rather nontrivial to actually accomplish, but I finally got it working.

 

wrap_example.jpg

 

The benefit of this approach is that it can be used with non-developable surfaces like a sphere, or likely other arbitrary surfaces.

 

You can see the code at https://gist.github.com/JesusFreke/f619dd8599b7982ec85db73dfb0b7200

6 REPLIES 6
Message 2 of 7
JennayOakHill
in reply to: JesusFreke

I'm currently beating my head on this, any chance you can dumb it down for me? Did you write a script to exclusively do this?

 

Message 3 of 7
JesusFreke
in reply to: JennayOakHill

I provided a script at the end of my post..

Message 4 of 7
JennayOakHill
in reply to: JesusFreke

Aye, I've been staring at it trying to make heads and tails of it and come to the conclusion that the 5oz of programming I did way back when aren't helping me puzzle it out.

I'm not going to ask you to spoon it to me, I'm off to try and learn enough python to soldier through it.
I know it's possible at least, I just need to figure it out.

Message 5 of 7
BrianEkins
in reply to: JennayOakHill

Just to set your expectations, one other limitation of this approach is that the text needs to be contained within a single face.  It can't wrap across the seam of two faces.  It wouldn't be an easy thing to do.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 6 of 7
JennayOakHill
in reply to: BrianEkins

I'm not aiming at text, I'm wanting to wrap the attached .dxf around a 60 inch sphere.

 

If I'm barking up the wrong tree or you know of a better way, speak up. Otherwise I'll be reading up on python and trying to make it work.

Message 7 of 7
BrianEkins
in reply to: JennayOakHill

My comment wasn't limited to text, but any geometry.  But a sphere should work because it's a single face.  An example of what wouldn't work is a case where you have a box and then fillet four of the edges so it's rounded going around the box. Now you want to wrap some geometry so it starts on one of the flat faces, wraps around the fillet, and continues onto the adjacent flat face. That won't work.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com

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