Surface design (Lec 12)

yukita@k.hosei.ac.jp

•Guiding Nets

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]

•Bezier-Bernstein surface

Recall the definitions of Bernstein polynomials.

BE[n_, k_][x_] = Binomial[n, k] x^k (1 - x)^(n - k)

(1 - x)^(-k + n) x^k Binomial[n, k]

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

{3 s, 3 t, -3 s (-1 + t)^3 + t (3 - 3 t + t^2) + s^3 (1 - 12 t + 12 t^2) + 3 s^2 (-1 + 6 t - 6 t^2 + t^3)}

g2=ParametricPlot3D[ Evaluate[Q[s,t]], {s,0,1},{t,0,1},
                     DisplayFunction->Identity ];

Show[{g1, g2}, PlotRange -> {{-0.5, 3.5}, {-0.5, 3.5}, {-0.5, 3.5}}, DisplayFunction -> $DisplayFunction]

[Graphics:HTMLFiles/index_6.gif]

-Graphics3D -

•Bezier-B-Spline approximation

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] ;

Plot[ B[2][t], {t, -2, 2}] ;

[Graphics:HTMLFiles/index_10.gif]

Plot3D[B[2][s] * B[2][t], {s, -2, 2}, {t, -2, 2}, <br /> PlotPoints -> 30, PlotRange -> {0, 3/4}] ;

[Graphics: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]

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}]

Q[-4, -3]

{0, 0, 0}

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 ];

Show[g2, DisplayFunction -> $DisplayFunction, PlotRange -> {{-1, 8}, {-1, 8}, {-3, 2}}] ;

[Graphics:HTMLFiles/index_17.gif]

•Interpolating a contour

•Coons surfaces

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]

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]

The above example is the simplest case of Coons interpolation,  linear Coons' Patch.


Converted by Mathematica  (June 3, 2003)