Skip to content

Commit b94e8d9

Browse files
zharovdvqu1ck
authored andcommitted
Fix BB computing for arc (typo in xc/yc, forgot radius)
1 parent 9e659e2 commit b94e8d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

InteractiveHtmlBom/ecad/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ def add_arc():
122122
a1 = drawing['startangle']
123123
a2 = drawing['endangle']
124124
r = drawing['radius']
125-
x1 = xc + math.cos(math.radians(a1))
126-
y1 = xc + math.sin(math.radians(a1))
127-
x2 = xc + math.cos(math.radians(a2))
128-
y2 = xc + math.sin(math.radians(a2))
125+
x1 = xc + r * math.cos(math.radians(a1))
126+
y1 = yc + r * math.sin(math.radians(a1))
127+
x2 = xc + r * math.cos(math.radians(a2))
128+
y2 = yc + r * math.sin(math.radians(a2))
129129
da = a2 - a1 if a2 > a1 else a2 + 360 - a1
130130
la = 1 if da > 180 else 0
131131
svgpath = 'M %s %s A %s %s 0 %s 1 %s %s' % \

0 commit comments

Comments
 (0)