A guiding net is a matrix whose entries are 3 dimensional vectors. Let's look at a concrete example.
xx={{ {0,0,0}, {0,1,1},{0,2,1},{0,3,1} },
{ {1,0,1}, {1,1,1},{1,2,1},{1,3,1} },
{ {2,0,1}, {2,1,2},{2,2,2},{2,3,1} },
{ {3,0,1}, {3,1,1},{3,2,1},{3,3,2} }};
g1=Graphics3D[
Join[
Flatten[ Table[ Line[ {xx[[i,j]],xx[[i+1,j]] } ],
{i,1,3},{j,1,4} ], 1],
Flatten[ Table[ Line[ {xx[[i,j]],xx[[i,j+1]] } ],
{i,1,4},{j,1,3} ], 1 ]
] ];
Show[ g1, Axes->True, AxesLabel->{"x","y","z"}];
![[Graphics:HTMLFiles/index_1.gif]](HTMLFiles/index_1.gif)
Recall the definitions of Bernstein polynomials.
![]()
![]()
We approximate the above guiding net by Bezier-Bernstein surface.
Q[s_,t_]=Sum[ xx[[i+1,j+1]] BE[3,i][s] BE[3,j][t],
{i,0,3},{j,0,3}] //Simplify
![]()
g2=ParametricPlot3D[ Evaluate[Q[s,t]], {s,0,1},{t,0,1},
DisplayFunction->Identity ];
![]()
![[Graphics:HTMLFiles/index_6.gif]](HTMLFiles/index_6.gif)
![]()
Recall the definitions of B-Splines.
B[1][t_]=Which[ -1<t<0, t+1, 0 <= t <1, -t+1, True, 0];
B[q_][t_]:=1/q ( (t+(q+1)/2) B[q-1][t+1/2] +
((q+1)/2-t) B[q-1][t-1/2] );
For efficiency, we give a shortcut.
![B[2][t_] = Which[ -3/2 < t <= -1/2, t^2/2 + (3 t)/2 + 9/8, <br /> &nbs ... ; -1/2 < t <= 1/2, 3/4 - t^2, 1/2 < t <= 3/2, t^2/2 - (3 t)/2 + 9/8, True, 0] ;](HTMLFiles/index_8.gif)
![]()
![[Graphics:HTMLFiles/index_10.gif]](HTMLFiles/index_10.gif)
![]()
![[Graphics:HTMLFiles/index_12.gif]](HTMLFiles/index_12.gif)
We will approximate a guiding net below.
xx=Table[ {i,j,(10-(i-3)^2 )(j-2)(j-4)(j-6)/200 },
{i,0,7},{j,0,7} ];
g1=Graphics3D[
Join[
Flatten[ Table[ Line[ {xx[[i,j]],xx[[i+1,j]] } ],
{i,1,7},{j,1,8} ], 1],
Flatten[ Table[ Line[ {xx[[i,j]],xx[[i,j+1]] } ],
{i,1,8},{j,1,7} ], 1 ]
] ];
Show[g1, PlotRange->{{-1,8},{-1,8},{-3,2}},
Axes->True,AxesLabel->{"x","y","z"}];
![[Graphics:HTMLFiles/index_13.gif]](HTMLFiles/index_13.gif)
We present a quadratic B-Spline here. "xxx" below incorporates boundary corrections to the data.
xxx[i_, j_]:=xx[[ Which[ i<0, 1, i>7, 8, True, i+1 ],
Which[ j<0, 1, j>7, 8, True, j+1 ] ]];
Q[s_,t_]:=Sum[ xxx[i,j] B[2][s-i]*B[2][t-j],
{i,-2,9},{j,-2,9}]
![]()
![]()
Be patient. The following calculation consumes considarable amount of time. You may have a break with a cup of coffee while the computation is going on.
g2=ParametricPlot3D[ Evaluate[Q[s,t]],
{s,-1,8},{t,-1,8},
DisplayFunction->Identity ];
![]()
![[Graphics:HTMLFiles/index_17.gif]](HTMLFiles/index_17.gif)
P[s_,0]={s, 0, 1/2 Sin[2Pi s] };
P[1,t_]={1, t, 0};
P[s_,1]={s, 1, 1/2 Sin[ Pi s]};
P[0,t_]={0, t, 0};
Q[s_,t_]=P[s,0](1-t) + P[s,1] t + P[0,t](1-s) + P[1,t] s -
P[0,0](1-s)(1-t) - P[0,1](1-s)t -P[1,0]s(1-t) -
P[1,1]s t;
g1=ParametricPlot3D[Evaluate[P[s,0]],
{s,0,1},DisplayFunction->Identity];
g2=ParametricPlot3D[Evaluate[P[s,1]],
{s,0,1},DisplayFunction->Identity];
g3=ParametricPlot3D[Evaluate[P[0,t]],
{t,0,1},DisplayFunction->Identity];
g4=ParametricPlot3D[Evaluate[P[1,t]],
{t,0,1},DisplayFunction->Identity];
Show[ {g1,g2,g3,g4}, ViewPoint->{10,10,10},
DisplayFunction->$DisplayFunction ];
![[Graphics:HTMLFiles/index_18.gif]](HTMLFiles/index_18.gif)
g5=ParametricPlot3D[Evaluate[Q[s,t]],{s,0,1},{t,0,1},
DisplayFunction->Identity ];
Show[g5, ViewPoint->{10,10,10},
DisplayFunction->$DisplayFunction ];
![[Graphics:HTMLFiles/index_19.gif]](HTMLFiles/index_19.gif)
The above example is the simplest case of Coons interpolation, linear Coons' Patch.
Converted by Mathematica (June 3, 2003)