MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.37k stars 302 forks source link

`roundedrectvertices` does not return a complete polygon #4030

Open asinghvi17 opened 1 month ago

asinghvi17 commented 1 month ago

The issue here is that roundedrectvertices does not close its line, i.e., verts[end] != verts[begin]. Without this, although poly works because of the fill rule, lines does not work and the output is in general not correct.

The ideal fix is that roundedrectvertices closes the line string by adding an additional point after the end (towards the yellow color in the plot) that connects to the beginning.

MWE:

using CairoMakie
bounding_rectangle = Rect2f(0, 0, 15, 10)

frame = Makie.roundedrectvertices(bounding_rectangle, 2, 50)

lines(frame; color = 1:length(frame))

download-4

jkrumbiegel commented 1 month ago

Not needed anymore anyway I think as one can use BezierPath

ffreyer commented 1 week ago

I guess it makes sense to fix this nonetheless? Otherwise we should close this