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

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

JesusFreke
Advocate Advocate
1,146 Views
6 Replies
Message 1 of 7

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

JesusFreke
Advocate
Advocate

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

1,147 Views
6 Replies
Replies (6)
Message 2 of 7

OakHillProdDev
Enthusiast
Enthusiast

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?

 

0 Likes
Message 3 of 7

JesusFreke
Advocate
Advocate

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

0 Likes
Message 4 of 7

OakHillProdDev
Enthusiast
Enthusiast

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.

0 Likes
Message 5 of 7

BrianEkins
Mentor
Mentor

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
0 Likes
Message 6 of 7

OakHillProdDev
Enthusiast
Enthusiast

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.

0 Likes
Message 7 of 7

BrianEkins
Mentor
Mentor

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