I am wondering if OpenGL can be used to handle NX models. I was considering designing a plugin for NX. I am only considering OpenGL as an option if it can be used. I am not sure if the NXOpen API offers the functionality I am looking for for this specific purpose. If OpenGL will not work, what else would be compatible?
I am hoping to design a plugin that could use NX models and compute whether or not a ship is ballasted properly by using existing mass properties data. There is third party software that can achieve this, but why pay for more software when you alread have such a robust platform to work with?
Any ideas on how this can be approached?
No, OpenGL won't help you. OpenGL is just a graphics API. You can use it to draw things, but NX will have no knowledge of these things.
Ship ballast/stability calculations are generally fairly simple, and I would expect all the tings you need are available in NX/Open.
If NX/Open doesn't have the functions you need, one other option is Parasolid.
Or, you can export your model to some simple neutral format (like STL, for example) and do the desired computations on the exported data using your own code. The STL data will only be a crude approximation of the original NX model, of course, but it's probably good enough for ship calculations.
Okay, thanks. Parasolid sounds interesting? Where can I read up on that? Also, how do you export an .stl model and exactly how different is it than the original?
Parasolid is a 3d (solid) modeling kernal. Not sure what else it supports (e.g. surfaces/curves)
File -> Export -> STL
Record a journal to get the code (or search the solutions database)
Production: NX10.0.3.5 MP5 + patch/TC11.2
Apparently I've turned into a gearhead
Parasolid is the geometry kernel used by NX, Solid Edge, SolidWorks, OnShape, and dozens of other CAx systems. A Google search will give you plenty of information about it. Howver, one thing you should realize from the outset is that it costs money.
An STL file is just a collection of triangles that approximate the original model. When you export STL data from NX, you can specify how accurate you want this approximation to be. If you ask for very high accuracy, you'll get a very large number of triangles, of course.
Before you start studying Parasolid or the STL format, I'd recommend that you just look at NX/Open and/or SNAP. In my experience with ship calculations (which is fairly limited) all you need to do is calculate volumes, weights, centroids, and so on, and you can do all of those things with NX/Open or SNAP.