Extended ability to customize pen input curves

So, I really love the ability to change the different input curves when customizing my brush, but ever so often I run into a roadblock. Sometimes - especially when I’m making pattern brushes that are meant to change based on distance or time - it would be very useful for me to make a part of the curve, well - not a curve, but rather a straight line, or a ‘step’. Right now, as far as I understand, the values between the points I set in the curve customization space are based on interpolating the simplest polynomial (which I imagine is very efficient computationally) but there is no way to interpolate the values between any two points linearly, or immediately go from one output value to the other without any interpolation.
I am providing a mock-up, to clarify what I would like to be able to do.

The symbols and shortcuts I added are just examples, but I believe it conveys the general idea. Right now it’s not really possible for me to accomplish something like this, at least not conveniently or fully.
I could more-or-less get the “steps” if I only flip between 0% and 100% output, with no ability to get any intermediate values, and I think it’s technically possible for me to insert a straight line into the curve if I manually set every single point from 0 to 100. And even then it’s not gonna be perfect, since I can only set the coordinates in increments of 1.
So, yeah, while I imagine it might be a tough thing to add, since it requires messing with the some basics of brush operation, and would probably impact performance (at last of the more customized brushes), I think it would be a pretty cool thing to have. And that’s very important.


At the moment, it fits a cubic polynomial, as mentioned in this topic:

It is a cool idea and maybe it could be implemented one day.

Just a nomenclature nitpick, but - correct me if I’m wrong - isn’t it an n-th degre polynomial, depending on how many points I select?
I mean, it will fit any curve I form, so I reckon it’s not just a cubic
Or is it some weird thing where they are locally cubic and just stitched together at the ‘seams’?

I have no idea about the details but @tiar probably knows more :slight_smile:

@Michos I believe this widget is KisCurveWidget and it holds KisCubicCurve (which has a private class called KisCubicSpline inside, too), which is most probably (it wasn’t me writing it, and I haven’t checked the code) just a standard cubic curve with as many points as you want. I’m not sure what you mean by that:

In any case, the feature request is nice, it would be good to have more options for the curve. I’m not sure how feasible it is though. It should be possible.