Exploded BREP face normal flipped when untrimmed

When I explode a BREP and untrim its faces, some of them get flipped.
This makes it impossible to get a reliable normal direction.

I had to untrim because when I probe the brep’s normal, I sometimes fall in interior trims, and this gives me the wrong normal.

Use flip surface (FLIP), and as guide surface (G) use the surface before untrim.

Hi Riccardo,

Thanks ! I just figured that out :slightly_smiling_face:
Yet, I wonder why Rhino plays tricks on us like that…

Exact same thing happens with the “Extend surface” command.

I think is something related to point order.
When you, for example, do the SwapUV on a surface, points order is not really changed … but a “flag” is set =true somewhere (i think).
So the flipping of a surface is on a flag somewhere, and the point order is always the same.

Maybe during the untrim command all the flags are lost.

Anyway, I could be totally wrong in this.

Hi Olivier,

What I assume causes this:
When joining multiple (trimmed)nurbs surfaces together to form a solid, it could be some of these surfaces are initially pointing inward and others outward.
To fix this there is a state for each brep face that can be switched to flip the natural orientation to align with the solid.
https://developer.rhino3d.com/api/RhinoCommon/html/P_Rhino_Geometry_BrepFace_OrientationIsReversed.htm

However if you explode and untrim, the natural orientation is back resulting in unexpected normals.

The way to fix this would be to call Standardize() on the brep, that will set the natural direction of the faces to align with the solid direction.
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Brep_Standardize.htm

I’m not familiar enough with GH to know if there already is a component to do this.
I made this GHpython block to do it:
standardize_brep.gh (4.3 KB)


It’s the red one, I unlinked my brep so it’s red now

HTH
-Willem

Hi Willem,

Thanks a lot for this explanation, and for the Python block.
I wonder in what fringe case someone would not want a Brep to be “standardized”…

1 Like