Hexahedron[{p1,p2,…,p8}]
represents a filled hexahedron with corners p1, p2, …, p8.
Hexahedron[{{p1,1,p1,2,…,p1,8},{p2,1,…},…}]
represents a collection of hexahedra.
Hexahedron
Hexahedron[{p1,p2,…,p8}]
represents a filled hexahedron with corners p1, p2, …, p8.
Hexahedron[{{p1,1,p1,2,…,p1,8},{p2,1,…},…}]
represents a collection of hexahedra.
Details and Options
- Hexahedron can be used as a geometric region and a graphics primitive.
- Hexahedron represents a filled polyhedron given by the polygon faces {p4,p3,p2,p1}, {p1,p2,p6,p5}, {p2,p3,p7,p6}, {p3,p4,p8,p7}, {p4,p1,p5,p8}, and {p5,p6,p7,p8}.
- CanonicalizePolyhedron can be used to convert a hexahedron to an explicit Polyhedron object.
- Hexahedron can be used in Graphics3D.
- In graphics, the points pi can be Scaled and Dynamic expressions.
- Graphics rendering is affected by directives such as FaceForm, EdgeForm, Opacity, Texture, and color.
- The following options and settings can be used in graphics:
-
VertexColors Automatic vertex colors to be interpolated VertexNormals Automatic effective vertex normals for shading VertexTextureCoordinates None coordinates for textures
Examples
open all close allBasic Examples (3)
Graphics3D[Hexahedron[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0}, {0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}}]]ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];{Graphics3D[{Pink, ℛ}], Graphics3D[{EdgeForm[Thick], ℛ}], Graphics3D[{EdgeForm[Dashed], ℛ}], Graphics3D[{EdgeForm[Directive[Thick, Dashed, Blue]], Pink, ℛ}]}ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];Volume[ℛ]RegionCentroid[ℛ]Scope (18)
Graphics (8)
Specification (2)
pts = {{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}};Graphics3D[Hexahedron[pts]]pts1 = {{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}};pts2 = pts1 + 2;Graphics3D[Hexahedron[{pts1, pts2}]]Styling (3)
FaceForm and EdgeForm can be used to specify the styles of the faces and edges:
ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];Graphics3D[{EdgeForm[{Thick, Dashed, Blue}], FaceForm[{Pink, Opacity[0.7]}], ℛ}, Boxed -> False]Apply a Texture to the faces:
ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0.5, 0}, {1, 0.5}, {0.5, 1}, {0, 0.5}}];Graphics3D[{Texture[[image]], ℛ}, Lighting -> "Neutral"]Assign VertexColors to vertices:
ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}, VertexColors -> {Black, Red, Yellow, Green, Blue, Magenta, White, Cyan}];Graphics3D[ℛ, Lighting -> "Neutral"]Coordinates (3)
Specify coordinates by fractions of the plot range:
ℛ = Hexahedron[{Scaled[{0, 0, 0}], Scaled[{0.5, 0, 0}], Scaled[{1, 0.5, 0}], Scaled[{0.5, 0.5, 0}], Scaled[{0, 0, 0.5}], Scaled[{0.5, 0, 0.5}], Scaled[{1, 0.5, 0.5}], Scaled[{0.5, 0.5, 0.5}]}];Graphics3D[ℛ, PlotRange -> {{0, 10}, {0, 10}, {0, 10}}, Axes -> True]Specify scaled offsets from the ordinary coordinates:
ℛ = Hexahedron[{Scaled[{0, 0, 0.5}, {0, 0, 0}], Scaled[{0, 0, 0.5}, {1, 0, 0}], Scaled[{0, 0, 0.5}, {2, 1, 0}], Scaled[{0, 0, 0.5}, {1, 1, 0}], Scaled[{0, 0, 0.5}, {0, 0, 1}], Scaled[{0, 0, 0.5}, {1, 0, 1}], Scaled[{0, 0, 0.5}, {2, 1, 1}], Scaled[{0, 0, 0.5}, {1, 1, 1}]}];Graphics3D[ℛ, PlotRange -> {{0, 2}, {0, 2}, {0, 2}}, Axes -> True]Points can be Dynamic:
DynamicModule[{x}, {Slider[Dynamic[x], {0.5, 1}], Graphics3D[Hexahedron[{{0, 0, 0}, Dynamic[x{1, 0, 0}], {2, 1, 0}, {1, 1, 0}, Dynamic[x{0, 0, 1}], Dynamic[x{1, 0, 1}], {2, 1, 1}, {1, 1, 1}}]]}]Regions (10)
Embedding dimension is the dimension of the space in which the hexahedron lives:
ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];RegionEmbeddingDimension[ℛ]Geometric dimension is the dimension of the shape itself:
RegionDimension[ℛ]ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];{RegionMember[ℛ, {(1/3), (1/3), (1/3)}], RegionMember[ℛ, {1, 2, 3}]}Get conditions for point membership:
RegionMember[ℛ, {x, y, z}]ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];{Volume[ℛ], RegionMeasure[ℛ]}c = RegionCentroid[ℛ]Graphics3D[{{Opacity[0.5], LightBlue, ℛ}, {PointSize[Large], Red, Point[c]}}, Boxed -> False]ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];{RegionDistance[ℛ, {1, 2, 3}], RegionDistance[ℛ, {(1/3), (1/4), (1/5)}]}The equidistance contours for a hexahedron:
ContourPlot3D[Evaluate@RegionDistance[ℛ, {x, y, z}], {x, -1, 3}, {y, -1.5, 3}, {z, -1.5, 3}, Mesh -> None, Contours -> {0.25, 0.5, 1}, ContourStyle -> ColorData[94, "ColorList"], Lighting -> "Neutral", BaseStyle -> Opacity[0.5], BoxRatios -> Automatic]ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];{SignedRegionDistance[ℛ, {1, 2, 3}], SignedRegionDistance[ℛ, {(1/3), (1/4), (1/5)}]}ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];{RegionNearest[ℛ, {1, 2, 3}], RegionNearest[ℛ, {(1/3), (1/4), (1/5)}]}Nearest points to an enclosing sphere:
spherePoints[{n_, m_}, c_, r_] :=
Flatten[Table[c + r{Cos[k 2π / n]Sin[l π / m], Sin[k 2π / n]Sin[l π / m], Cos[l π / m]}, {k, 0., n - 1}, {l, 0., m - 1}], 1];pl = spherePoints[{16, 8}, RegionCentroid[ℛ], 2];
npl = Table[RegionNearest[ℛ, p], {p, pl}];Legended[Graphics3D[{ℛ, {Thin, Gray, Line[Transpose[{pl, npl}]]}, {Red, Point[pl]}, {PointSize[Medium], Blue, Point[npl]}}, Lighting -> "Neutral", Boxed -> False], PointLegend[{Red, Blue}, {"start", "nearest"}]]ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];BoundedRegionQ[ℛ]r = RegionBounds[ℛ]Graphics3D[{{EdgeForm[White], Opacity[0.2, Yellow], Cuboid@@Transpose[r]}, ℛ},
Boxed -> False]Integrate over a hexahedron region:
ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];Integrate[x + y + z, {x, y, z}∈ℛ]Optimize over a hexahedron region:
ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];MinValue[{x y z - x y, {x, y, z}∈ℛ}, {x, y, z}]Solve equations in a hexahedron region:
ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];Reduce[x^2 + y^2 + z^2 == 1 && x - y - z == -(1/2) && z^2 == x y + (1/4) && {x, y, z}∈ℛ, {x, y, z}]Applications (4)
Convert a Cuboid to a Hexahedron:
c = Cuboid[{1, 2, 3}, {4, 5, 6}];h = c /. Cuboid[{x0_, y0_, z0_}, {x1_, y1_, z1_}] :> Hexahedron[{{x0, y0, z0}, {x1, y0, z0}, {x1, y1, z0}, {x0, y1, z0}, {x0, y0, z1}, {x1, y0, z1}, {x1, y1, z1}, {x0, y1, z1}}]Graphics3D /@ {c, h}Convert a Parallelepiped to a Hexahedron:
c = Parallelepiped[{1, 2, 3}, {{2, 0, 0}, {2, 3, 0}, {0, 3, 2}}];h = c /. Parallelepiped[p_, {v1_, v2_, v3_}] :>
Hexahedron[{p, p + v1, p + v1 + v2, p + v2, p + v3, p + v1 + v3, p + v1 + v2 + v3, p + v2 + v3}]Graphics3D /@ {c, h}Create a square frustum parameterized by base width, top width, and height:
SquareFrustum[wb_, wt_, h_] := With[{p0 = {0, 0, 0}, p5 = {(wb - wt/2), (wb - wt/2), h}}, Hexahedron[{p0, p0 + {wb, 0, 0}, p0 + {wb, wb, 0}, p0 + {0, wb, 0}, p5, p5 + {wt, 0, 0}, p5 + {wt, wt, 0}, p5 + {0, wt, 0}}]]SquareFrustum[9, 5, 6]Graphics3D@%hl = Table[Hexahedron[TranslationTransform[{i, j, k}] /@ {{2, 2, 1}, {3, 2, 1}, {4, 3, 1}, {3, 3, 1}, {2, 3, 2}, {3, 3, 2}, {4, 4, 2}, {3, 4, 2}}], {i, 1, 5}, {j, 1, 5}, {k, 1, 5}];Graphics3D[{EdgeForm[Directive[Thin, Gray]], FaceForm[Opacity[0.3]], hl}, Boxed -> False]Properties & Relations (4)
Hexahedron is a generalization of a Cuboid in dimension 3:
Subscript[ℛ, 1] = Hexahedron[{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}, {0, 0, 1}, {0, 1, 1}, {1, 1, 1}, {1, 0, 1}}];
Subscript[ℛ, 2] = Cuboid[{0, 0, 0}, {1, 1, 1}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]A hexahedron can be represented as the union of five tetrahedra:
pts = {{-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1}, {-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1}};Graphics3D[Hexahedron[pts], Boxed -> False]Point index list of tetrahedra vertices:
ti = {{1, 2, 3, 6}, {1, 3, 8, 6}, {1, 3, 4, 8}, {1, 6, 8, 5}, {3, 8, 6, 7}};Graphics3D[{Opacity@0.4, Table[Tetrahedron[pts[[i]]], {i, ti}]}, Boxed -> False]A hexahedron can also be represented as the union of six tetrahedra:
pts = {{-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1}, {-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1}};ti = {{1, 6, 8, 5}, {1, 2, 8, 6}, {2, 7, 8, 6}, {1, 8, 3, 4}, {1, 8, 2, 3}, {1, 8, 7, 3}};Graphics3D[{Opacity@0.4, Table[Tetrahedron[pts[[i]]], {i, ti}]}, Boxed -> False]ImplicitRegion can represent any Hexahedron:
Subscript[ℛ, 1] = ImplicitRegion[Subscript[t, 3] ≥ 0 && Subscript[t, 2] ≥ 0 && Subscript[t, 1] - Subscript[t, 2] ≥ 0 && 1 - Subscript[t, 1] + Subscript[t, 2] ≥ 0 && 1 - Subscript[t, 2] ≥ 0 && 1 - Subscript[t, 3] ≥ 0, {Subscript[t, 1], Subscript[t, 2], Subscript[t, 3]}];
Subscript[ℛ, 2] = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 1}, {1, 0, 1}, {2, 1, 1}, {1, 1, 1}}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]Neat Examples (2)
Random collection of hexahedrons:
Graphics3D[Table[{EdgeForm[Opacity[.3]], Hue[RandomReal[]], GeometricTransformation[Hexahedron[], AffineTransform[{RandomReal[1, {3, 3}], RandomReal[1.5, 3]}]]}, {30}]]Sweep a hexahedron around an axis:
ℛ = Hexahedron[{{0, 0, 0}, {1, 0, 0}, {2, 1, 0}, {1, 1, 0}, {0, 0, 2}, {1, 0, 2}, {2, 1, 1}, {1, 1, 1}}];Graphics3D[{Opacity[0.3], EdgeForm[], Table[{ColorData["Rainbow"][Rescale[c, {0, 2Pi}]], GeometricTransformation[ℛ, RotationTransform[c, {0, 0, 1}, {0, 0, 0}]]}, {c, 0, 2Pi, 2Pi / 24}]}]Related Guides
Text
Wolfram Research (2014), Hexahedron, Wolfram Language function, https://reference.wolfram.com/language/ref/Hexahedron.html (updated 2019).
CMS
Wolfram Language. 2014. "Hexahedron." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/Hexahedron.html.
APA
Wolfram Language. (2014). Hexahedron. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Hexahedron.html
BibTeX
@misc{reference.wolfram_2026_hexahedron, author="Wolfram Research", title="{Hexahedron}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/Hexahedron.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_hexahedron, organization={Wolfram Research}, title={Hexahedron}, year={2019}, url={https://reference.wolfram.com/language/ref/Hexahedron.html}, note=[Accessed: 12-June-2026]}