Message Boards Message Boards

Orthogonal projection of surface

Posted 9 years ago

Hi!

Does anyone know how to build an orthogonal projection of a surface?

points = Table[{i ^ 1 , j + i, ((-1)^(i + j))}, {i, 10}, {j, 10}];
surface = Graphics3D[{BSplineSurface[points], Blue, Point /@ points}]
Show[surface /. 
  Graphics3D[gr_, opts___] :> 
   Graphics3D[
    GeometricTransformation[gr, 
     ScalingTransform[10^-3, {1, 0, 0}, {1, 1, 0}]], opts], 
 Lighting -> Automatic, ImageSize -> Full, Axes -> True, 
 AxesStyle -> Black, ViewPoint -> {-\[Infinity], 0, 0}, Boxed -> True,
  Background -> RGBColor[0.84, 0.92, 1.]
 ]

Is it possible to use transformation matrices or Projection function to build a projection? All I have now is a projection on one axis.

POSTED BY: Victoria Cheng
3 Replies

Thank you all guys, this is pretty much what I wanted.

POSTED BY: Victoria Cheng

You can use the BSplineFunction to generate the interpolation function of the B-spline surface and project it onto either x-z plane or y-z plane. I use the same control points in your original input:

f_Bspline

You can plot the surface with the ParametricPlot3D function. The result should be similar to yours. If you wrap the plot function with Manipulate, you can see the partial plot:

Manipulate[
 ParametricPlot3D[f[u, v], {u, 0, k}, {v, 0, 1}, Mesh -> None, 
  PlotRange -> {{1, 10}, {0, 20}, {-0.5, 0.5}}, 
  BoxRatios -> {1, 2, 0.4}, PlotPoints -> 20],
 {k, 0.005, 1}]

surface

Use the Table function to generate a list of points on the surface and we can find the projection by the following code:

ls = Table[f[k, v], {k, 0, 1, 0.01}, {v, 0, 1, 0.01}];
yzplan = Transpose@Map[{#[[1]], #[[3]]} &, ls, {2}];
xzplan = Map[{#[[2]], #[[3]]} &, ls, {2}]; (* the length is 101*)

Use the Manipulate to show the shadow and its original curve on the B-spline surface:

Manipulate[
 Show[plt1, ListPlot[xzplan[[k]], PlotStyle -> Black]],
 {k, 1, 101, 1}, 
 Initialization :> (plt1 = 
    ListLinePlot[xzplan, PlotRange -> All, 
     PlotStyle -> Directive[Thin, Opacity[0.3]], Filling -> Axis, 
     FillingStyle -> Opacity[0.2]]) ]

res1

Similarly, on the x-z plane we have

Manipulate[
 Show[plt2, ListPlot[yzplan[[k]], PlotStyle -> Black]],
 {k, 1, 101, 1}, 
 Initialization :> (plt2 = 
    ListLinePlot[yzplan, PlotRange -> All, 
     PlotStyle -> Directive[Thin, Opacity[0.3]], Filling -> Axis, 
     FillingStyle -> Opacity[0.2]]) ]

res2

Please find the attached notebook for codes.

Attachments:
POSTED BY: Shenghui Yang

As far as I know one can not get the graphics primitives out of BSplineSurface, i.e. the polygons - because BSplineSurface is seen as a graphics primitive itself. Therefore one can not project its graphics primitives. As long as you stick with BSplineSurface you can rotate the points first and then look from infinity onto the result, e.g.

Clear[points, rPoints]
points = Table[{i^1, j + i, ((-1)^(i + j))}, {i, 10}, {j, 10}];
rPoints = RotationTransform[73 \[Degree], {1., 2., .5}][#] & /@ points;
Graphics3D[{BSplineSurface[rPoints], Blue, Point /@ rPoints}, 
 ViewPoint -> {0, \[Infinity], 0}, PlotRange -> All]

quasi projection

The projection you did is simply

Graphics3D[{BSplineSurface[points], Blue, Point /@ points}, 
 ViewPoint -> {-\[Infinity], 0, 0}, PlotRange -> All]

quasi 1D

at least as long as you do not click into it!

POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract