Replies: 7 comments
-
You always supply good challenges @dhivehi ! Are you aware of any existing open source libraries or software that do this? Thanks, |
Beta Was this translation helpful? Give feedback.
-
Donno any library which can achieve this feature. |
Beta Was this translation helpful? Give feedback.
-
@dhivehi Here is one approach using only turf functions: https://jsfiddle.net/dpmcmlxxvi/92gvht0z Basically, given a target polygon you want hulled (in blue), compute its convex hull then difference out the clipper polygon you want to avoid (in red), then only keep points that were in the original hull or the clipper polygon (in green). The last step removes points artificially introduced by the difference. A few things to keep in mind:
|
Beta Was this translation helpful? Give feedback.
-
Good attempt, but i need a function which works for polygons with many sides. |
Beta Was this translation helpful? Give feedback.
-
@dhivehi By "sides", I assume you mean, multi-polygons. The implementation can be easily extended to cover that case. |
Beta Was this translation helpful? Give feedback.
-
I mean it doesnt work with complex polygons. And not optimal hull is generated in many cases |
Beta Was this translation helpful? Give feedback.
-
You haven't defined optimal. I think this gets you most of the way there and can work with some tweaks. Regardless, good luck finding a solution. |
Beta Was this translation helpful? Give feedback.
-
I want find maximum convex hull of a polygon without breaking into another polygon.
Beta Was this translation helpful? Give feedback.
All reactions