What is the mathematics behind inkscape's power stroke path effect interpolator_type and interpolator_beta attributes?

Trending 4 years ago

Inkscape has a characteristic called Power Stroke which is simply a shape of way effect. When you use it to a changeable you summation 3 power points that let you to set nan thickness of nan stroke. (I person not yet figured retired really to adhd much power points done nan UI, but it tin beryllium done successful nan XML editor).

Inspecting nan SVG reveals that nan changeable gets turned into a capable pinch a path@d that specifies nan outline, allowing nan SVG record to beryllium rendered by applications that cognize thing of Power Stroke.

Applications that do understand Power Stroke will beryllium looking for these attributes connected nan <path>:

inkscape:path-effect="#path-effect881" inkscape:original-d="m 109.59491,132.23789 c -19.148152,28.51854 -37.80734,35.62606 -46.969458,22.13393 -9.383889,-13.81871 -39.69277,-3.57313 -46.276359,5.34215 -16.01795169,21.691 17.695947,71.79071 39.993907,62.61593 17.000232,-6.99496 23.845432,-20.30176 23.845432,-20.30176"

The meaning of nan PowerStroke power points occurs wrong nan <defs>

<inkscape:path-effect effect="powerstroke" id="path-effect881" is_visible="true" offset_points="0.11606368,4.5282059 | 0.61857805,2.0941625 | 1.992627,6.538108 | 2.7945971,4.4492524" sort_points="true" interpolator_type="CubicBezierFit" interpolator_beta="0.2" start_linecap_type="round" linejoin_type="bevel" miter_limit="4" end_linecap_type="butt" />

I person concluded that nan @offset_points database tin beryllium interpreted arsenic a database of t,r tuples, wherever t=0 is nan first "major" power constituent successful nan path@d, and t=1 is nan next. A conception that is simply a cubic bezier curve is traditionally interpreted arsenic having 4 power points, but for nan intent of way effects, nan first and past power points are what I person termed "major" power points, and are shared pinch nan segments connected either side.

What I do not yet understand is nan @interpolator_type, likewise nan @interpolator_beta. I presume this controls really you interpolate nan radius you cipher betwixt nan different offset_points, but I'm not judge what nonstop look to use. When I deliberation Bezier, I deliberation of Bezier curves, and really they only lucifer up pinch their power points astatine nan extremity of nan segment. I deliberation nan _beta corresponds to nan "smoothness" section successful nan UI.

If I wanted to cipher nan Power Stroke radius astatine t=1.32, what look would I use?