Skip to content

Commit

Permalink
Not overly agressive with the polygon rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Oct 14, 2024
1 parent a7b735b commit 830cd15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/eu/mihosoft/vrl/v3d/Plane.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ public static Vector3d computeNormal(List<Vertex> vertices) {
// If all else fails, return a default normal (e.g., in the z direction)
lengthSquared = normal.lengthSquared();

if (lengthSquared < d) {
if (lengthSquared < Double.MIN_VALUE*10) {
throw new NumberFormatException("This set of points is not a valid polygon");
}
if(normalized.lengthSquared()<EPSILON)
throw new NumberFormatException("Invalid Normalized Values!");
return normalized;
}

Expand Down

0 comments on commit 830cd15

Please sign in to comment.