Cubic B-splines for type design.

Belleve InvisBelleve Invis Posts: 269
edited May 2018 in Technique and Theory
I am curious about that, are there any attempts about using cubic B-splines as the extended form of cubic Bezier curves?
The advantages of B-splines are:
  • Converting cubic B-splines down to Bezier curves is lossless (Boehm's algorithm).
  • Four-point cubic B-splines with knot interval [0, 1, 0] is identical to one segment of cubic Bezier curve.
  • Algorithms for handling cubic B-splines are well-studied (de-Boor, etc).
  • B-splines preserves C2 continuity, it could prevent kinks when interpolation.

Comments

  • ivan louetteivan louette Posts: 327
    It's implemented in Inkscape and very useful to draw organic shapes. I use it at the first stages of drawing my font Geranium and convert to Bézier afterwards because there is no solution to put extremas when working with B-splines.
  • Belleve InvisBelleve Invis Posts: 269
    It's implemented in Inkscape and very useful to draw organic shapes. I use it at the first stages of drawing my font Geranium and convert to Bézier afterwards because there is no solution to put extremas when working with B-splines.
    Actually, the algorithm is present since B-splines are just a constrained form of Bezier curves. You could find the Knot values and use de Boor algorithm to cut it.
  • Ori Ben-DorOri Ben-Dor Posts: 383
    Never heard of B-splines before, so I just watched a short video about the B-splines tool in Inkspace.

    My first impression is that it's good for drawing smooth paths, but at the expense of precise & intuitive control, since there are no on curve nodes (ignoring cusps) which are probably the easiest way to force the path to pass through certain points.

    I'm wondering what the approach to drawing precise shapes with B-splines should be. Do you know of any resources?
  • ivan louetteivan louette Posts: 327
    You can have cusps if you hold down Shift while clicking.
  • Ori Ben-DorOri Ben-Dor Posts: 383
    Yeah, saw that in the video, but what if you don't want cusps? Consider something like a rounded S. Wouldn't it be hard to control its shape precisely (the precise width at certain points, the precise amount of overshoot, etc.) using B-slpines?
  • ivan louetteivan louette Posts: 327
    edited May 2018
    You are right, precision assistants for B-splines remain to be invented at the moment. But nevertheless they are very interesting for organic and purely visual design. Sometimes I use them also to rebuilt a curve drawn with Béziers which lacks of fluidity : I draw a spline on top of it, convert this new curve to Béziers and incorporate it to my previous design. I know that some programs do this kind of enhancements automatically but this is the only tool I have in Inkscape to do that (except perhaps the spiro-splines which are a little bit more difficult to manage for my taste and generate too much knots when converted to Bézier).
  • Belleve InvisBelleve Invis Posts: 269

    So I made a little example using the techniques in the papers I posted yesterday. All these six shapes have the exact same control points (a square) but with different corner and edge "interval" assignments. In our conversion, each non-zero corner is converted into a quadratic Bezier curve arc, and each non-zero edge is converted into a cubic Bezier arc. Example 2 zeroes all the corner intervals to produce cubic B-splines. Example 3 zeroes all the edge intervals to produce a TrueType curve (quadratic B-spline).

    CODE = https://gist.github.com/be5invis/48ff85b838f1a4904aebc575fbde3b83
  • Belleve InvisBelleve Invis Posts: 269
    Here is a more direct B-spline-to-Bezier conversion that directly maps the control points to Bezier points. Note that, the Bezier points are a linear combination of B-spline control points and the coefficients are only connected with the knot intervals.

    https://gist.github.com/be5invis/828d247819ddebe1dc3ba483b89cc533

  • Belleve InvisBelleve Invis Posts: 269
    Yeah, saw that in the video, but what if you don't want cusps? Consider something like a rounded S. Wouldn't it be hard to control its shape precisely (the precise width at certain points, the precise amount of overshoot, etc.) using B-slpines?
    A control edge with knot interval 0 would force it to be a tangent of the curve. To form a cusp you need two meeting 0-edges.
Sign In or Register to comment.