How can I make center line for a curved I section (Brep)

Also attached one practical situation for one curved structural roof for extracting center lines(top face).Curved roof.3dm (13.1 MB)

@sajesh_pj

here is script for a center line and top center line of profile