On the Siemens PLM Community site, there is a discussion about converting STL files to solid.
https://community.plm.automation.siemens.com/t5/NX-Design-Discussion-For...
A user named Chigishev posted "Some time ago I build ugopen applicarapplication for convert stl-》solid body, non parametric."
Not being a programmer myself, I'm searching for a place to start with my own code. I have a couple people in the office with great programming experience but I help by pointing them in the right direction to get started. Recording a journal, finding something similar on the boards, etc.
I've written some attribute updater journals from what I've learned on this site and have deployed them site wide with great success.
I've searched through the NX Open programming guide but I'm not sure what I'm looking for, hence my question about getting started.
Thank you,
re: stl to solid
Most CAD files (NX part files, STEP files, IGES files, etc) store the mathematical definition of the model. The model is built from analytical objects such as planes, cylinders, spheres, b-surfaces, etc. An STL file is different. When you export your CAD model to STL format, every surface in the model is broken down into planar triangles. The underlying mathematical definition is lost. This is why you cannot measure a diameter on an imported STL file; there are no circles or cylinders to query.
Chigishev also posted to a similar thread on eng-tips:
http://www.eng-tips.com/viewthread.cfm?qid=389389
Based on the screenshot in that thread, I'd guess he's recreating the facet information as triangular sheet bodies then sewing them all together into a "solid".
I believe that the STL file format is published. As such, you could write code to parse the STL file, create triangular sheet bodies in NX, and sew them all together to get a "solid" body. Such a solid body might be only marginally more useful than the STL facet body itself (you could assign a material then measure a weight and COG); but in other ways it may also be less useful than the facet body (commands expecting a facet body would not work on it, and synchronous commands would be of little or no use). Recreating the analytical features that make up the model from the facet body is possible, to an extent; but it is a difficult problem. NX is starting to offer more tools to work with and analyze facet bodies. NX 10 has a "detect primitive" command that tries to fit primitive features to various parts of the facet body.
I looked at eng-tips but
I looked at eng-tips but missed this one. I've seen similar threads discussing the same or similar where each triangular facet is converted to a bounded plane and sewn together. What I have found out so far is that there is an upper limit to the ability to run this as a journal file and get good results.
I'm digging into NX10 and the new Reverse Engineering tab. Nice collection of tools for just this type of work.
Thank you!
Matt
STL to Solid
I have written code that converts an NX facetted body into a "regular" solid body. It's not very difficult. You just cycle through the facets, and, for each one, you create a three-sided bounded plane object. Then (optionally) sew these bounded planes together. All the tools you need are available in NX/Open and/or SNAP. It's a couple of hundred lines of code, at the most, as I recall.
The resulting objects are not all that useful in NX, in my experience. So, before you write the code, think for a while about what you want to do with these objects.
The added wrinkle in your idea is to start with an STL file, rather than an NX facetted body, and go STL-->solid in one step. This means you have to figure out how to read an STL file. This is not too difficult, because the STL file format is very simple. It's basically just a list of triangles. STL files can be either text or binary. The text form is very easy; the binary form requires a bit more programming skill.
Hi,
Hi,
If i got you right function where you go though the each facet and convert it to sheet surface? Could you share this function?
Thanks
E
thanks
E