holger wrote on Sep 1st, 2009, 3:21am:in most standard vector software, to draw a single line just with several points...
I can only guess, but I strongly suspect they just hide the fact there are several Bézier lines by treating them as a whole. But in general, you can click in the middle of a complex curve, on a node, and decide there will be a sharp angle there (tangents are no longer aligned) or even separate them.
Quote:unfortunately the bezier helper file doesn't show up anything
It doesn't do magic. If you look at the code, you will see I used my helper functions (of same names, but with an initial capital, per my old habit) instead of Processing's ones (which are used internally, of course). Beside, as I said above (in a clumsy way), I use bezierVertex() instead of bezier(), as it is easier to chain them.
I drew a heart (which I animated) as one of my first Processing sketches, not sure if I ever shown it in this forum.
The heart (sic...) of the sketch is:
Code: beginShape();
// The heart, symmetrical around vertical axis
// Anchor point (highest sharp point)
vertex(m_x, m_y);
// Top left part
bezierVertex(
m_x, m_y - m_topVectorLen, // Upward control vector
m_x - m_size, m_y - m_topVectorLen, // Idem
m_x - m_size, m_y);
// Bottom left part
bezierVertex(
m_x - m_size, m_y + m_topVectorLen, // Downward control vector
m_x - m_bottomVector_dx, m_y + m_bottomLen - m_bottomVector_dy,
m_x, m_y + m_bottomLen);
// Bottom right part
bezierVertex(
m_x + m_bottomVector_dx, m_y + m_bottomLen - m_bottomVector_dy,
m_x + m_size, m_y + m_topVectorLen, // Downward control vector
m_x + m_size, m_y);
// Top right part
bezierVertex(
m_x + m_size, m_y - m_topVectorLen, // Upward control vector
m_x, m_y - m_topVectorLen, // Idem
m_x, m_y);
endShape();
As you can see, I heavily parametrized it to allow easy customizations. The tangents here are either horizontal or vertical, so aligning them was quite easy.