diff options
author | Garret Fick <garret@ficksworkshop.com> | 2015-12-16 18:59:25 +0800 |
---|---|---|
committer | Garret Fick <garret@ficksworkshop.com> | 2015-12-16 18:59:25 +0800 |
commit | 206f4c57ab66f8a6753015340315991b40178c9b (patch) | |
tree | 0b1a199270dac696193c8eaead7987f59c5f73b4 /gerber/excellon.py | |
parent | 221f67d8fe77ecae6c8e99db767eace5da0c1f9e (diff) | |
download | gerbonara-206f4c57ab66f8a6753015340315991b40178c9b.tar.gz gerbonara-206f4c57ab66f8a6753015340315991b40178c9b.tar.bz2 gerbonara-206f4c57ab66f8a6753015340315991b40178c9b.zip |
Fix drawing arcs. Dont crash for arcs with rectangular apertures. Fix crash with board size of zero for only one drill
Diffstat (limited to 'gerber/excellon.py')
-rwxr-xr-x | gerber/excellon.py | 4 |
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 |