Wrong floor and ceiling vectors after intersecting masses

Hi there!
I have a problem with my stair-like geometry. I am taking a simplified geometry, dividing it into 15 floors and making sure there are no non-convex surfaces in the corners by division and then extruding it upwards to create the “stairs”.
What actually is the problem here is when I use intersect masses, the horizontal surfaces face the wrong way - ceiling upwards and floor downwards. Even though, my base surfaces face upward before creating closed breps out of them.

I attach a onedrive link as I can’t upload scripts.

hi @kuba4210

I don’t think there is anything wrong with the direction.
The problem was that you have to flatten the breps before letting them pass through the intersect mass component.

geometry test.gh (559.4 KB)