mapbox / earcut.hpp

Fast, header-only polygon triangulation
ISC License
858 stars 133 forks source link

Helper function for earcutting just a std::vector<> of points #106

Open Andersama opened 2 years ago

Andersama commented 2 years ago

It seems like with very minimal effort the existing:

        template <typename N> template <typename Polygon>
        void Earcut<N>::operator()(const Polygon& points)

could have an accompanying function for handling just a very basic container. Currently the function assumes there may be holes, but for many users, this might not be the case.

Yaazarai commented 1 year ago

I don't see this as an issue, a quick wrap of your container into a second container as the documentation shows is pretty easy. Or you could write your own wrapper function or write it directly into the header itself to handle this case.