Showing results for 
Search instead for 
Do you mean 
Reply

Speeding up the simple interference process programatically

Hello,

 

Currently in the program I am working on a requirement exists to be able to determine which bodies are intersecting with each other. This is the validation stage for the program. For this process a simpleInterference object is used. This method works great for validating whether or not two bodies are indeed interfering. However, this process is slow.

 

For example, I have one main body (very large and complicated) and about 100 other bodies (simple) that may or may not be interfering with this main body. On average this simple interference check takes about 3 seconds to run. 3s * 100 checks = 300 s = 5 minutes. This is just not quick enough. What can be done to decrease the amount of execution speed? The answer is to either decrease the amount of time per check, or to decrease the amounts of checks. 

 

I have attempted to decrease the amount of checks by first validating the bodies using bounding boxes. Each body has a bounding box drawn around it w.r.t. the absolute csys, then bodies bounding boxes are compared, if they intersect then the simple interference checker will be used to further validate. The time savings was not significant since most of the bodies intersected.

 

Additionally I have attempted to decrease the amount of simple interference checks by first using a minimum distance call. Only if the minimum distance was 0 would the body - body pair be checked using a simple interference. These minimum distance calls turned out to be nearly as slow as the simple interference checks and were ruled out.

 

Does anyone know of a way to either decrease the time the simple interference checks take? 

 

Thanks,

jgolen

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015
3 REPLIES

Re: Speeding up the simple interference process programatically

Have you tried creating an "intersect" feature (vs. unite or subtract).  See if any bodies result.

Probably enclose in an undo mark & undo after.

I *think* you can have one main body as the target, then select multiple tools?

 

Not sure if it can, or if it is faster, but it is something to try (try interactively first to see what happens)

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Speeding up the simple interference process programatically

Simply creating a subtraction with all the bodies will result in a sucessful subtraction (as long as one of the bodies intersects), however, from the subtraction builder, I was unable to programatically access the information as to which bodies did not subtract. So I could not distinguish between which bodies were intersecting or not intersecting.

 

I've tried using the getBodies and getEntities call, however, neither returned what I was looking for. The subtraction builder is called a BooleanFeature class in the VB.net reference API if anyone was wondering.

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015

Re: Speeding up the simple interference process programatically

Additionally I have tried using the subtract builder individually. For each body that I wanted to know if an intersection with the target body existed, I would add each to a subtraction builder and access the builder's validate call. This returned a boolean (always true) regardless if the two bodies did not intersect. I tried additionally calling the .commit function which would work successfully if they intersected, and would throw an exception if they did not, however, this turned out to be slower than the simple interference check. The subtracts combined with removing unwanted subtracts (since the subtract is just being used to see if the bodies intersect) resulted in a longer runtime.

 

Anyone have any ideas?

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015