Skip to content

Commit

Permalink
Fixed issues with KiCad 6 and IsClosed()
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Aug 6, 2024
1 parent 74f44eb commit 6459174
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kikit/substrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ def getEndPoint(geom):
# Rectangle is closed, so it starts at the same point as it ends
point = geom.GetStart()
else:
point = geom.GetStart() if geom.IsClosed() else geom.GetEnd()
if hasattr(geom, 'IsClosed'):
point = geom.GetStart() if geom.IsClosed() else geom.GetEnd()
else:
point = geom.GetEnd()
return point

class CoincidenceList(list):
Expand Down Expand Up @@ -233,7 +236,8 @@ def shapePolyToShapely(p: pcbnew.SHAPE_POLY_SET) \
polygons = []
for pIdx in range(p.OutlineCount()):
kOutline = p.Outline(pIdx)
assert kOutline.IsClosed()
if hasattr(kOutline, 'IsClosed'):
assert kOutline.IsClosed()
outline = shapeLinechainToList(kOutline)
holes = []
for hIdx in range(p.HoleCount(pIdx)):
Expand Down

0 comments on commit 6459174

Please sign in to comment.