# Plot a polyhedron/region trapped between 4 planes?

GROUPS:
 I need to plot the region trapped between 4 planes x = y = z = x + y + z - 1 = 0. Here, is the code that I used: RegionPlot3D[ContourPlot3D[x == 0, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}], ContourPlot3D[y == 0, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}], ContourPlot3D[z == 0, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}], ContourPlot3D[x + y + z - 1 == 0, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}]] But, there are other extra bits that I do not know how to delete them.
10 months ago
6 Replies
 Do you want to plot this one? RegionPlot3D[x + y + z <= 1, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}] Or, may be this one? Graphics3D[{EdgeForm[{Thick, Blue}], FaceForm[{Pink, Opacity[0.7]}], Tetrahedron[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {0, 0, 0}}]}, Boxed -> False]
10 months ago
 Dear Valeriu, I would like to plot a polyhedron trapped between four arbitrary surfaces not only a polyhedron between the coordinate surfaces and other one.
10 months ago
 As suggested by Valeriu, you can use Tetrahedron if you give the vertices: vertices = RandomReal[{0, 1}, {4, 3}]; Graphics3D[Tetrahedron[vertices]] Graphics3D[Map[InfinitePlane, Subsets[vertices, {3}]], PlotRange -> CoordinateBounds[vertices], PlotRangePadding -> Scaled[.2]] If you start from the equations of the 4 faces, you can extract the vertices by solving the equations first: equations = {x == 0, y == 0, z == 0, x + y + z - 1 == 0}; vertices = Map[{x, y, z} /. First@Solve[#] &, Subsets[equations, {3}]]; Graphics3D[Tetrahedron[vertices]]