Creating a B-spline surface is really slow

Creating a B-spline surface is really slow

codereclaimers
Enthusiast Enthusiast
847 Views
7 Replies
Message 1 of 8

Creating a B-spline surface is really slow

codereclaimers
Enthusiast
Enthusiast

Hi folks,

 

I have knots and control points for a B-spline surface, and I create a surface body from this data with a process like this:

 

1. Create a surface with app.TransientGeometry.CreateBSplineSurface

2. Create a surface body definition with app.TransientBRep.CreateSurfaceBodyDefinition

3. Add corners, edges and edge loops to the body definition, add the surface from 1 as a face definition

4. Call CreateTransientSurfaceBody on the body definition

5. Add the body produced in 4 to the part document's nonparametric base feature set.

 

The created surface is correct, but the CreateTransientSurfaceBody in step (4) is really slow, taking about 3 minutes to complete a surface with 200x200 controls. All the other steps take an insignificant amount of time.

 

Admittedly, that's a complicated surface, but creating a surface in SolidWorks from the same data takes a second or two on the same machine.  Is there something I can do to speed up this kind of operation, or am I just stuck waiting?

 

Thanks!

 

0 Likes
848 Views
7 Replies
Replies (7)
Message 2 of 8

codereclaimers
Enthusiast
Enthusiast

I should add, if needed I'd be glad to break this out as a standalone minimal example. I just wanted to see if there is something really basic that I was missing first.

0 Likes
Message 3 of 8

YuhanZhang
Autodesk
Autodesk

If you can provide your code to reproduce the performance issue that would help us to look into it.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 4 of 8

codereclaimers
Enthusiast
Enthusiast

Thanks--I'll get a minimal example put together and post it as soon as I can!

0 Likes
Message 5 of 8

codereclaimers
Enthusiast
Enthusiast

I've created a standalone C# addin that implements the same process I outlined in my original post. I tried this with a small range of square splines, and it appears the time complexity is somewhere in the neighborhood of O(n^6), where the splines have n-by-n controls.

 

The code is here: https://github.com/CodeReclaimers/inventor-code-samples/tree/master/bspline-surface

 

Thanks in advance to anybody that has time to investigate and see if I'm doing something incorrect with the API.  Once this is resolved I'll update the example code and leave it up in case others find it useful.

0 Likes
Message 6 of 8

codereclaimers
Enthusiast
Enthusiast
Bump...just wondering if anybody has had a chance to look at this and see if I'm doing something incorrectly. Thanks!
0 Likes
Message 7 of 8

wayne.brill
Collaborator
Collaborator

Hi,

 

I now have the example and am doing testing. I have sent an email about this privately. Will post back here when a solution is found.

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 8 of 8

codereclaimers
Enthusiast
Enthusiast

Hi Wayne, I just wanted to say thanks for getting this issue addressed, we noticed creating a B-spline surface is substantially faster in recent releases!

0 Likes