Trim brep with curve

Hi! I have a brep that represent a wall, and I need to split with the roofs so I have the walls until the top of the roof.

Flexibility component and split breps does not produce a reliable result. Does anyone have a solution for that?

split walls.gh (11.9 KB)

Your geometry is pretty far from the origin (5.7e6) units. Not sure what the limit is, but I know too far can result in tolerance issues.

split walls.gh (22.5 KB)

I got Split Brep to work by joining the roof surfaces into a single brep.