Finding a point on a Bézier curve when given the distance from the start point?

前端 未结 2 708
一整个雨季
一整个雨季 2021-02-15 10:51

I created a 4 point Bézier curve, and a distance. Starting at the start point, how do I find the x,y coordinates of a point which is that distance away from the start point? <

2条回答
  •  感情败类
    2021-02-15 11:26

    The javagraphics library has the MeasuredShape (https://javagraphics.java.net/doc/com/bric/geom/MeasuredShape.html) class which provides the getPoint method to do just this. It also has some very handy methods for getting subpaths and tangent angles. As far as I can tell, they are implementing the path logic "correctly," not resorting to breaking up the paths.

    I have used this part of the library on a project that requires this sort of geometric calculation and it seems to be work perfectly.

提交回复
热议问题