Skip to content

Commit 02d0601

Browse files
committed
Fix bezier curve handling for 5.1
1 parent c16dda5 commit 02d0601

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

InteractiveHtmlBom/ecad/kicad.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,17 @@ def parse_shape(self, d):
152152
shape_dict["width"] = d.GetWidth() * 1e-6
153153
return shape_dict
154154
if shape == "curve":
155+
if hasattr(d, "GetBezierC1"):
156+
c1 = self.normalize(d.GetBezierC1())
157+
c2 = self.normalize(d.GetBezierC2())
158+
else:
159+
c1 = self.normalize(d.GetBezControl1())
160+
c2 = self.normalize(d.GetBezControl2())
155161
return {
156162
"type": shape,
157163
"start": start,
158-
"cpa": self.normalize(d.GetBezierC1()),
159-
"cpb": self.normalize(d.GetBezierC2()),
164+
"cpa": c1,
165+
"cpb": c2,
160166
"end": end,
161167
"width": d.GetWidth() * 1e-6
162168
}

0 commit comments

Comments
 (0)