How to add doors to NavMesh aka dynamic obstacle toggling

I have an entire terrain baked. I have walls and obviously the NavMesh is not baked under the walls. There is no NavMesh under the walls so the NavMesh agents do not go through walls

I want to add doors between the walls. So this means that if a door is closed, a NavMesh agent should not be able to pass through. If a door is open, a NavMesh agent should be able to pass through. Although I can’t think of any way to implement this

How do I do this?

Thank you

Try hanging a NavMeshObstacle component on the door, enable Carve, then bake surface. That seems to work in my case.