Fix _polygonWallExtend for corners with negative angles
This commit is contained in:
parent
95dba0dee7
commit
dc11929258
|
@ -1827,18 +1827,31 @@ class Boxes:
|
||||||
except TypeError:
|
except TypeError:
|
||||||
angle = (angle + borders[i]) % 360
|
angle = (angle + borders[i]) % 360
|
||||||
continue
|
continue
|
||||||
centerx = posx + r * math.cos(math.radians(angle+90))
|
if a > 0:
|
||||||
centery = posy + r * math.sin(math.radians(angle+90))
|
centerx = posx + r * math.cos(math.radians(angle+90))
|
||||||
|
centery = posy + r * math.sin(math.radians(angle+90))
|
||||||
|
else:
|
||||||
|
centerx = posx + r * math.cos(math.radians(angle-90))
|
||||||
|
centery = posy + r * math.sin(math.radians(angle-90))
|
||||||
|
|
||||||
for direction in (0, 90, 180, 270):
|
for direction in (0, 90, 180, 270):
|
||||||
if ((a > 0 and
|
if (a > 0 and
|
||||||
angle <= direction and angle + a >= direction) or
|
angle <= direction and (angle + a) % 360 >= direction):
|
||||||
(a < 0 and
|
direction -= 90
|
||||||
angle >= direction and angle + a <= direction)):
|
elif (a < 0 and
|
||||||
checkpoint(ext, centerx + r * math.cos(math.radians(direction)), centery + r * math.sin(math.radians(direction)))
|
angle >= direction and (angle + a) % 360 <= direction):
|
||||||
|
direction -= 90
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
checkpoint(ext, centerx + r * math.cos(math.radians(direction)), centery + r * math.sin(math.radians(direction)))
|
||||||
|
#print("%4s %4s %4s %f %f" % (angle, direction+90, angle+a, centerx + r * math.cos(math.radians(direction)), centery + r * math.sin(math.radians(direction))))
|
||||||
angle = (angle + a) % 360
|
angle = (angle + a) % 360
|
||||||
posx = centerx + r * math.cos(math.radians(angle-90))
|
if a > 0:
|
||||||
posy = centery + r * math.sin(math.radians(angle-90))
|
posx = centerx + r * math.cos(math.radians(angle-90))
|
||||||
|
posy = centery + r * math.sin(math.radians(angle-90))
|
||||||
|
else:
|
||||||
|
posx = centerx + r * math.cos(math.radians(angle+90))
|
||||||
|
posy = centery + r * math.sin(math.radians(angle+90))
|
||||||
else:
|
else:
|
||||||
posx += borders[i] * math.cos(math.radians(angle))
|
posx += borders[i] * math.cos(math.radians(angle))
|
||||||
posy += borders[i] * math.sin(math.radians(angle))
|
posy += borders[i] * math.sin(math.radians(angle))
|
||||||
|
|
Loading…
Reference in New Issue