Create custom shapes in Makie.jl

Hello,

I would like to create a custom shape using Makie.jl. Something like the figure below

image

This is basically a rectangle with one curved side instead of strainght.

I have no clue if it is possible to create such a shape using Makie.jl.

I know there are the mesh and poly function. The latter should be used only for straight lines, I guess.

You can use BezierPath to define such shapes for use with scatter or poly.

You’ll need MoveTo, LineTo, EllipticalArc and ClosePath for yours

1 Like

Ok thanks, the following code worked

fig = Figure()
ax = Axis(fig[1, 1])

path_prova = BezierPath([
    MoveTo(1, 1), # Upper-right corner
    LineTo(0, 1), # Upper-left corner
    LineTo(0, 0), # Lower-left corner
    LineTo(1, 0), # Lower-right corner
    CurveTo(Point2f(0.5, 0.4), Point2f(0.5, 0.6), Point2f(1, 1)), # Upper-right corner
    ClosePath()
])

poly!(ax, path_prova; color=:black)

fig