In one of the maths blogs I follow I stumbled upon the following question:

The bottom, side, and front views of an object are shown below: enter image description here

How would the object look in three dimensions?

My question
Is it possible to use these views and construct a 3d body out of them that you can then turn in space with Mathematica?

  • 7
    $\begingroup$ This question doesn't show any effort to solve the problem in Mathematica. $\endgroup$
    – Artes
    Commented Mar 17, 2014 at 10:26
  • 2
    $\begingroup$ Some pretty good (if advanced) stuff by Michael Trott here $\endgroup$
    – Yves Klett
    Commented Mar 17, 2014 at 10:28
  • $\begingroup$ @Artes: This is indeed true. The challenge for me is that I normally don't use Mathematica for graphics stuff and thought this a good opportunity to get a cold start. To cut a long story short: I don't have a clue where to start but obviously the task is not so trivial after all... what a pity, but thank you anyway. $\endgroup$
    – vonjd
    Commented Mar 17, 2014 at 10:45
  • 3
    $\begingroup$ I don't think the provided constraints are sufficent to fully determine the shape, but a shape that is consistent with them is found easily. It is a stack of ellipses with major axis determined by the width of the rectangle and the minor axis (at every height) determined by the triangle. With this information you should be able to build the shape using ParametricPlot3D. $\endgroup$ Commented Mar 17, 2014 at 11:50
  • 2
    $\begingroup$ Note carefully that the problem as you have posed it is very far from having a complete solution. This is showcased by the two answers already present, but you could also e.g. punch a diagonal hole in both of them without changing the projections. In general, you'll need a view from an infinity of angles. This isn't quite a tomography problem, but you may find the spirit of the Radon transform useful to read about. $\endgroup$ Commented Mar 17, 2014 at 15:12

2 Answers 2


Let's say we have the following 3 shapes.

An isosceles triangle with base and height $(b, h)$ centered at $(x_0,z_0)$,

The shape is given by 3 equations:

$$z > z_0- h/2$$ $$ z < 2 h /b (x- (x_0-b/2)) +(z_0 -h/2) $$ $$ z < -( 2 h /b (x- (x_0-b/2))) -2 h -(z_0 -h/2) $$

with a rectangle with width and height set by the triangle $(b,h)$ and centered at $(y_0,z_0)$ with the following equations:

$$ y_0-b/2<y<y_0 +b/2 $$ $$ z_0 -h/2<z<z_0 +h/2 $$

And a disk with center and radius given by $((x_0,y_0),b/2)$ with its equation given by

$$ (x-x_0)^2+(y-y_0)^2 < (b/2)^2 $$

We can then simply place these equations in RegionPlot3D Using the center as:

{cx,cy,cz}= {0.5,0.5,0.5};

and the base and height of the triangle to be


We obtain the following result

RegionPlot3D[(x - cx)^2 + (y - cx)^2 < (b/2)^2 && 
(z > cz - h/2 && (z < (2 h/b (x - (cx - b/2) )) + (cz - h/2) && 
  z < -(2 h/b (x - (cx - b/2)) - 2*h - (cz - h/2))))&&(
  cy-b/2<y<cy+b/2 &&cz-h/2<z<cz+h/2), 
 {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, PlotPoints -> 100];

enter image description here

This should allow you to easily check other possible solutions, if they exist

  • 1
    $\begingroup$ nice clear answer +1: more thoughtful than my impulse :)...also proves not unique as many commenters have observed $\endgroup$
    – ubpdqn
    Commented Mar 17, 2014 at 13:32
  • $\begingroup$ When I use it as it stands I get nothing and when I take the last semicolon away I get an empty cube?!? What am I doing wrong? $\endgroup$
    – vonjd
    Commented Mar 17, 2014 at 14:37
  • $\begingroup$ @vonjd I fixed a typo in the mathematica equation, I had the radius for the circle part as r, instead of b/2, so it wasn't defined. If you find any more mistakes let me know. $\endgroup$
    – lalmei
    Commented Mar 17, 2014 at 15:17
  • $\begingroup$ Now it works! Thank you, great work! $\endgroup$
    – vonjd
    Commented Mar 17, 2014 at 15:29

I post this as for this particular "puzzle" there is a straightforward approach. However, as has been commented some evidence of attempt is the norm.

triang[x_, y_] := {{x, 0, 1}, {x, -y, 0}, {x, y, 0}}

Now visualizing for this particular isoceles triangle.

   Table[triang[j, Sqrt[1 - j^2]], {j, -1, 1, 0.005}]], 
  Polygon[Table[{Cos[t], Sin[t], -1}, {t, 0, 2 Pi , 0.001}]], 
  Polygon[{{2, -1, 0}, {2, 1, 0}, {2, 0, 1}}], 
  Polygon[{{-1, -2, 0}, {1, -2, 0}, {1, -2, 1}, {-1, -2, 1}}]}, 
 Boxed -> False, PlotRange -> All]

enter image description here

  • $\begingroup$ That's just... bad-ass work! +! $\endgroup$
    – ciao
    Commented Mar 17, 2014 at 12:17
  • 1
    $\begingroup$ @rasher very kind: inspired by art gallery: (fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-prn2/t1.0-9/…) this scuplture was made with Staedtler pencils. $\endgroup$
    – ubpdqn
    Commented Mar 17, 2014 at 12:34
  • 1
    $\begingroup$ nice! It is important to note the solution is certainly not unique. Indeed we could just combine the three polygons and get those silhouettes. $\endgroup$
    – george2079
    Commented Mar 17, 2014 at 12:40
  • 1
    $\begingroup$ @george2079 yes...just the solution that sprang to mind...could not resist posting it $\endgroup$
    – ubpdqn
    Commented Mar 17, 2014 at 12:42
  • $\begingroup$ Nice work! Seems like SphericalRegion -> True could do some magic though... $\endgroup$ Commented Mar 17, 2014 at 13:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.