Open MaxDeVos opened 7 months ago
The curve classes were added to support various projects I was working on at different times, and I guess I didn't have a need for quadratic Bezier curves. So that's why it's not supported. Your solutions seem plausible but I am not going to implement them, feel free to submit a PR.
Disclaimer: I feel as though I am missing something fundamental here, that some existing component already serves this purpose and I don't know it.
Is there a reason that quadratic Bezier curves are not explicitly supported by this library? The
BezierCurve2
class explicitly excludes them, likely due to not having a valid result forGetThirdDerivative(double t)
. I see three potential solutions to this:1)
BezierCurve2
is modified to automatically convert quadratic bezier curves to cubic ones by calculating control point 1, which can be done as follows:2)
QuadraticBezierCurve2
is added and its implementation ofGetThirdDerivative(t)
always returnsdouble.NaN
. 3)BezierCurve2
is modified to natively support quadratic bezier curves, but the boolean propertyisQuadratic
is added, and GetThirdDerivative(t) returnsdouble.NaN
when the curve is quadratic.