views:

77

answers:

1

I am attempting to create a PathGeometry that approximates a series of orthogonal line segments using cubic bezier curves in Wpf. I came across an article on msdn that describes Cardinal Splines in GDI+, which is almost exactly what I wish to accomplish.

I have, for the most part succeeded, but I now need to implement a property which controls the "smoothness" of the curve, like the tension property described in the above article. The article states that a value of 1.0 for the tension results in a "path of least total bend".

What does this mean for the control points of the cubic bezier curve? Where would they be placed relative to the endpoints in order to achieve this effect?

Note: Since the line segments are orthogonal, the angle between two consecutive segments is always 90 degrees. I'm not sure if that simplifies anything.

Here is an image from the article for easy reference. The red squares indicate end points and the numbers indicate the tension, though I am most interested in values from 0.0 to 1.0 inclusive. alt text

A: 

Look at this reference for normal tension. link: Asymptote Documentation - Beziers

Apperently the line connecting the midpoints of the control lines has to be tangent to the curve.

jalexiou
So, at a tension of 1.0, the control points should be the first and second order midpoints of the combined bezier curves (referencing the diagram in the link)?
Aviv B.