Quoting Kevin Wixson <

[hidden email]>:

> PS.. Some people have also asked for clarification about the

> drawing of the Bezier curve formula I'm requesting. What I'm

> actually interested in is the representation I saw when my

> college instructor drew it on the board. It had a big Greek

> symbol in it with vector symbols (the arrows) and bits above

> and below and I'm not sure what all else, but it's something

> that isn't done with the normal ASCII characters in a row.

> I don't precisely know what it's made up of or how to describe

> it or else I certainly would have made it by myself. But since

> I don't know how, I'm asking for help.

Hmm. I'm not sure how to depict this.

If you have something handy to render TeX, this TeX fragment will

render the general form of the parametric bezier curve function:

B(t) = \sum_{k=0}^N {P_k}{N! \over k!(N - k)!}{t^k}(1 - t)^{N-k}

N is one less than the number of control points; the control points

are named P_0 through P_N, and t is the position along the curve

(ranging from 0.0 through 1.0).

That's the ultra-generic form, though. In Inkscape, we pretty much

only deal with cubic beziers (four control points), which means

N=3. With N=3, the above simplifies to:

B(t) = {P_0}(1 - t)^3 + {P_1}3{t}(1 - t)^2 + {P_2}3{t^2}(1 - t) +

{P_3}{t^3}

In practical graphics programming, this is often reformulated as a

simple cubic equation with appropriate coefficients:

\begin{matrix} B(t) & = & {C_2}t^3 + {C_1}t^2 + {C_0}t + P_0

\mbox{ where} \\

\quad C_0 & = & 3(P_1 - P_0) \\

\quad C_1 & = & 3(P_2 - P_1) - C_0 \\

\quad C_2 & = & P_3 - P_0 - C_0 - C_1 \end{matrix}

(math-heads will have to forgive my clumsy TeX; this is not my

field)

This last one isn't as sexy looking, but it's what we actually use,

more or less. The first and last of the four control points

correspond to path nodes, and the second and third correspond to

control handles. Multi-node curves actually just place these cubic

curves end-to-end so they share starting and ending points.

You may also be interested in De Casteljau's algorithm, which is

what makes Beziers so convenient for computers to work with. It

also looks cool when illustrated graphically.

(De Casteljau basically just means that you can pick an arbitrary t

-- 0.5 is typical -- and subdivide the bezier at that point to

produce two smaller, flatter curves of the same degree which fit

together to make the original curve. Do this enough times and you

can just draw the flattish beziers as straight line segments. Very

easy way for computers to draw them. The algorithm has other handy

uses too.)

(Actually, you can see De Casteljau in action by selecting two

adjacent nodes in Inkscape and hitting the "insert node" button

repeatedly to subdivide. It's the algorithm used to find those

subdivisions.)

I probably won't have time to do up SVG versions of these myself, so

if someone else wants to take a stab at it, they're welcome to do

so...

-mental

-------------------------------------------------------

This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput

a projector? How fast can you ride your desk chair down the office luge track?

If you want to score the big prize, get to know the little guy.

Play to win an NEC 61" plasma display:

http://www.necitguy.com/?r
_______________________________________________

Inkscape-devel mailing list

[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel