0

Suppose I have these control points in Inkscape

I want to draw two curves, one is a quadratic bezier curve, the other is a cubic bezier curve.

We know they are:

q=(1-t)^2 * p0 + 2 * t * (1-t) * p1 + t^2 * p2

c=(1-t)^3 * p0 + 3 * t * (1-t)^2 * p1 + 3 * (1-t) * t^2 * p2 + t^3 p3

I used the Inkscape bezier tool, but the curve doesn't seem to be the one I want. Does any one know how to draw these two curves precisely?

0

1 Answer 1

4

Pretty much all curves in Inkscape are basically cubic Bezier curves. For your example with the four points, first make sure your Bezier tool is set to 'Create regular Bezier path' (Mode Button in toolbar) and add a line connecting P0 to P3:

Example from question with simple line connecting P0 and P3

Then shift-drag the nodes with the node-tool, adding handles to them, and drag those to points P1 and P2 on each side:

Example from above with handles put on control points P1 and P2

As for quadratic curves, I don't think there is an easy way to draw them with Inkscape's drawing tools (there is a BSpline-mode, but that's not quite the same). However, you can use the 'Edit → XML Editor...' to manually edit the path-data in the d-attribute, entering your coordinates and using the 'q/Q' commands:

Creating a qubic curve using the XML-editor

In this example, the m 100,80 part is the coordinates of P0, then Q 222,106 for P1 and the last pair (311,-31) is P2.

By the way, this method also lets you directly specify cubic curves with the 'c/C' commands (e.g. something like m 100,50 C 150,50 150,200 50,200).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.