I want to find floor length any shape

Does anyone have an idea to find floor any shape length ?
like image below

Thank you