Hey everybody I'm currently working on a custom sh...
# compose
d
Hey everybody I'm currently working on a custom shape and have a question regarding smoothing the intersections of paths (using
PathOperation.Difference
) 🧵
Attachment #1 shows the desired result. To achieve this, I've tried the following approach: - create a superellips path - create rounded rect path - intersect them using PathOperation.Difference and got the shape on attachment #2 As you can see, it closely resembles the desired shape, but the path smoothing at the intersection points is missing. How can I achieve this behavior? Any hints or suggestions would be greatly appreciated
a
quadraticBezierTo
,
cubicTo
are usually used to make smooth curves
d
how can I find a intersection points of superellipse and rect? this functions take points, which coordinates are unknown
a
I mean it is nearly impossible to do it with primitive paths operations. You can easily make this shape from a combination of bezier curves without any ellipces or rects
d
thank you! I believe this is the way. but the difficulty here is that it can be any shape, and position of the rect is dynamic thank you anyway
a
Actually there is API for rounding path corners. It is called
PathEffect
.
cornerPathEffect
. It exists only for
Paint
so you have to use
drawIntoCanvas
. Not sure if this would help here but it definitely worth to try