cancel
Showing results for 
Search instead for 
Did you mean: 

Finding interior and outer faces

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

I have a following body. The red face is an interior face, because it is surrounded by some sort of walls. The green face is an outer face, because it is not surrounded. How to find (programmatically) faces which are interior like the red face?


Screen Shot 2016-06-23 at 1.05.53 PM.png

4 REPLIES

Re: Finding interior and outer faces

Phenom
Phenom

Below is a link to a somewhat related thread with code that you may find useful.

https://community.plm.automation.siemens.com/t5/NX-Programming-Customization/Collect-Associated-Face...

Re: Finding interior and outer faces

Siemens Phenom Siemens Phenom
Siemens Phenom

The key point is that the edges of the red face are concave, and the edges of the green face are convex (when viewed from outside the object). So, you need to cyle through the edges of the face, checking that all of its edges are concave. Like this:

 

bool inside = true;

foreach (NX.Edge edge in myFace.GetEdges)
{
   if (edge.Convexity(tol) != Snap.NX.EdgeConvexity.Concave) inside = false;
}

The code is in C#, and uses SNAP functions. I think you could do basically the same thing using NX/Open, but I can't find the function to get edge convexity, right now..

山田
yamada

Re: Finding interior and outer faces

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer
Thank you Yamada. But I cant find the same function in NXOpen Python API. I guess this function some sort of a function for facet body of face.

Re: Finding interior and outer faces

Siemens Phenom Siemens Phenom
Siemens Phenom

I looked again, and I couldn't find any relevant function in NX/Open, either.

 

There is a function for checking whether an edge between two facets is convex, but this won't help you, I don't think.

 

One idea is to write your own function. Construct a small disk-shaped solid normal to the edge, and intersect this with your base body. Looking at the volume of this intersection will tell you whether the edge is concave or convex. This algorithm isn't fool-proof, but it will work most of the time, I think.

 

Another option: get a SNAP license and then (if you insist on writing in Python), figure out how to call a .NET function from Python.

山田
yamada