Generating a plane with convex holes (at runtime via code)
I need to generate a plane mesh with an arbitrary hole cut in it. Simple shapes are easy, but complex shapes become much more difficult. Doing this at runtime, C#
Pics and captions below. Imgur album link in case those get removed: https://imgur.com/a/nmZLzE2
I have a list of edges that make up their hole, and their normals. I also have the size of the hole overall, plus a border size.
Generating a plane is easy. I'm struggling with generating the plane around a shape.
A simple shape is relatively easy.
I can get the nearest point on the outer edge from each of the shape's vertices. I can use those points, and neighbouring nearest-point-on-the-outer-edge points, to generate triangles.
But complex shapes are a bit harder.
It's still just made up of edges and normals. But what do I do about convex shapes that don't have an unobstructed line to the outermost edge?
I want this to work with any shape, so long as it isn't self-intersecting (and even then it SHOULD still work, possibly by discarding the intersecting triangles).
I can't detect the nearest point on the outermost plane edge. And I can't detect intersections because there are other edges with opposing normals in the way.
Thank you!