Surface orientation of Breps

Rhino 6, Windows10
Hello, I have a Brep which is sent to another Boolean Intersection operation. The Boolean operation is processed correctly.,
When I mirrored the Brep (I am using Python and Rhino.Geometry instead of native GH components), the boolean operation failed. The boolean intersection operation result indicates that the Brep has a wrong orientation.
So I tried several ways.

  1. connect the Brep to Deconstruct Brep component and Join Brep after that.
  2. call Brep.CreateSolid()
  3. call Brep.Flip()

All of these three worked. So, it seems like when I mirrored the Brep, it only flips the geometry but keeps the surface orientation as it is. (or maybe surface orientation is also flipped but it shouldn’t be flipped.)

But the problem is, I cannot find any documentation how face orientaions of Breps are managed. Is there a way to check if face orientations are setup correctly so that the Brep truly represents a solid geometry? Is there a way to get/set face orientations per faces? To build a solid Brep by my own, do I need to care about surface orientations ( I was just joining surfaces)? What’s the difference of Brep.Join and Brep.CreateSolid? The first one just join them while the second rebuild surface orientaions? Are surface orientations same as surface normals of each faces?

Please somebody shed a light.

Thanks.

Hi,

To shed some light, yet not answering all your questions:

If Brep.IsSolid you could check for Brep.SolidOrientation

import rhinoscriptsyntax as rs
import Rhino

brep_id = rs.SelectedObjects()[0]
brep = rs.coercebrep(brep_id)

print brep.SolidOrientation
xform = Rhino.Geometry.Transform.Mirror(rs.WorldXYPlane())
brep.Transform(xform)
print brep.SolidOrientation
brep.Flip()
print brep.SolidOrientation

readout:

Outward
Inward
Outward

-Willem

1 Like

Thanks Willem, I didn’t know SolidOrientation property. I had another simple example where boolean results of simple boxes are clearly wrong. Seems like even if IsSolid is true, SolidOrientation needs to be Outward if you want to get a correct Boolean result?