geo icon indicating copy to clipboard operation
geo copied to clipboard

Expose Graham's scan as a trait

Open frewsxcv opened this issue 5 years ago • 2 comments

We have two convex hull implementations in our crate: Quickhull and Graham's scan. Only the former is public and available for users to use. Should we publicize the latter?

frewsxcv avatar Jan 04 '21 15:01 frewsxcv

Just for clarity: we initially added this algo. to support c.hull for non-float types. Since then, we figured how to tweak qhull to do the same. Currently, the graham scan supports a somewhat obscure use-case: of computing all points along the convex hull as opposed to a strict c.hull.

The algorithm is already public, and available at geo::algorithm::convex_hull::graham_hull which after the flattening PR should become geo::convex_hull::graham_hull. Are you thinking of further exposing this; say as another trait GrahamHull? I suppose we could add blanket impls based on the CoordsIter trait if we want.

rmanoka avatar Jan 04 '21 16:01 rmanoka

The algorithm is already public, and available at geo::algorithm::convex_hull::graham_hull which after the flattening PR should become geo::convex_hull::graham_hull. Are you thinking of further exposing this; say as another trait GrahamHull?

Oh I didn't realize the function is already exposed. Then yeah I'm slightly in favor of exposing that functionality as a trait to match the existing algorithms, but I don't feel strongly

frewsxcv avatar Jan 04 '21 16:01 frewsxcv