Automated mesh flipping operation

Hi,
I am looking for a robust way to automatically flip mesh surfaces. I’ve developed the following:

  1. Extract normal vectors of mesh faces;
  2. Deconstruct vectors;
  3. Get an average value of Z components;
  4. Check if the extracted value is greater than 0;
  5. Flip mesh if the average value is negative using Stream Gate component.
    automated mesh flipping - working concept.gh (14.4 KB)

    Are there any other quicker methods to get the same result? Maybe someone has a tiny script to achieve the same? I want to re-use a solution to automatically flip mesh patches along Y, and Z directions (based on my conditions).
    Thanks, Ilja

Blockquote