I am working on a way to validate assembly STEP exports by automatically reimporting them into NX, overlaying the imported assembly with the original, and making sure every sheet/solid body has a matching twin.
I am currently using a method to identify bodies using two parameters, their number of faces and ufSession.Modl.AskBoundingBox() for the loose bounding box. I then calculate the center of the bounding box for the approximate position of the body.
However, I noticed that STEP imports (without simplify/optimize geometry enabled) deviate from their origin by +/- 0.1mm and by +/- 5 faces, depending on geometry. So I have a 2.5% tolerance for matching two bodies.
One stubborn body went from 480 to 590 faces upon re-importing it into NX, forcing me to abandon face count as a identifying feature. My next attempt will substitute the volume of the bounding box, using its overall length, width, and height.
Is there another parameter I could use? Body volume will not work since we have sheet bodies, and I don't know how performance intensive calculating total surface area of the body would be.