1
$\begingroup$

What are pieces or sections in Bezier curves?

Specifically I'm doing this computer assignment:
https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-837-computer-graphics-fall-2012/assignments/MIT6_837F12_assn1.pdf

Where in the given code the comment says:

    // You should implement this function so that it returns a Curve
    // (e.g., a vector< CurvePoint >).  The variable "steps" tells you
    // the number of points to generate on each piece of the spline.
    // At least, that's how the sample solution is implemented and how
    // the SWP files are written.  But you are free to interpret this
    // variable however you want, so long as you can control the
    // "resolution" of the discretized spline curve with it.

So what does the sentence

The variable "steps" tells you the number of points to generate on each piece of the spline.

Mean visually?

1 Answers 1

1

You're drawing a cubic spline curve. A cubic spline is a sequence of cubic Bezier curves, joined end-to-end. So, the Bezier curves are the "pieces" of the spline curve. You're supposed to draw each Bezier curve by drawing a series of straight lines (a polyline) connecting points that you have computed on the curve. In other words, your code will "step" along the curve, drawing straight lines between successive points. I assume that there is an integer variable named steps in the sample code. This represents the number of steps you take on each Bezier curve (i.e. how many straight lines you draw).