summaryrefslogtreecommitdiff
path: root/gerberex/excellon.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerberex/excellon.py')
-rw-r--r--gerberex/excellon.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gerberex/excellon.py b/gerberex/excellon.py
index 78e6e5f..90d6742 100644
--- a/gerberex/excellon.py
+++ b/gerberex/excellon.py
@@ -6,6 +6,7 @@
from gerber.excellon import (ExcellonParser, detect_excellon_format, ExcellonFile)
from gerber.excellon_statements import UnitStmt
from gerber.cam import FileSettings
+from gerberex.utility import rotate
def loads(data, filename=None, settings=None, tools=None, format=None):
if not settings:
@@ -27,6 +28,12 @@ class ExcellonFileEx(ExcellonFile):
def __init__(self, statements, tools, hits, settings, filename=None):
super(ExcellonFileEx, self).__init__(statements, tools, hits, settings, filename)
+ def rotate(self, angle, center=(0,0)):
+ if angle % 360 == 0:
+ return
+ for hit in self.hits:
+ hit.position = rotate(hit.position[0], hit.position[1], angle, center)
+
class UnitStmtEx(UnitStmt):
@classmethod
def from_statement(cls, stmt):