From 206f4c57ab66f8a6753015340315991b40178c9b Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Wed, 16 Dec 2015 18:59:25 +0800 Subject: Fix drawing arcs. Dont crash for arcs with rectangular apertures. Fix crash with board size of zero for only one drill --- gerber/excellon.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gerber/excellon.py') 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 -- cgit