Hello!
I am looking for a way how to export triangulated model geometry.
I do not need any object model. I just want to obtain the current triangulation in terms of list of vertices and faces. How can I get a list of vertices and faces?
I'm using NX9 and VS 2012 C# or VB.
In other words, I would like to have the following geometry for the simple box (values obtained from my plugin for Inventor):
Vertices={
0 0.0154793810844421, -0.0254450464248657;
0 0.0154793810844421, 0.0257058310508728;
0.01 0.0154793810844421, 0.0257058310508728;
0.01 0.0154793810844421, -0.0254450464248657;
0 -0.0168205547332764, -0.0254450464248657;
0 0.0154793810844421, -0.0254450464248657;
0.01 0.0154793810844421, -0.0254450464248657;
0.01 -0.0168205547332764, -0.0254450464248657;
0 -0.0168205547332764, 0.0257058310508728;
0 -0.0168205547332764, -0.0254450464248657;
0.01 -0.0168205547332764, -0.0254450464248657;
0.01 -0.0168205547332764, 0.0257058310508728;
0 0.0154793810844421, 0.0257058310508728;
0 -0.0168205547332764, 0.0257058310508728;
0.01 -0.0168205547332764, 0.0257058310508728;
0.01 0.0154793810844421, 0.0257058310508728;
0.01 0.0154793810844421, 0.0257058310508728;
0.01 -0.0168205547332764, 0.0257058310508728;
0.01 -0.0168205547332764, -0.0254450464248657;
0.01 0.0154793810844421, -0.0254450464248657;
0 -0.0168205547332764, 0.0257058310508728;
0 0.0154793810844421, 0.0257058310508728;
0 0.0154793810844421, -0.0254450464248657;
0 -0.0168205547332764, -0.0254450464248657;
};
Faces={
1,2,4;
4,2,3;
5,6,8;
8,6,7;
9,10,12;
12,10,11;
13,14,16;
16,14,15;
18,19,17;
17,19,20;
22,23,21;
21,23,24;
};
Now I can get cooredinates of vertices (UFFacet.AskVerticesOfFacet or FacetedEdge.GetVertices). For the simple cube I got 24 vertices. However, I cannot understand how to get faces. In other words, I cannot get the order how vertices form every face. Could you please give me a hint how to get faces for the example.
-
This should be achieved using File - Export - STL
You may edit the format of the resulting .TXT-file to fit your needs.
/UdoMM