开发者

Cubic B-spline curve in Java

开发者 https://www.devze.com 2023-01-29 17:01 出处:网络
I need to use a cubic B-spline curve but cannot find code for it anywhere. The only curves available in Java API are QuadCurve2D, Path2D and CubicCurve2D. I think they all are Bezier, but I\'m not sur

I need to use a cubic B-spline curve but cannot find code for it anywhere. The only curves available in Java API are QuadCurve2D, Path2D and CubicCurve2D. I think they all are Bezier, but I'm not sure about it.

If you know where can I find code for cubic B-spline preferably that extends Java Shape class and supports开发者_StackOverflow中文版 contains(Point p) for onMouseOver please help.


CubicCurve2D is a cubic B-spline.

However, this may or may not be what you need as there are other cubic B-splines.

That is, all CubicCurve2Ds are cubic B-splines. Not all cubic B-splines are CubicCurve2Ds.


Apache has a class to represent spline curves:

http://jmeter.apache.org/api/org/apache/jmeter/visualizers/Spline3.html

However, it doesn't extend Shape or support what you want. The class works by interpolating the curve between nodes with a cubic curve. For contains(Point P) You might be able to use the getPlots() method, compare its results to the x and y values of P.

0

精彩评论

暂无评论...
验证码 换一张
取 消