- #1
ChaosMageX
- 1
- 0
Is there a way to convert a rational bezier curve to a piecewise series of one or more polynomial bezier curves with minimal loss in accuracy, specially cubic ones? I've already tried searching the internet for pre-existing algorithms, but I haven't been able to find any usable results despite trying several different keyword combinations. I finally decided to inquire about it here, and hopefully someone else here knows of one or more algorithms that can convert a rational bezier curve to a polynomial one.
So far I've been experimenting with my own algorithm that follows these steps, and I want to know if I'm on the right track, since I haven't yet succeeded in getting it to work (mostly due to the large amount of math involved and figuring out how to generalize it):
1) Set rational curve equal to an arbitrary polynomial curve of a degree >= the degree of the rational curve.
2) Multiply both sides by the denominator of the rational curve.
3) Elevate the degree of the numerator of the rational curve to match the degree of the denominator X the arbitrary polynomial curve.
4) Solve for the values of the control points of the arbitrary polynomial curve.
5) If the polynomial curve doesn't accurately map to the rational curve, create a new arbitrary polynomial curve of a higher degree than the current one and repeat the procedure.
If anyone knows of a generalized version of this algorithm with equations relating the control points of the polynomial curve to the control points and weights of the rational curve, could you please give me a link to the web page or publication with those equations? I thank you for doing so.
If the above algorithm doesn't work, my other option would be a brute force algorithm of calculating the tangents at arbitrary points along the rational bezier curve and using those tangents to divide it into a piecewise series of cubic polynomial bezier curves such that the accuracy and numerical stability of the curves falls within predefined thresholds. Does anyone know of web pages or publications discussing this brute force technique, specifically the division into cubic polynomial bezier curves for graphics applications?
I'm primarily interested in doing this in order to convert a polynomial cubic bezier curve to a rational cubic bezier curve with all weights equal to one, apply projective transformations to it, and then convert the transformed rational cubic bezier curve back into a series of one or more piecewise polynomial cubic bezier curves to be drawn by computer graphics APIs.
If the initial algorithm does work, I'd then have to find an additional numerically stable algorithm to reduce the degree of the resulting polynomial bezier curve to three by dividing it into a piecewise series of cubic polynomial bezier curves. Ultimately it might be better just to cut to the chase and use the brute force algorithm of dividing the rational bezier curve into a piecewise series of cubic polynomial bezier curves.
Still, at this point, I'd really like to know if the algorithm I've outlined the steps to above would actually work before moving away from it if a faster and more efficient algorithm exists.
So far I've been experimenting with my own algorithm that follows these steps, and I want to know if I'm on the right track, since I haven't yet succeeded in getting it to work (mostly due to the large amount of math involved and figuring out how to generalize it):
1) Set rational curve equal to an arbitrary polynomial curve of a degree >= the degree of the rational curve.
2) Multiply both sides by the denominator of the rational curve.
3) Elevate the degree of the numerator of the rational curve to match the degree of the denominator X the arbitrary polynomial curve.
4) Solve for the values of the control points of the arbitrary polynomial curve.
5) If the polynomial curve doesn't accurately map to the rational curve, create a new arbitrary polynomial curve of a higher degree than the current one and repeat the procedure.
If anyone knows of a generalized version of this algorithm with equations relating the control points of the polynomial curve to the control points and weights of the rational curve, could you please give me a link to the web page or publication with those equations? I thank you for doing so.
If the above algorithm doesn't work, my other option would be a brute force algorithm of calculating the tangents at arbitrary points along the rational bezier curve and using those tangents to divide it into a piecewise series of cubic polynomial bezier curves such that the accuracy and numerical stability of the curves falls within predefined thresholds. Does anyone know of web pages or publications discussing this brute force technique, specifically the division into cubic polynomial bezier curves for graphics applications?
I'm primarily interested in doing this in order to convert a polynomial cubic bezier curve to a rational cubic bezier curve with all weights equal to one, apply projective transformations to it, and then convert the transformed rational cubic bezier curve back into a series of one or more piecewise polynomial cubic bezier curves to be drawn by computer graphics APIs.
If the initial algorithm does work, I'd then have to find an additional numerically stable algorithm to reduce the degree of the resulting polynomial bezier curve to three by dividing it into a piecewise series of cubic polynomial bezier curves. Ultimately it might be better just to cut to the chase and use the brute force algorithm of dividing the rational bezier curve into a piecewise series of cubic polynomial bezier curves.
Still, at this point, I'd really like to know if the algorithm I've outlined the steps to above would actually work before moving away from it if a faster and more efficient algorithm exists.
Last edited: