Showing results for 
Search instead for 
Do you mean 
Reply

Extreme points/Convex Hull of a CAEFace

Hello.

With the help of this forum, I managed to obtain the list of nodes of the face of the FEM elements included in a CAEFace (see this post: https://community.plm.automation.siemens.com/t5/NX-Programming-Customization-Forum/NXOpen-Access-the... )

 

The next step is to draw a polygon on top of that face. I have the code working using UDOs to do this, but the call to UserDefinedObjectDisplayContext::drawPolygon(std::vector<NXOpen::NXPoint3d>) needs the points of the polygon to be ordered, so I get something very ugly because I can't control the order of the nodes obtained with the SmartSelectionManager.

 

Therefore, now I need the list of nodes of a CAEFace in an ordered manner.

Is there a way, in NXOpen, to:

  • obtain the extreme nodes included in the CAEFace? or
  • method to calculate the Convex Hull of a set of NXPoint3d? 

If not, I will need to write myself an algorithm to calculate the convex hull of the set of points. I came across an older post here, but it was suggested to use the convex hull algorithm included in scipy, but I work in C++, so I don't want to use Python.

 

Thank you!