Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions inkscape/svg2shenzhen/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,6 @@ def exportDrill(self, kicad_mod=False):

kicad_drill_string = ""

i = 0

if kicad_mod:
pad_template = "(pad {n} thru_hole circle (at {x} {y}) (size {d} {d}) (drill {d}) (layers *.Cu *.Mask))\n"
else:
Expand All @@ -686,7 +684,29 @@ def exportDrill(self, kicad_mod=False):
"""

layerPath = '//svg:g[@inkscape:groupmode="layer"][@inkscape:label="Drill"]'

kicad_drill_string += self.exportDrillLayer(layerPath, pad_template)

if kicad_mod:
pad_template = "(pad {n} np_thru_hole circle (at {x} {y}) (size {d} {d}) (drill {d}) (layers *.Cu *.Mask))\n"
else:
pad_template = """
(module Wire_Pads:SolderWirePad_single_0-8mmDrill (layer F.Cu) (tedit 0) (tstamp 5ABD66D0)
(at {x} {y})
(pad {n} np_thru_hole circle (at 0 0) (size {d} {d}) (drill {d}) (layers *.Cu *.Mask))
)
"""

layerPath = '//svg:g[@inkscape:groupmode="layer"][@inkscape:label="Drill-NP"]'

kicad_drill_string += self.exportDrillLayer(layerPath, pad_template)

return kicad_drill_string

def exportDrillLayer(self, layerPath, pad_template):

kicad_drill_string = ""

for layer in self.document.getroot().xpath(layerPath, namespaces=inkex.NSS):

layer_trans = layer.get('transform')
Expand Down