Skip to content

Commit

Permalink
Support for ovals with only R terms instead of RX and RY
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrettR committed Oct 31, 2022
1 parent 7ad50b2 commit 82d1ad8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Stretch/kiplug/pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,14 @@ def From_SVG(self, tag, angle = 0):
y = str(float(tag['cy']) / pxToMM)

elif self.shape == 'oval':
rx = str((float(tag['rx']) * 2) / pxToMM)
ry = str((float(tag['ry']) * 2) / pxToMM)
self.size = [rx, ry]
if tag.has_attr('rx'):
rx = str((float(tag['rx']) * 2) / pxToMM)
ry = str((float(tag['ry']) * 2) / pxToMM)
self.size = [rx, ry]
elif tag.has_attr('r'):
r = str((float(tag['r']) * 2) / pxToMM)
self.size = [r, r]

x = str(float(tag['cx']) / pxToMM)
y = str(float(tag['cy']) / pxToMM)
else:
Expand Down

0 comments on commit 82d1ad8

Please sign in to comment.