Forum

Performant way to draw Circle Segments in Skia

Since the default segment in Skia behaves kind of strange, I patched one using paths like so:

image

CircleSegment

CircleSegment.vl (27.8 KB)

That is fine as long it is “static” but because of Op [Graphics.Skia.Paths] it becomes quite expensive when animating the properties of the paths. Is there a better / more performant way do this?.

2 Likes

cool! I thought maybe without the bool op it’s more performant. but not tested. still a little error. (have to use first point as last one again)

segment CircleSegment2.vl (31.1 KB)

if I’m not mistaken, this might have a memory leak. the unconnected path input pins will create a new path on every run (every frame, if you animate the radius pins). so I would only create one path per node on create and pass that into the cache region and clear/reset the path on every run of the cache.

1 Like