summaryrefslogtreecommitdiff
path: root/gerber/excellon.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerber/excellon.py')
-rwxr-xr-xgerber/excellon.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gerber/excellon.py b/gerber/excellon.py
index 4ff2161..85821e5 100755
--- a/gerber/excellon.py
+++ b/gerber/excellon.py
@@ -634,7 +634,11 @@ def _layer_size_score(size, hole_count, hole_area):
Lower is better.
"""
board_area = size[0] * size[1]
+ if board_area == 0:
+ return 0
+
hole_percentage = hole_area / board_area
hole_score = (hole_percentage - 0.25) ** 2
size_score = (board_area - 8) **2
return hole_score * size_score
+ \ No newline at end of file