I developed a Jetpack Compose smooth corners (G² c...
# feed
k
I developed a Jetpack Compose smooth corners (G² continuity) library. The corner smoothing is superior to that in
androidx.graphics.shapes
. You can control the smoothness in two ways: one is the proportion of the circular section, and the other is the distance from which the corner smoothing starts. https://github.com/Kyant0/Capsule
🆒 1
s
Awesome work! More libraries are always great to see. AndroidX already has a graphics‑shapes library (by Chet Haase) — it includes a wide variety of shapes and smoothing/rounding corner functions (so you can do things like squircles, thanks to the smoothing capabilities). 🙂 For more info: • https://medium.com/androiddevelopers/the-shape-of-things-to-come-1c7663d9dbc0https://github.com/chethaase/ShapesDemohttps://developer.android.com/develop/ui/compose/graphics/draw/shapes
Maybe your library uses different smoothing formulas.
k
Yes, but I investigated the smoothness of androidx, it is not actually G² continuous. I don't know why. If do G² for arbitrary Bezier curves we need to solve a quartic function, but it is a special quartic function which can be solved easier.