Skip to content

Commit

Permalink
Fix polygons inside footprints for kicad 8
Browse files Browse the repository at this point in the history
  • Loading branch information
qu1ck committed Jun 8, 2024
1 parent a0887b3 commit 002d627
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion InteractiveHtmlBom/ecad/kicad.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
from ..core.fontparser import FontParser


KICAD_VERSION = [5, 1, 0]

if hasattr(pcbnew, 'Version'):
version = pcbnew.Version().split('.')
try:
for i in range(len(version)):
version[i] = int(version[i].split('-')[0])
except ValueError:
pass
KICAD_VERSION = version


class PcbnewParser(EcadParser):

def __init__(self, file_name, config, logger, board=None):
Expand Down Expand Up @@ -189,7 +201,7 @@ def parse_shape(self, d):
parent_footprint = d.GetParentModule()
else:
parent_footprint = d.GetParentFootprint()
if parent_footprint is not None:
if parent_footprint is not None and KICAD_VERSION[0] < 8:
angle = self.normalize_angle(parent_footprint.GetOrientation())
shape_dict = {
"type": shape,
Expand Down

0 comments on commit 002d627

Please sign in to comment.