I need to connect three points by a smooth curve. I've looked at the same questions already answered on StackOverflow but they all suggest using Path.quadTo()
. I do not understand why this is considered a correct answer as Bezier curve is only approaching middle (control) point but not going through it. In my case I have to go exactly through it. So how can I achieve that?
1) You can create curves from points using either the Interpolate Curve component or the Curve component. 2) This question is not at all clear. Maybe you could draw something in Rhino to illustrate. 3) Again this is not clear. The obvious answer would be that the 'beam' will stop at the end of the curve but you might be asking something else.
While we can draw curves with ease freehand, computers are a bit handicapped in that they require some constraints to draw the curve we desire, since the number of curves that can be drawn from one point to an other is infinite. That’s where the control points come in to picture. They determine the curvature of the desired curve.
1. Draw 3D Polyline through points. 2. Convert said 3D Polyline to a Feature Line. 3. Use "Smooth" Command to make the Feature Line look like the curve it is.
Drawing regular line graphs are pretty straight forward. You just keep doing-addLineToPath (point:) to a Bézier path while iterating through the given points. For this problem I would need a curve instead of a line. I know the UIBezierPath class has these two methods :-
True, what you need is Catmull Rom splines which are guaranted to go through each point. However, I don't know any function in the Android API to draw them. You could also "trick" the quadTo function and pass it a virtual middle point that you compute according to the current point and the next one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With