11
$\begingroup$

Is it possible to use Graphics3D to somehow reproduce Penrose stairs or impossible staircase?

enter image description here

It would be nice to get to the original as close as possible. Here is my start which is not right, - not only due to wrong angle of sight but also the discontinuity in one wrong corner. Is it even possible and are there other approaches?

steps = {
  {0, 0, 1}, {1, 0, 2}, {2, 0, 3}, {3, 0, 4}, 
  {3, 1, 5}, {3, 2, 6}, {3, 3, 7}, 
  {2, 3, 8}, {1, 3, 9}, {0, 3, 10}, 
  {0, 2, 11}, {0, 1, 12}
};

Graphics3D[{
  GrayLevel[0.85], 
  EdgeForm[AbsoluteThickness[1.5]],
  Map[
   Cuboid[{#[[1]], #[[2]], 0}, {#[[1]] + 1, #[[2]] + 1, #[[3]]}] &,
   steps
  ]
 },
 ViewPoint -> {15, 17, 172},
 ViewVertical -> {0, 0, 1},
 Boxed -> False,
 Lighting -> "Neutral"
]

enter image description here

$\endgroup$
0

2 Answers 2

17
$\begingroup$
  • We set the viewpoint to be ViewPoint -> {1, -1,1} and use the Orthographic,then all the faces of the cube is diamond shape( the angle is 60 degree and 120 degree)
  • When we set the length of the sides of the diamond shape is equal to 1, then we found that the difference of the height of cubes should be satisfies the equation

enter image description here enter image description here

(6-1)*1-2(6-1)h==2*1+4*h

5*1-10*h==2*1+4*h

that is h should be 3/14.

  • We remove the last cuboid of the right side (see the uncomment (* *) ).
Clear["Global`*"];
cubesRight = {Cuboid[{0, 0, 0}, {1, 1, 3}], 
   Cuboid[{0, 1, 0}, {1, 1 + 1, 3 + 3/14}], 
   Cuboid[{0, 1 + 1, 0}, {1, 1 + 1 + 1, 3 + 3/14 + 3/14}], 
   Cuboid[{0 - 1, 1 + 1, 0}, {1 - 1, 1 + 1 + 1, 
     3 + 3/14 + 3/14 + 3/14}], Opacity[.1],(* 
   Cuboid[{0 - 1 - 1, 1 + 1, 0}, {1 - 1 - 1, 1 + 1 + 1, 
     3 + 3/14 + 3/14 + 3/14 + 3/14}] *)};
imgRight = 
  Graphics3D[cubesRight, Boxed -> False, 
   ViewProjection -> "Orthographic", Boxed -> False, 
   ViewPoint -> {1, -1, 1}];
cubesLeft = {Cuboid[{0, 0, 0}, {1, 1, 3}], 
   Cuboid[{-1, 0, 0}, {0, 1, 3 - 3/14}], 
   Cuboid[{-1 - 1, 0, 0}, {0 - 1, 1, 3 - 3/14 - 3/14}], 
   Cuboid[{-1 - 1 - 1, 0, 0}, {0 - 1 - 1, 1, 3 - 3/14 - 3/14 - 3/14}],
    Cuboid[{-1 - 1 - 1 - 1, 0, 0}, {0 - 1 - 1 - 1, 1, 
     3 - 3/14 - 3/14 - 3/14 - 3/14}], 
   Cuboid[{-1 - 1 - 1 - 1 - 1, 0, 0}, {0 - 1 - 1 - 1 - 1, 1, 
     3 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14}], 
   Cuboid[{-1 - 1 - 1 - 1 - 1, 0 + 1, 0}, {0 - 1 - 1 - 1 - 1, 1 + 1, 
     3 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14}], 
   Cuboid[{-1 - 1 - 1 - 1 - 1, 0 + 1 + 1, 0}, {0 - 1 - 1 - 1 - 1, 
     1 + 1 + 1, 3 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14}], 
   Cuboid[{-1 - 1 - 1 - 1 - 1, 0 + 1 + 1 + 1, -1}, {0 - 1 - 1 - 1 - 1,
      1 + 1 + 1 + 1, 
     3 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14}], 
   Cuboid[{-1 - 1 - 1 - 1 - 1, 
     0 + 1 + 1 + 1 + 1, -1}, {0 - 1 - 1 - 1 - 1, 1 + 1 + 1 + 1 + 1, 
     3 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14}],
    Cuboid[{-1 - 1 - 1 - 1 - 1, 0 + 1 + 1 + 1 + 1 + 1, 
     0 - 2}, {0 - 1 - 1 - 1 - 1, 1 + 1 + 1 + 1 + 1 + 1, 
     3 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 3/14 - 
      3/14 - 3/14}]};
imgLeft = 
  Graphics3D[{cubesLeft}, ViewProjection -> "Orthographic", 
   ViewPoint -> {1, -1, 1}, Boxed -> False];
Show[imgRight, imgLeft, ImageSize -> Large]

enter image description here

$\endgroup$
5
  • $\begingroup$ Great start - looking froward to the finish line :-) $\endgroup$ Commented 21 hours ago
  • $\begingroup$ Excellent! Thank you. $\endgroup$ Commented 19 hours ago
  • $\begingroup$ @VitaliyKaurov Thanks! I think we could generalize the method to other cases besides of the ratio 6:3. $\endgroup$ Commented 19 hours ago
  • $\begingroup$ I wonder if this is more compact version of your code: f[p_, s_] := MapIndexed[Cuboid[#, {#[[1]] + 1, #[[2]] + 1, 3 + s (#2[[1]] - 1) 3/14}] &, p]; Graphics3D[{ {f[{{0, 0, 0}, {0, 1, 0}, {0, 2, 0}, {-1, 2, 0}}, 1], Opacity[.1]}, {f[{{0, 0, 0}, {-1, 0, 0}, {-2, 0, 0}, {-3, 0, 0}, {-4, 0, 0}, {-5, 0, 0}, {-5, 1, 0}, {-5, 2, 0}, {-5, 3, -1}, {-5, 4, -1}, {-5, 5, -2}}, -1]} }, Boxed -> False, ViewProjection -> "Orthographic", ViewPoint -> {1, -1, 1} ] $\endgroup$ Commented 19 hours ago
  • $\begingroup$ @VitaliyKaurov Yes, you are right. $\endgroup$ Commented 18 hours ago
4
$\begingroup$

Here is a variant of side lengths 3x4x5x6. Theoretically any combinations of side lengths is possible.

Graphics3D[
 Cuboid @@@ {{{1/2, 7/2, -3}, {3/2, 9/2, -(1/10)}}, {{1/2, 5/
     2, -3}, {3/2, 7/2, 1/10}}, {{1/2, 3/2, -3}, {3/2, 5/2, 3/
     10}}, {{1/2, 1/2, -3}, {3/2, 3/2, 1/2}}, {{1/2, -(1/2), -3}, {3/
     2, 1/2, 7/10}}, {{3/2, -(1/2), -3}, {5/2, 1/2, 9/10}}, {{5/
     2, -(1/2), -3}, {7/2, 1/2, 11/10}}, {{7/2, -(1/2), -3}, {9/2, 1/
     2, 13/10}}, {{9/2, -(1/2), -3}, {11/2, 1/2, 3/2}}, {{11/
     2, -(1/2), -3}, {13/2, 1/2, 17/10}}, {{11/2, 1/2, -3}, {13/2, 3/
     2, 19/10}}, {{11/2, 3/2, -3}, {13/2, 5/2, 21/10}}, {{9/2, 3/
     2, -3}, {11/2, 5/2, 23/10}}, {{7/2, 3/2, -3}, {9/2, 5/2, 5/2}}}, 
 Boxed -> False, ViewProjection -> "Orthographic", 
 ViewVector -> {{21/2, 9/2, 15/2}, {9/2, 21/2, -9/10}}]

enter image description here

enter image description here

$\endgroup$
1
  • $\begingroup$ Excellent, love this, thank you! Could you also please post the animation or manipulate code? $\endgroup$ Commented 2 hours ago

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.