I have a polygon with an arbitrary shape ( assume that it is well-formed with no self intersection, no duplicated points etc), and I need to subdivide the polygon into sub-polygons like how one would define roof on top of a building. How can I do that in any GIS software, or through any open source libraries, or through any algorithm?
The reason why I'm asking this is because for my flat terrain ( with 2D shape unknown obviously), I have to manually enforce artificial gradients at appropriate places, so that the water can flow to the neighboring cells correctly when I am applying D8 implementation to calculate the flow accumulation. So the most intuitive places for sub-division would be the places where roof lines are taking along.
I would be interested to know is there any algorithm that one can use for this, and also is there any C++ open source libraries implementation for this ( I don't want to reinvent the wheel); is GDAL or CGAL or any geometrical algorithm already has this implementation?