Skip to content

Commit 002d627

Browse files
committed
Fix polygons inside footprints for kicad 8
1 parent a0887b3 commit 002d627

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

InteractiveHtmlBom/ecad/kicad.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
from ..core.fontparser import FontParser
1212

1313

14+
KICAD_VERSION = [5, 1, 0]
15+
16+
if hasattr(pcbnew, 'Version'):
17+
version = pcbnew.Version().split('.')
18+
try:
19+
for i in range(len(version)):
20+
version[i] = int(version[i].split('-')[0])
21+
except ValueError:
22+
pass
23+
KICAD_VERSION = version
24+
25+
1426
class PcbnewParser(EcadParser):
1527

1628
def __init__(self, file_name, config, logger, board=None):
@@ -189,7 +201,7 @@ def parse_shape(self, d):
189201
parent_footprint = d.GetParentModule()
190202
else:
191203
parent_footprint = d.GetParentFootprint()
192-
if parent_footprint is not None:
204+
if parent_footprint is not None and KICAD_VERSION[0] < 8:
193205
angle = self.normalize_angle(parent_footprint.GetOrientation())
194206
shape_dict = {
195207
"type": shape,

0 commit comments

Comments
 (0)