Graphics Reference
In-Depth Information
begin
μ 2= μ 2
1; kr = k
r ; tj = t ( j + kr );
for i = μ, μ
1 ,
···
2
begin
d 1= tj
τ ( i ); d 2= τ ( i + kr )
tj ;
P [ r +1]
i
=( P [ r ]
i
d 1+ P [ r ]
i− 1
d 2) / ( d 1+ d 2)
end
end
end
Step 4: d ( j )= P [ k ]
μ
Since τ μ μ +1 , we must always have d 1+ d 2 > 0. Also, k, j, μ, τ i and t j
are exactly the same as in Algorithm 1.
7.3 Subdivision of Control Polygon
Subdivision of a control polygon helps to refine a curve or a surface. Subdi-
vision basically is to introduce new control points. The refinement or modifi-
cation, so achieved, enhances the curve or surface accuracy in visualization.
This section examines the Oslo algorithm to insert new control points. We use
algorithm 2 for this purpose.
Input :
Total number of vertices in the original polygon = N.
Vertices of the original polygon in planar or spatial coordinates,
P =( P (0) ,P (1) ,
,P ( N ). Order of the B-spline curve = K.
Knot vector in the original polygon is Tau =( Tau (0) ,Tau (1) ,
···
···
,Tau ( N +
K ).
Refinement knot vector T =( T (0) ,T (1) ,
···
,T ( N ) for a particular applica-
tion, Q
N + K .
Output :
Vertices D =( D (0) ,D (1) ,
···
,D ( Q
K )= D of the subdivided polygon for
the same curve.
Pseudo code for the algorithm is as follows.
procedure loop (K,N,Q,P,Tau,T,D)
begin
for j=0 to (Q-K)do
begin
find (K+N,Tau,T,j,Mu);
subdiv (P,K,Tau,T,K,Mu,j,D(j));
end
end
procedure find (KN,Tau,T,j,Mu);
/* this routine finds the unique Mu */
/* so that Tau(MU)
T(j) < Tau(MU+1) */
Search WWH ::




Custom Search