i am dealing with a brep in rhinocommon (C#) that looks just like an orthogonal extrusion of a rectangle: four rectangular surfaces that are connected to some kind of ring. i get that ring by adding four rectangular nurbs surfaces to a new brep (mybrep). note that orientations of these nurbs surfaces will vary.
i now want to get a solid by:
mybrep.JoinNakedEdges()
mybrep.CapPlanerHoles()
since the four ring faces are not equally oriented ‘outward’, capping won’t work. in fact, it produces a lot of duplicate surfaces instead of capping my ring.
is there a way to automatically re-orient all surfaces as it happens in rhino when joining? when i explode and re-join my ring in rhino, all inward faces will be flipped.
alternatively - how can i sort out inward-oriented faces of my brep and flip them?
The orientation of a BrepFace can be changed by toggling BrepFace.OrientationIsReversed. This will leave the underlying surface the same, but set a flag that the face normal is flipped. This can be seen using the Dir command - look for a small purple line opposite of the direction arrow. If the purple line is present, the OrientationIsReversed is true; if it is absent the face orientation follows the underlying surface orientation.