Hello,
I have encountered a problem, and I hope someone can provide guidance. I need to extract segments of a gable roof. I have attached a picture that illustrates my input data, which consists of polygons indicating the gable roof among other roofs in a digital orthophoto.

I have utilized the CenterLineReplacer tool, which yielded satisfactory outcomes in most cases. However, I am experiencing difficulties in situations depicted in the image below (the line should be in a different direction):

Does anyone have any ideas on how to solve this?
Thank you in advance for your assistance.