Finding the perimieter of a cave

@Megalogue1 's suggestion may be the simplest.

Another option is to explore the new 2D Physics API in 2021.2 beta

There are some nifty methods for creating and combining shapes. This is a lower-level API so it’s not quite as friendly, but would give you custom control over your colliders.