This is for an iPad application, but it's essentially a math question.
I need to draw a circular arc of varying (monotonically increasing) line width. At the beginning of the curve, it would have an initial thickness (let it be 2pts), and then the thickness would gradually increase to the end of the arc, where it would have the greatest thickness (say, 12pts).
I believe the best way to do this is to create a UIBezierPath and fill out the form. My first attempt was to use two circular arcs (with offset centers) that worked normally up to 90 °, but the arc was often between 90 ° and 180 °, so the approach did not shorten it.
My current approach is to make a small spiral (one grows slightly from the arc of a circle and decrease slightly) using square or cubic bezier curves. Question: where do I put control points so that the deviation from the arc of a circle (the so-called "thickness") is the value I want.
Limitations:
- The form should be able to begin and end at any angle (within 180 ° from each other)
- The "thickness" of the form (deviation from the circle) should begin and end with the set values
- "Thickness" should increase monotonously (it cannot become more and then less).
- It should look smooth, there can be no sharp bends
I am also open to other solutions.
source share