The current Polygon2D.from_shape_with_holes method is really inefficient when it comes to shapes with lots of holes or shapes with very detailed holes like this one:
I remember thinking that it seemed like a waste that I re-compute the distance from every hole point to every boundary point each time I merge in a new hole. In theory, I could just compute those hole-boundary distances once and then find "the path of least resistance" through those values.
I have a feeling that just performing the vertex distance calculations once for the shape and not every time we merge a new hole will solve this scaling problem and get cases like the one uploaded here to run in a tiny fraction of the time. I imagine this would not take me much more than a day but I'll probably need another day after this to test it well and make sure it's working as designed.
The current Polygon2D.from_shape_with_holes method is really inefficient when it comes to shapes with lots of holes or shapes with very detailed holes like this one:
https://discourse.ladybug.tools/t/how-to-set-and-visualize-a-lot-of-surfaces-as-windows/20318
I remember thinking that it seemed like a waste that I re-compute the distance from every hole point to every boundary point each time I merge in a new hole. In theory, I could just compute those hole-boundary distances once and then find "the path of least resistance" through those values.
I have a feeling that just performing the vertex distance calculations once for the shape and not every time we merge a new hole will solve this scaling problem and get cases like the one uploaded here to run in a tiny fraction of the time. I imagine this would not take me much more than a day but I'll probably need another day after this to test it well and make sure it's working as designed.