Skip to content

Commit

Permalink
Fix parsing of thickness field in stackup
Browse files Browse the repository at this point in the history
Related #58
  • Loading branch information
realthunder committed Jul 16, 2022
1 parent d3d4727 commit 8f850f1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kicad.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,14 @@ def _initStackUp(self):
self.copper_thickness if layer_type<=32 else self.layer_thickness)
if layer_type <= 31:
last_copper = offset
# Some layer may have more than one thickness field.
if isinstance(t, SexpList):
t = t[0][0]
t = t[0]
# And for some thickness field, there may be additional
# attribute, like (thickness, 0.05, locked).
if not isinstance(t, (float, int)):
t = t[0]

offset -= t
self.stackup.append([unquote(layer[0]), offset, t])
# adjust offset to make the last copper's upper face at z = 0.
Expand Down

0 comments on commit 8f850f1

Please sign in to comment.