2

So I have a body defined in a coordinate system and I project this body to the XY plane. How do I find the boundary of the projected shape? Which theory is this topic related to? Is there any paper/book that I can look at?

For simplicity sake, let us just consider convex body at the moment.

Thanks in advance, Steph

1 Answers1

2

Let $f(x,y,z)=0$ be an implicit equation of the surface of the body. In order to get an implicit equation of its shadow on $x0y$ plane, it suffices to eliminate $z$ in the following system of equations :

$$\begin{cases}f(x,y,z)&=&0& \ \ \ \ (a)\\\dfrac{\partial f}{\partial z}(x,y,z)&=&0& \ \ \ \ (b)\end{cases}\tag{1}$$

This is rather intuitive. As the gradient in $(x,y,z)$, which is the normal vector to the surface at this point, has the following components :

$$\left(\dfrac{\partial f}{\partial x},\dfrac{\partial f}{\partial y},\dfrac{\partial f}{\partial z}\right),$$

imposing condition (1)b means that we select points belonging to the surface (condition (1)a) that have horizontal gradients (condition (1)b), thus are "eligible" for being projected onto a "shadow boundary" point.

For a detailed, more rigorous explanation, see the answer I made (just some days ago...) to this question : Is there a geometrical explanation for a method using critical points in a multivariable context which was in substance : "I have seen a text where they use (1), what does it mean geometricaly ?".

Remarks : 1) This method is not limited to convex bodies, but the boundaries obtained for non convex bodies may deserve interpretation...

2) This method is for smooth surfaces. When the surface is obtained by "gluing" surfaces as is the case for a cylinder with its lateral, top and bottom parts, a different treatment is possible.

Edit : You said you are interested by the particular case of the shadow of a real cylinder (the piece of a vertical cylinder between two planes $z\pm h/2$ that is rotated, then projected in any position onto the xOy plane). Here is a Matlab program that performs the operation ; I have assumed that the projection has been done on the xOy plane.

I have considered a general ellipse parametrized in the following way

$$\begin{pmatrix}x\\y\end{pmatrix}=\underbrace{\begin{pmatrix}\cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\end{pmatrix}}_R\begin{pmatrix}a\cos t\\ b\sin t\end{pmatrix}$$

This program is based on the obtention of the particular values $t=t_0$ and $t=t_0+\pi$ such that the tangent vector to this ellipse

$$\begin{pmatrix}x'\\y'\end{pmatrix}=\begin{pmatrix}\cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\end{pmatrix}\begin{pmatrix}-a\sin t\\ b\cos t\end{pmatrix}$$

is proportional to the displacement vector , i.e., has the same polar angle (line 6 in the program).

clear all;close all;hold on;grid on;axis equal;
a=rand;b=rand;
th=rand*pi/2;c=cos(th);s=sin(th);R=[c,-s;s,c];% (fixed) rotation matrix
sg=2*(rand>0.5)-1;dx=3*rand;dy=3*rand;% shift components in x and y
plot([-sg*dx,sg*dx],[-dy,dy],'r');% axis
V=diag([1/a,1/b])*inv(R)*[dx;dy];% tgt vector prop. to transl. vector
t0=atan(-V(1)/V(2));% decision value of parameter t for transl. or not
if t0<0;t0=pi+t0;end;% transform any neg. angle into its suppl. 
t=0:pi/200:2*pi;
si=ones(1,length(t)).*(t>t0).*(t<(pi+t0));si=1-2*si;% if  t0<t<t0+pi first half ellipse
V=R*[a*cos(t);b*sin(t)];% rotated ellipse by angle th
plot(sg*(V(1,:)-dx*si),V(2,:)-dy*si,'g');% hidden contour
plot(sg*(V(1,:)+dx*si),V(2,:)+dy*si,'b');% visible contour

enter image description here

Fig. 1 : Visible contour is blue.

Jean Marie
  • 81,803
  • Thank you for the reply.

    I have another thought: The above equations are similar to finding the silhouette of the face of the solid along the projection direction. So we have N*L=0, where N is the normal of the face and L is the projection direction vector, in this case, L being (0,0,1).

    But how do I deal with special cases when the body has planar faces? An example is that when a tilted cylinder is projected onto the XY plane. The bottom/top face contribute to the profile of the projection but I cannot find these by using the silhouette function

    – Steph Fong Feb 02 '19 at 02:38
  • @Steph Fong You are perfectly right : see "Remark 2" I have added to my text. – Jean Marie Feb 02 '19 at 08:19
  • Thank you again for the reply. I want to find an analytical solution if possible. I think if the edge of the original planar surface can be described analytically, we can project the edges on the plane to find the profile of the projection. In our tilted cylinder case, the top/bottom face is a circle and the projected shaped is an ellipse. The caveat is that there's only part of that ellipse contributing the projection profile because some parts of the ellipse lie inside the projected shape. Is there any literature on deciding which part of the edge contributes to the profile? – Steph Fong Feb 03 '19 at 21:30
  • You are right. The situation is not that bad. I would say planar surfaces shouldn't be a problem ; then there is hope for surfaces that are "ruled surfaces" (cylinders, hyperbolic paraboloids, hyperboloid with two sheets and many others). Literature : I would recommand the book "Computational Line Geometry" (H. Pottmann, J. Wallner) Springer, 2001, where they work on what they call "silhouettes" especially with the unifying view of ruled surfaces. – Jean Marie Feb 03 '19 at 21:51
  • Thank you for the kind reply and your information. I would like to clarify what I want to know at the moment. As it is said, for the tilted cylinder case, there's only part of projected edges from the top/bottom face contributing to the projection profile. I would like to know what theory/method can be used to determine which part of the projected edges lie inside the projected shape. This way, I can eliminate those parts. – Steph Fong Feb 03 '19 at 22:41
  • You mean that you are interested mainly by a classical the projection at any angle of a circular cylinder with circular bottom and top orthogonal to the generatrix lines of the cylinder. In this special case, I see a not complicated solution based on the fact that we can do exact computations on ellipses . Could you confirm this ? In that case, I think the best would be to ask a new question, because the method I am thinking to is very specific ; I will answer you tomorrow (it's12:00 pm in Europe). – Jean Marie Feb 03 '19 at 22:57
  • Thank you for the reply. Yes, I use the spherical coordinates angles. – Steph Fong Feb 05 '19 at 15:09
  • See the Edit in my answer. – Jean Marie Feb 05 '19 at 22:54
  • I have improved (so I think...) my answer, making in in particular the most general possible. – Jean Marie Feb 06 '19 at 07:30