mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-01-16 21:58:27 +01:00
bugfix
This commit is contained in:
parent
f3b35eab0a
commit
04437cc6a0
@ -852,15 +852,17 @@ function arc(n, r, angle, d, cp, points, corner, width, thickness, start, wedge=
|
|||||||
theta_end = atan2(points[1].y-cp.y, points[1].x-cp.x),
|
theta_end = atan2(points[1].y-cp.y, points[1].x-cp.x),
|
||||||
angle = posmod(theta_end-theta_start, 360),
|
angle = posmod(theta_end-theta_start, 360),
|
||||||
// Specify endpoints exactly; skip those endpoints when producing arc points
|
// Specify endpoints exactly; skip those endpoints when producing arc points
|
||||||
|
// Generating the whole arc and clipping ends is the easiest way to ensure that we
|
||||||
|
// generate the proper number of points.
|
||||||
arcpts = [ if (wedge) cp,
|
arcpts = [ if (wedge) cp,
|
||||||
points[0],
|
points[0],
|
||||||
each arc(n-2,cp=cp,r=r,start=theta_start+angle/(n-1),angle=angle-2*angle/(n-1)),
|
each select(arc(n,cp=cp,r=r,start=theta_start,angle=angle),1,-2),
|
||||||
points[1]
|
points[1]
|
||||||
]
|
]
|
||||||
|
|
||||||
)
|
)
|
||||||
dir ? arcpts
|
dir ? arcpts
|
||||||
: wedge ? reverse_polygon(arcpts)
|
: wedge ? reverse_polygon(arcpts) // Keep the centerpoint at position 0 in the list
|
||||||
: reverse(arcpts);
|
: reverse(arcpts);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user