Skip to content

Commit

Permalink
Fix max points allowed by qhull (#251)
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Heitzmann Gabrielli <heitzmann@gmail.com>
  • Loading branch information
heitzmann committed Jun 3, 2024
1 parent 76f226a commit 3864901
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,15 +561,15 @@ void convex_hull(const Array<Vec2> points, Array<Vec2>& result) {
if (points.count < 4) {
result.extend(points);
return;
} else if (points.count > INT_MAX) {
} else if (points.count > qh_POINTSmax) {
Array<Vec2> partial;
partial.count = INT_MAX - 1;
partial.count = qh_POINTSmax;
partial.items = points.items;
Array<Vec2> temp = {};
convex_hull(partial, temp);

partial.count = points.count - (INT_MAX - 1);
partial.items = points.items + (INT_MAX - 1);
partial.count = points.count - qh_POINTSmax;
partial.items = points.items + qh_POINTSmax;
temp.extend(partial);
convex_hull(temp, result);
temp.clear();
Expand Down

0 comments on commit 3864901

Please sign in to comment.