Suzan Cioc
Suzan Cioc

Reputation: 30107

How to describe fat curve (curved line of variable thickness)?

I know how to describe curved line of constant thickness (with Bezier or similar models).

Are there any common models of curved line with variable thickness?

I am imagining some similar things like in Bezier. For example, each node can contain thickness value and it's weight, so renderer would interpolate thickness along curve.

Is there some implementations and/or descriptions?

UPDATE

More precisely the question is follows.

Suppose we have cubic Bezier segment, controlled by 4 points ABCD

enter image description here

In Bezier, the longer we have vector, say AB, then the longer curve follows AB direction. On the picture above, we have raltively long following.

So, I want thikness behave synchronously with control nodes B and C. If AB and CD is long, then thinkness should follow end nodes thinkness long and change to another thickness fast, like below

enter image description here

and if control vectors are short, then thinkness should smoothly change from one to another, like below

enter image description here

Upvotes: 2

Views: 1246

Answers (2)

If you want to use a "disc based" approach, you need to draw circles around every control point, then find the points on those circles that represent the "offset" (normal to the tangent, for on-curve points, normal to the tangent of the projection for off-curve points). You then plug those new points into the Bezier functions to get your "offset curve".

Curve offsetting, in your case with variable width, is essentially the trick of finding an outline rather than a single curve. For Bezier curves you can find a full explanation over at http://pomax.github.io/bezierinfo/#offsetting, with the variable width explanation over at http://pomax.github.io/bezierinfo/#offsetting (you're interested in the latter, but you need to understand the basics before you look at the special case =)

Upvotes: 0

lhf
lhf

Reputation: 72312

Metafont and its successor MetaPost support variable thickness in the form of shaped pens.

See also

L.M. Mestetskii, Fat curves and representation of planar figures, Computers & Graphics, 24:1 (2000) 9-21 doi: 10.1016/S0097-8493(99)00133-8

Upvotes: 1

Related Questions