Skip to content

Commit

Permalink
add count
Browse files Browse the repository at this point in the history
  • Loading branch information
badgeek committed Mar 31, 2018
1 parent 0bc3178 commit 72be9fd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions inkscape/export_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def exportDrill(self):
pad_template = """
(module Wire_Pads:SolderWirePad_single_0-8mmDrill (layer F.Cu) (tedit 0) (tstamp 5ABD66D0)
(at %f %f)
(pad %d thru_hole circle (at 0 0) (size 1.99898 1.99898) (drill 0.8001) (layers *.Cu *.Mask))
(pad %d thru_hole circle (at 0 0) (size 1.99898 1.99898) (drill %f) (layers *.Cu *.Mask))
)
"""

Expand All @@ -455,9 +455,18 @@ def exportDrill(self):
layer_m = identity_m

nodePath = ('//svg:g[@inkscape:groupmode="layer"][%d]/descendant::svg:circle') % i

count = 0
for node in self.document.getroot().xpath(nodePath, namespaces=inkex.NSS):
count = count + 1
cx = float(node.get('cx'))
cy = float(node.get('cy'))

# if (node.get('rx') and node.get('ry')):
# rx = float(node.get('rx'))
# ry = float(node.get('ry'))

radius = float(node.get('r'))
t = node.get('transform')

pt = [cx, cy]
Expand All @@ -471,10 +480,7 @@ def exportDrill(self):
simpletransform.applyTransformToPoint(trans,pt)
padCoord = self.coordToKicad(pt)




kicad_drill_string = kicad_drill_string + (pad_template % (padCoord[0], padCoord[1], 1))
kicad_drill_string = kicad_drill_string + (pad_template % (padCoord[0], padCoord[1], count, 0.8001))

return kicad_drill_string

Expand Down

0 comments on commit 72be9fd

Please sign in to comment.