I have a solid Brep with surface normals pointing inwards, but it shows “Outward” when I print out its SolidOrientation property using RhinoCommon. Also, I tried using Brep.Flip(), which changed its solid orientation property to “Inward” but didn’t change the normal directions. Has anybody had this problem before?
Yes, I am aware that Brep.SolidOrientation returns an Enum.
Yes, I have been doing this without any problem until today. Please see the attached 3dm and gh files for the problematic Brep. I don’t know what is special about it that makes Brep.Flip() not working. Any insights would be very helpful. Thank you!
If I do this just in Rhino with the Flip command, the command won’t let me because “Cannot flip a closed solid”. This is most likely the same reason that brep.Flip() does not work, but you don’t get any feedback.
Select the BRep, then Explode SelLast Flip Join does flip the closed BRep. You should emulate this in code to achieve the same result I think.
What would be nice if void Brep.Flip() was actually bool brep.Flip(out error) giving you the same feedback on success of the flip operation and a reason why it did not work in the error variable.
Now I have many closed breps (all generated by extruding a curve profile and then cap planner holes) and a few of them have flipped normals. I wanted to use brep.SolidOrientation to check whether they are inside out, but it doesn’t give me the correct result for some breps. I wanted to know why this is happening and if this is a bug or not. Hi @dale, could you please provide any insights?
I extruded rectangles into square tubes and then capped the end holes. Yes, I do have the sample code in a .gh file. solid_orientation_bug.gh (22.7 KB)
When I bake the outputs, some breps are inside out like this: