Curves Fractals
Curves Fractals
1
5.Variation property:- The mathematical representation for curve
should be applied to the selected curve & not cross arbitrarily
chosen straight line more often than a sequence of lines that
connect the knot point
2
Arc Generation With-DDA
The differential equation for the arc co-ordinates can be written in
terms of an angle Ø as follows
X=Rcos Ø + x0 & y=Rsin Ø + y0------------equ1
Where
(x0, y0)is the center of curvature & R is the arc radius.
3
This equn. forms the basis for an arc generation algorithm. To
have smooth curve, the neighboring points on the arc should be
close to each other.
To achieve this, the value of dØ should be small enough not to
leave gaps in the arc. So can be determined as
dØ=min[0.01,1/3.2 x (|x-x0| + |y-y0|)]
Algorithm step:-
1.Read the center of a curvature, say(x0,y0)
2.Read the arc angle, say Ø
3.Read the straight point of the arc, say(x,y).
4.Calculate dØ as dØ=min[0.01,1/3.2 x (|x-x0| + |y-y0|)]
5.Initialise Angle=0
6.while(Angle<0)
do{
plot(x,y)
X=x-(y-y0) dØ & Y=y+(x-xo) dØ Angle=Angle + dØ }
7.STOP
4
Interpolation
Interpolation deals with complex curves which have no direct
mathematical function. Such curves can be designed using
approximation methods.
If set of sample points lie on the required curve, then draw the
required curve by filling portion of the curve with the piece of
known curves which pass through nearby sample points.
The gap between the sample points can be filled by finding the
co-ordinates of the points along with the known approximating
curve & connecting these points with line segment.
5
We have to draw the curve by determining the intermediate
points between the known sample points. This can be achieved
using interpolation technique.
fx(u)= Σxi Bi(u) fy(u)= Σyi Bi(u) & fz(u)= Σzi Bi(u) Σfrom i=1 to n.
The function Bi(u) are called Blending functions. For each value
of u, the blending function determines which ith sample point
affects the position of the curve.
The function Bi(u) tells how hard the ith sample point is pulling. If
for some value of u, Bi(u)=1 & for each j!=I, Bi(u)=0, then ith
sample point has complete control of the curve.
The curve will pass through ith sample point. Create a blending
function for which the sample points(x1,y1,z1) have complete
control when u=-1,2nd when u=0, 3rd when u=1 & so on..
6
Blending function required is
B1(u)=1 at u=-1
B1(u) at u=0,1,2,3…n-2
so an expression is 0 at:
u(u-1)(u-2)…[u-(n-2)]
at u=-1,it is (-1)(-2)(-3)….(1-n)
7
For four sample points,4blending functions are required
B1(u)=u(u-1)(u-2) / (-1)(-2)(-3)
B2(u)=(u+1)(u-1)(u-2)/ 1(-1)(-2)
B3(u)=(u+1)u(u-2)/ 2(1)(-1)
B4(u)=(u+1)u(u-1)/3(2)(1)
8
Approximation
To approximate a curve between 2nd & 3rd sample points by 3
straight line segments, there are number of sample points values
at u=0 & u=1. Use equation to calculate points at u=1/3 & 2/3.
9
Interpolation Algorithm
Step1:- Get the sample point.
Step2:-get the intermediate value of u to determine intermediate
points.
Step3:- Calculate the blending function values for middle section
of the curve.
Step4:- Calculate blending function values for the 1st section of
the curve.
Step5:- Calculate blending function values for the last section of
the curve.
Step6:- multiply the sample points by blending function to give an
approximation curve.
Step7:-Connect the neighboring points using straight line
segments.
Step8:-STOP
10
B-spline curve
The lagrange interpolation program produces various
inadequacies. In this method, the sum of the blending function is
not 1 at every value of u.
It is not necessary that the slope of the two sections match at this
point. Thus, it doesn’t result in a completely smooth curve, if
there are corners at the sample point. The control of the curve
depends on u.
To get the smooth control over the curve, the curve must be
pulled onto the neighborhood of sample point rather than force it
to go through the point. The result will be a curve which follows
the general contours indicated by the sample points, but may not
actually pass through the points.
11
A set of blending functions which follows the above approach
and always sum to 1 is referred as B- spline.
For the middle of the curve, the cubic B-spline functions are:
B1(u)=(1-u3 )/6
B2(u)=u3 /(2-u2 )+2/3
B3(u)= -u3 /(2+u2 ) / (2+u2 )/ (2+u)/2+1/6
B4(u)=u3 /6 (Fig5-8 q13)
12
Features of B-spline curve
It contains the Bernstein basis as a special case. The B-spline
basis is non-global
The B-spline basis also allows the order of the basis function &
hence the degree of the resulting curve is independent on the
number of vertices.
13