Skip to content

Commit

Permalink
Handle problems SVGs a little better
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrettR committed Jan 1, 2021
1 parent 9c3e180 commit 0556635
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pcb_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,21 @@ def Parse_Module(self, tag):
zones = []
transform = tag['transform']

translate = transform[transform.find('translate(') + 10:]
translate = translate[0:translate.find(')')]
x = translate[0:translate.find(',')]
y = translate[len(x) + 1:]
x = float(x) / pxToMM
y = float(y) / pxToMM
x = 0
y = 0
if 'translate(' in transform:
translate = transform[transform.find('translate(') + 10:]
translate = translate[0:translate.find(')')]
x = translate[0:translate.find(',')]
y = translate[len(x) + 1:]
x = float(x) / pxToMM
y = float(y) / pxToMM

rotate = 0
if 'rotate(' in transform:
rotate = transform[transform.find('rotate(') + 7:]
if ',' in rotate:
rotate = rotate[:rotate.find(',')]
rotate = float(rotate[0:-1]) * -1


Expand Down

0 comments on commit 0556635

Please sign in to comment.