Skip to content

Commit

Permalink
Throw for less than 4 points
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarSigvardsson committed Oct 11, 2019
1 parent c7120e6 commit a218384
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Scripts/ConvexHullCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ public void GenerateHull(
ref List<int> tris,
ref List<Vector3> normals)
{
if (points.Count < 4) {
throw new System.ArgumentException("Need at least 4 points to generate a convex hull");
}

Initialize(points, splitVerts);

Expand Down

0 comments on commit a218384

Please sign in to comment.