Area of Region Surrounded by Arbitrary Curves

37 Views Asked by At

What I need to create is a general way of finding regions bounded by many intersecting curves and determining their area. Here are my steps thus far.

  1. I create a rectangular domain of some size.
  2. I place a given number of points within that region such that the two endpoints are on some edge and no other part of the curve exits the region.
  3. I use some interpolation (cubic spline for now) to create a curve from these points (hopefully this curve stays within the rectangular area other than its endpoints, though I am still working on that).

Drawing of Result

I need to make code that can identify all the regions made by the curves and determine their area. I was trying to use Green's theorem, but I'm not sure how well it would work since what I get from interpolation is discrete points, not a function. Mathematica has some nice region area functions, but the rest of the language is poorly set up for my problem. I am currently trying to code in Python.

I really appreciate any help or even just subjects to look into in solving this problem. Let me know if something I have written or anything else is unclear. Also, as this is my first time posting here, I would appreciate any tips on better outlining my problem, avoiding violating community guidelines, etc.

For those wondering, the final version of this code will optimize the spline control points to maximize the ability for these curves (which denote the path of some crease-detecting sensors) to localize a crease (which can be thought of as a straight line in the domain shown in red in the attached figure). I think the easiest way to do this is to minimize the area of the curves not activated by the crease (blue curves in the figure) that surrounds the crease. This area to minimize (shown in green in the figure) gives all possible locations the crease could be.

Final Problem Form