Surface of Revolution of RationalB-splines Curves expressed analytically

© 2004 Robert Ipanaqué Chero
Peruvian Applied & Computational Mathematical Society (Member), Perú
E-mail: robertchero@hotmail.com

<<RationalBsplines`

pts = {
{0, 0}, {- .1, 2}, { .1, 2.1}, { .5, 
              1.5}, {1, 1.5}, {2, 1.9}, 
{4, 2.5}, {6, 
              1.5}, {7,  .7}, {8,  .7}, {9.4,  .7}, 
{9.5,  .8}, {9.6,  .7}, {10,  .7}, {10,  .6}
} // 
          Rationalize;

c = Curve[pts]

{c} // PiecewiseForm

cc = 
      ParametricPlot[
        c // Evaluate, 
AspectRatio -> Automatic, 
        ImageSize -> {600, 
            Automatic}, 
AxesOrigin -> {0, 
            0}]

Show[
Graphics[{{RGBColor[1, 0, 0], 
            Line[pts]}, 
{RGBColor[0, 0, 1], 
            Point /@ pts}}], 
cc, 
      AspectRatio -> 
        Automatic, 
ImageSize -> {600, Automatic}, 
      AxesOrigin -> {0, 0}
]

s = Revolution[pts]

{s} // PiecewiseForm

ParametricPlot3D[s // Evaluate]

Show[
      Graphics3D[
{EdgeForm[], 
ParametricPlot3D[s // Evaluate, PlotPoints -> 100, 
              DisplayFunction -> Identity][[1]]}
], 
      Boxed -> False, 
      ViewVertical -> {1, 0, 
          0}, 
LightSources -> {
{{1. , 0. , 1. }, 
            RGBColor[1, 0, 0]}, 
{{1. , 0. , 0. }, 
            RGBColor[1, 0.5, 0]}, 
{{5. , 1. , 0. }, 
            RGBColor[0.5, 0.5, 1]}
}]

Show[
      Graphics3D[
{EdgeForm[], 
ParametricPlot3D[s // Evaluate, PlotPoints -> 100, 
              DisplayFunction -> Identity][[1]]}
], 
      Boxed -> False, 
      ViewPoint -> {-2.263,  -2.412,  
          0.713}, 
LightSources -> {
{{1. , 0. , 1. }, 
            RGBColor[1, 0, 0]}, 
{{1. , 0. , 0. }, 
            RGBColor[1, 0.5, 0]}, 
{{5. , 1. , 0. }, 
            RGBColor[0.5, 0.5, 1]}
}]

Show[
      Graphics3D[
{EdgeForm[], 
ParametricPlot3D[s // Evaluate, PlotPoints -> 100, 
              DisplayFunction -> Identity][[1]]}
], 
      Boxed -> False, 
      ViewPoint -> {2.081,  -2.552,  
          0.779}, 
LightSources -> {
{{1. , 0. , 1. }, 
            RGBColor[1, 0, 0]}, 
{{1. , 0. , 0. }, 
            RGBColor[1, 0.5, 0]}, 
{{5. , 1. , 0. }, 
            RGBColor[0.5, 0.5, 1]}
}]

c = 
      RationalCurve[pts, 
        Homogeneous -> {1, 1, 1, 1, 1, 1, 5, 0.2, 0.2, 5, 5, 2, 1, 1, 
              1} // Rationalize]

{c} // PiecewiseForm

cc = 
      ParametricPlot[
        c // Evaluate, 
AspectRatio -> Automatic, 
        ImageSize -> {600, 
            Automatic}, 
AxesOrigin -> {0, 
            0}]

Show[
Graphics[{{RGBColor[1, 0, 0], 
            Line[pts]}, 
{RGBColor[0, 0, 1], 
            Point /@ pts}}], 
cc, 
      AspectRatio -> 
        Automatic, 
ImageSize -> {600, Automatic}, 
      AxesOrigin -> {0, 0}
]

s = 
      RationalRevolution[pts, 
        Homogeneous -> {1, 1, 1, 1, 1, 1, 5, 0.2, 0.2, 5, 5, 2, 1, 1, 
              1} // Rationalize]

{s} // PiecewiseForm

ParametricPlot3D[s // Evaluate]

Show[
      Graphics3D[
{EdgeForm[], 
ParametricPlot3D[s // Evaluate, PlotPoints -> 100, 
              DisplayFunction -> Identity][[1]]}
], 
      Boxed -> False, 
      ViewVertical -> {1, 0, 
          0}, 
LightSources -> {
{{1. , 0. , 1. }, 
            RGBColor[1, 0, 0]}, 
{{1. , 0. , 0. }, 
            RGBColor[1, 0.5, 0]}, 
{{5. , 1. , 0. }, 
            RGBColor[0.5, 0.5, 1]}
}]

Show[
      Graphics3D[
{EdgeForm[], 
ParametricPlot3D[s // Evaluate, PlotPoints -> 100, 
              DisplayFunction -> Identity][[1]]}
], 
      Boxed -> False, 
      ViewPoint -> {-2.263,  -2.412,  
          0.713}, 
LightSources -> {
{{1. , 0. , 1. }, 
            RGBColor[1, 0, 0]}, 
{{1. , 0. , 0. }, 
            RGBColor[1, 0.5, 0]}, 
{{5. , 1. , 0. }, 
            RGBColor[0.5, 0.5, 1]}
}]

Show[
      Graphics3D[
{EdgeForm[], 
ParametricPlot3D[s // Evaluate, PlotPoints -> 100, 
              DisplayFunction -> Identity][[1]]}
], 
      Boxed -> False, 
      ViewPoint -> {2.081,  -2.552,  
          0.779}, 
LightSources -> {
{{1. , 0. , 1. }, 
            RGBColor[1, 0, 0]}, 
{{1. , 0. , 0. }, 
            RGBColor[1, 0.5, 0]}, 
{{5. , 1. , 0. }, 
            RGBColor[0.5, 0.5, 1]}
}]

pts = {
{0, 0, 0}, {1,  .5, 1.2}, {2, 3,  .5}, {2, 
              2, 0.4}
} // Rationalize;

s = Revolution[pts, RevolutionAxis -> {1, 1, 0}]

{s} // PiecewiseForm

ParametricPlot3D[s // Evaluate, 
      ViewPoint -> {2.773,  0.492,  -1.876}]

Show[
      Graphics3D[
{EdgeForm[], 
ParametricPlot3D[s // Evaluate, PlotPoints -> 70, 
              DisplayFunction -> Identity][[1]]}
], 
      Boxed -> False, 
      ViewPoint -> {2.773,  
          0.492,  -1.876}, 
LightSources -> {
{{1. , 0. , 1. }, 
            RGBColor[1, 1, 0]}, 
{{1. , 0. , 0. }, 
            RGBColor[1, 0, 0]}, 
{{5. , 1. , 0. }, 
            RGBColor[0.5, 0.5, 1]}
}]