You can get the normals of a Surface or a BrepFace by using the NormalAt method. I have experimented with this a bit and found out that it is not consistent. I am hoping someone can chime in on this topic and explain what the purpose of the inconsistencies are. There must be more to it than I’m not seeing.
Whenever I used the Brep.Flip(), Face.Reverse(0, True), or Surface.Reverse(0, True) methods, I expected the same results. I assumed, maybe incorrectly, that whenever you flip or reverse a face or surface that it would do the same for the other type of object.
I have created a surface / brep face and duplicated it 3 times. On each object using python script, I display a point representing the direction of the normal retrieved from Surface.NormalAt() by a blue point and a point representing the direction of the normal retrieved from Face.NormalAt() by a red point. I used the dir command to show that the normals on all 4 objects are pointing to the left.
On the first (bottom) object I have done just that. Both points ended up left of the object. This was expected as the normals from the dir command point left as well. I also interrogate Face.OrientationIsReversed which is False. I do this just to inspect what’s going on as I apply different methods.
On the second object I use the Brep.Flip() method to flip the object and therefore I thought the surface and the face would be flipped. Turns out the surface remained the same which was not expected. It did not flip. Furthermore, the face flipped so the red point moved to the other side. This was expected. What was unexpected is that Face.OrientationIsReversed was set to True. I would have expected either the point would have moved to the other side OR Face.OrientationIsReversed be set to true but NOT BOTH.
With the third object I used Face.Reverse(0, True) to reverse the object. I expected the surface normal point to be on the right. I also expected either the face normal point to be on the right or Face.OrientationIsReversed to be set to True, but not both. This is exactly what happened. So the surface normal point ended up on the other side. The face normal point did not move yet Face.OrientationIsReversed was set to True as expected.
On the last object I used Surface.Reverse(0, True) to reverse the object. I expected the surface normal point to be on the right. I also expected either the face normal point to be on the right or Face.OrientationIsReversed to be set to True, but not both. The surface normal point moved to the other side as expected. The face normal point did not move and Face.OrientationIsReversed was still false which was not expected.
So what it appears is Face.Reverse(0, True) is the ONLY method that is consistent while Brep.Flip() and Surface.Reverse() are not consistent. Is this true? What am I missing? Is this an issue / bug?
Furthermore, if I use the Surface / Brep Face to trim another object by using rs.TrimBrep, the surface normal in this function is used, not the face normal. So one must be very careful as to how they flip / reverse their object if the outcome is to use the object as a trimming object so that the surface normal is altered properly.
Also when I used brep.Flip(), the normal did not flip. How do I flip the normal when using brep, face, and surface objects?
Brep Flip Reverse.3dm (171.0 KB)
Brep Flip Reverse.py (3.0 KB)