This could be one way and check the linked topic to understand the trimmed surface subdivision problem.