1

Trying to draw this wavy circle using Android canvas. Have tried using a Bezier curve, but not getting any good results.

Example of desired result

Mahozad
  • 18,032
  • 13
  • 118
  • 133
mkki
  • 312
  • 2
  • 13
  • 1
    See: [Parametric equation of sinusoidal curve around semi-circle for radius 0.75](https://math.stackexchange.com/q/3341257/118981) the desmos graph in the answer should help visualize. Alternatively consider drawing one slice of the pie/clock face and rotate 12 times. – Morrison Chang Mar 12 '23 at 03:41
  • 1
    There is an open source app that named Read You. They achived this using CornerBasedShape. Here is [implementation](https://github.com/Ashinch/ReadYou/blob/main/app/src/main/java/me/ash/reader/ui/component/base/CurlyCornerShape.kt) and [usage](https://github.com/Ashinch/ReadYou/blob/main/app/src/main/java/me/ash/reader/ui/page/settings/tips/TipsAndSupportPage.kt#L137) – Enes Kayıklık Mar 12 '23 at 05:54
  • Thanks guys. @EnesKayıklık that was exactly what I was looking for. I was able to convert it into a path and add it to a canvas. – mkki Mar 13 '23 at 15:10

1 Answers1

0

I think the new Androidx graphics-shapes library is what you want.
See the related Medium article: The Shape of Things to Come.

Also, for Jetpack Compose, there is a GitHub repository here creating those shapes.

As a side note, I was looking for the name of this shape and I think it is called:

  • scallop
  • sunflower
  • star
  • clover
  • rounded polygon
  • wavy circle
  • zigzag circle
Mahozad
  • 18,032
  • 13
  • 118
  • 133