9
$\begingroup$

So, I can construct a random polyhedron and find its 3 silhouettes onto the 3 standard planes.

For example,

    polyhedron = PolyhedronCoordinates[RandomPolyhedron[{"ConvexHull", 10}]];
    
    (* Projection Functions *)
    projections = polyhedron[[All, #]] & /@ {{1, 2}, {1, 3}, {2, 3}};
    
    (* Find Convex Hulls and Create Graphics *)
    graphics = Graphics[Polygon[MeshCoordinates[#][[MeshCells[#, 2][[1, 1]]]]]] & /@ (ConvexHullMesh /@ projections);

    (* Labeled Graphics *)
    titles = {"XY Projection", "XZ Projection", "YZ Projection"};
    labeledGraphics = MapThread[Labeled[#1, #2, Bottom] &, {graphics, titles}];
    
    (* Display *)
    GraphicsGrid[{labeledGraphics}]

An example polyhedron and its projections are shown below:

A random polyhedron

which gives the three orthographic projections:

The 3 orthographic projections of a convex polyhedron

The question is, given the three standard orthographic projections, how do I find the original convex polyhedron knowing that the polyhedron is convex?

UPDATE:

So, cvgmt's answer is correct, it was not unique with how the question was originally posed, and there is a lot of value in that answer. But I feel that it would be good to extend the question to include solutions that would reconstruct the original convex polyhedron using minimal information. I am moving the goalpost, that is why I approved cvgmt's answer, and am setting a bounty on this. I think there are multiple ways to do this. For example, looking at a different set of silhouettes. Or looking at a small continuous set of silhouettes instead of discrete.

One way I am thinking is something like this, but not quite sure how to code it exactly, :

Shadows in a Bounding Box

Imagine the Z-axis goes in and out of the board, positive Z out of the board, the X-axis is left to right, and the Y-axis is up and down. So, since we have the projections onto the bounding box, let's say we use the XY+ projection, the XY- projection, the YZ+ projection, and the YZ- projection. The XY+ projection and the XY- projection are the exact same, except that XY- has the same Z-coordinate as the smallest Z from the original polyhedron and XY+ has the largest Z coordinate as the largest Z from the original polyhedron. The YZ+ projection and the YZ- projection are the exact same, except that YZ- has the same X-coordinate as the smallest X from the original polyhedron and YZ+ has the largest X coordinate as the largest X from the original polyhedron. The respected projections, XY+ to YZ+ to XY- to YZ- form a 'ring' around the the original bounding box. Note how we don't need the XZ projections. The 'cylinder' is then from XZ- to XZ+, lines are drawn to connect the line segments with the same Y-value. Then find the convex hull. I am not sure if that would work or not.

Cylinder is a poor word choice, but I cannot think of anything better.

$\endgroup$
5
  • 1
    $\begingroup$ Look at the projection of the vertices. Say vertex v1={x,y,z}. Now the question is, if this vertex is visible in at least 2 projections, say in xy and yz projection. Then you can get the {x,y,z} from the 2 projections. However, if the point is only visible in a single or in no projection, then you are out of luck. $\endgroup$ Sep 27, 2023 at 8:37
  • $\begingroup$ @TegLouis From the three projections you get a unique(!) polyhedron. This polyhedron includes all possible shapes with identical projections. You need additional infomation, for example some other projections, to reconstruct your initial shape! $\endgroup$ Oct 3, 2023 at 17:53
  • $\begingroup$ Which additional information? I don't know if this should be actually asked on this forum. $\endgroup$
    – Teg Louis
    Oct 3, 2023 at 22:22
  • $\begingroup$ @TegLouis You didn't get my comment. As cvgmt stated too the three projections lead to "maximal polyhedron" which is unique and contains all possible polyhedrons with the same projections. To filter out one of these possible solutions you need more information! $\endgroup$ Oct 5, 2023 at 8:02
  • $\begingroup$ @UlrichNeumann I understood your comment. You were very clear. I was just curious about which additional information would be needed to filter out the possible solutions. For example, if I had a convex polyhedron in a warehouse, and I take photos of it or do a video recording, what is the least amount of information required to find that exact convex polyhedron that is not necessarily maximal. But that is a math question, but not a Mathematica question. It is just a side note question, I am a curious person. $\endgroup$
    – Teg Louis
    Oct 5, 2023 at 13:06

2 Answers 2

8
+150
$\begingroup$
  • We only need the data of the boundary points of the projections.
Clear[data];
polyhedron = 
  PolyhedronCoordinates[RandomPolyhedron[{"ConvexHull", 10}]];
projections = polyhedron[[All, #]] & /@ {{1, 2}, {1, 3}, {2, 3}};
data = MeshCoordinates /@ ConvexHullMesh /@ projections
  • Not unique,but we can construct the maximun one of such polyhedron from the boundary vertexs of the three projections,do not assume that we know the interior points of the projections.

regs = {reg12, reg13, reg23} = data // Map@ConvexHullMesh;

{{{x1, x2}, {y1, y2}}, {{x1, x2}, {z1, z2}}, {{y1, y2}, {z1, z2}}} = 
  RegionBounds /@ regs;

Reg12 = BoundaryMesh[RegionProduct[reg12, Line[{{z1}, {z2}}]], 
   ViewPoint -> {0, 0, 1}, ViewProjection -> "Orthographic"];

Reg13 = RegionProduct[reg13, Line[{{y1}, {y2}}]] // BoundaryMesh;
Reg13 = BoundaryMeshRegion[MeshCoordinates[Reg13][[;; , {1, 3, 2}]], 
   MeshCells[Reg13, 2], ViewPoint -> {0, -1, 0}, 
   ViewProjection -> "Orthographic"];

Reg23 = RegionProduct[reg23, Line[{{x1}, {x2}}]] // BoundaryMesh;
Reg23 = BoundaryMeshRegion[MeshCoordinates[Reg23][[;; , {3, 1, 2}]], 
   MeshCells[Reg23, 2], ViewPoint -> {1, 0, 0}, 
   ViewProjection -> "Orthographic"];

result = RegionIntersection[Reg12, Reg13, Reg23]

Grid[{{reg12, reg13, reg23}, {Reg12, Reg13, Reg23}, 
  Show[result, ViewPoint -> #, 
     ViewProjection -> "Orthographic"] & /@ {{0, 0, 1}, {0, -1, 
     0}, {1, 0, 0}}}]

enter image description here

  • Such polyhedron is not unique. We can calculus their RegionDifference and relate volume and draw the solids with difference colors to show this.
{result, ConvexHullMesh@polyhedron, 
  RegionDifference[result, ConvexHullMesh@polyhedron]} // Volume
Graphics3D[{{Opacity[.2], Yellow, result}, {Opacity[.9], Green, 
     ConvexHullMesh@polyhedron}, {Red, Opacity[.1], 
     RegionDifference[result, ConvexHullMesh@polyhedron]}}, 
   ViewProjection -> "Orthographic", Boxed -> False, 
   ViewPoint -> #] & /@ {{0, 0, 1}, {0, -1, 0}, {1, 0, 0}, {1, 1, 1}}

enter image description here

  • We test non-convex region, for example, the regions construct by some fonts.
  • Since RegionIntersection not always work for non-convex region, we use OpenCascadeLink instead.
Clear["Global`*"];
reg12 = BoundaryDiscretizeGraphics[Text["G"], _Text];
reg23 = BoundaryDiscretizeGraphics[Text["E"], _Text];
reg13 = BoundaryDiscretizeGraphics[Text["B"], _Text];
{{x1, x2}, {y1, y2}} = RegionBounds[reg12];
reg23 = RegionResize[reg23, {y2 - y1, Automatic}];
{{y1, y2}, {z1, z2}} = RegionBounds[reg23];
reg13 = RegionResize[reg13, {{x1, x2}, {z1, z2}}];
Reg12 = BoundaryMesh[RegionProduct[reg12, Line[{{z1}, {z2}}]], 
   ViewPoint -> {0, 0, 1}, ViewProjection -> "Orthographic"];
Reg13 = RegionProduct[reg13, Line[{{y1}, {y2}}]] // BoundaryMesh;
Reg13 = BoundaryMeshRegion[MeshCoordinates[Reg13][[;; , {1, 3, 2}]], 
   MeshCells[Reg13, 2], ViewPoint -> {0, -1, 0}, 
   ViewProjection -> "Orthographic"];
Reg23 = RegionProduct[reg23, Line[{{x1}, {x2}}]] // BoundaryMesh;
Reg23 = BoundaryMeshRegion[MeshCoordinates[Reg23][[;; , {3, 1, 2}]], 
   MeshCells[Reg23, 2], ViewPoint -> {1, 0, 0}, 
   ViewProjection -> "Orthographic"];

Needs["OpenCascadeLink`"];
Needs["NDSolve`FEM`"];
{shape12, shape13, shape23} = 
  OpenCascadeShape[ToBoundaryMesh@#] & /@ {Reg12, Reg13, Reg23};
shape = OpenCascadeShapeIntersection[shape12, shape13, shape23];
bm = OpenCascadeShapeSurfaceMeshToBoundaryMesh[shape];
reg = MeshRegion@bm;
Grid[{{reg12, reg13, reg23}, {Reg12, Reg13, Reg23}, 
  RegionPlot3D[reg, ViewPoint -> #, ViewProjection -> "Orthographic", 
     ColorFunction -> Hue] & /@ {{0, 0, 1}, {0, -1, 0}, {1, 0, 
     0}, {-1, -1, 3}}}]

enter image description here

$\endgroup$
4
  • $\begingroup$ Is it possible to find unique? My intuition was yes, but only for convex polyhedrons and knowing the each projections' orientations. But my intuition is often wrong. $\endgroup$
    – Teg Louis
    Sep 27, 2023 at 15:01
  • 2
    $\begingroup$ @TegLouis Up to now, I only confirm that in 2D, this in not unique. For example, if the porjections is two lines, then besides of rectangle, there are still may polygon satisfies such projection. $\endgroup$
    – cvgmt
    Sep 27, 2023 at 15:10
  • $\begingroup$ I think you are a genius, and I am jealous. What do you think the minimum amount of information is needed to find the original convex polyhedron? And do you have a suggested resource to find more information? $\endgroup$
    – Teg Louis
    Oct 3, 2023 at 23:02
  • $\begingroup$ @TegLouis Thanks! I thinks the problem is still difficult in 2D. For example, the red region reg1,reg2 have the same porjections line1,line2, they are the two minimum convex object. line1 = Line[{{0, 0}, {2, 0}}]; line2 = Line[{{0, 0}, {0, 1}}]; reg1 = Line[{{2, 0}, {0, 1}}]; reg2 = Line[{{0, 0}, {2, 1}}]; Graphics[{line1, line2, Red, reg1, reg2}] $\endgroup$
    – cvgmt
    Oct 3, 2023 at 23:13
3
$\begingroup$

Try

polyhedron = PolyhedronCoordinates[RandomPolyhedron[{"ConvexHull", 10}]];

(* Projection Functions *)
projections = polyhedron[[All, #]] & /@ {{1, 2}, {1, 3}, {2, 3}};

define symbollically unknown polyhedron and its projections

ph = Table[{x[k], y[k], z[k]}, {k, Length[polyhedron]}]
phproj = ph[[All, #]] & /@ {{1, 2}, {1, 3}, {2, 3}}

fit the coordinates of ph

null = phproj - projections // Flatten;
mini=NMinimize[null . null, Flatten[ph]]
(*{-1.77636*10^-15, {x[1] -> 0.91212, y[1] -> 0.067305, 
z[1] -> 0.404641, x[2] -> 0.774921, y[2] -> 0.0863487, 
z[2] -> 0.0197736, x[3] -> 0.30895, y[3] -> 0.218595, 
z[3] -> 0.976788, x[4] -> 0.396847, y[4] -> 0.177632, 
z[4] -> 0.781611, x[5] -> 0.0989693, y[5] -> 0.437153, 
z[5] -> 0.328092, x[6] -> 0.978541, y[6] -> 0.330944, 
z[6] -> 0.328021, x[7] -> 0.374619, y[7] -> 0.547744, 
z[7] -> 0.0331691, x[8] -> 0.330898, y[8] -> 0.867104, 
z[8] -> 0.0107966, x[9] -> 0.776468, y[9] -> 0.599847, 
z[9] -> 0.167013}}*)
$\endgroup$
2
  • 2
    $\begingroup$ ph must independent on Length[polyhedron] since we only know projections , that is, we cannot assume the numbers of vertices of the polyhedron. $\endgroup$
    – cvgmt
    Sep 27, 2023 at 13:59
  • $\begingroup$ @cvgmt Thanks for your hint! $\endgroup$ Sep 27, 2023 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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