Closed anthrotype closed 4 years ago
Why do we need this?
When adding arcs to a Path, skia internally stores them as conic curves. We need to get rid of conic curves when we convert a Path to one that we can consume with the FontTools Pen protocol.
We have a method on pathops.Path
called convertConicsToQuads
that takes a tolerance parameter (a float).
Internally this calls SkPath::CovertConicToQuads
method. The latter in turns takes a pow2
parameter which defines the maximum number of quads to use to approximate the conic (count is 2 to the pow2
):
In private SkGeometry module, SkConic struct as a convenient computeQuadPOW2
method that given a float tolerance and the conic points and weight, return the most optimal pow2 value that approximate the conic within that tolerance.
That's what this method is doing. I can't simply include the header because it's private, so I rewrote it in cython. Does that clarify the intent?
Ah, arcs. Got it. We don't really need that but I see the library provides it. Thanks.
Anyway. I wasn't asking why you need it. Was suggesting to add a line to the code about what this function does, because the name wasn't clear. I didn't know what the POW
there refers to. Had to read the original code to understand.
definitely thanks, I'll add a comment 👍
Fixes #33