Consistent winding of BRep faces

With a closed ON_Brep composed of many ON_BrepFaces (without any holes), is there a consistent winding to the outer loops on each face?

That is, if I retrieve an outer loop from a face, can I rely on it being would counterclockwise when looking at the brep from the outside?

If not, how can I retrieve a consistent winding for the brep face loops?

Thank you,
Ed

Any Brep face has its trims oriented so that the active region is to the left. That is, outer loops are counter-clockwise, inner loops are clockwise - relative to the surface normal.

A face has a m_bRev flag that tells if the face’s orientation is reversed relative to the surface’s natural normal.

3D edges have a rev flag that tell if the edge curve is oriented in the opposite direction of the trim.

I believe if you call the member function on ON Brep or maybe ON_BrepLoop that gives you the 3d loop curve, it adjusts it so the orientation is consistent with the trims.

To get a consistent orientation for all outer loops of a closed Brep, you probably just have to reverse the directions of those from faces with m_bRev = true. Then they should all be counter-clockwise with respect to a vector pointing outward.