# Mesh Regions

Mesh-based regions represent regions using simple special regions, called cells, such as point, line, triangle, and tetrahedron. MeshRegion represents the region as a disjoint union of simple cells. BoundaryMeshRegion represents a full-dimensional region using a ray-boundary intersection rule to define what points are in the region. Mesh-based regions are typically created by discretizing other regions or graphics or by automated construction from point sets. Mesh-based regions are what is traditionally called computational geometry.

Mesh regions in 1D.

 In[1]:= XMeshRegion[{{0}, {1}, {2}, {3}}, {Line[{1, 2}], Line[{3, 4}]}, MeshCellLabel -> 0 -> "Index"]
 Out[1]=
 In[2]:= XDelaunayMesh[RandomReal[{0, 1}, {6, 1}]]
 Out[2]=

Mesh regions in 2D.

 In[3]:= XMeshRegion[{{0, 0}, {1, 0}, {0, 1}, {1, 1}}, Triangle[{{1, 2, 3}, {3, 2, 4}}], MeshCellLabel -> 0 -> "Index"]
 Out[3]=
 In[4]:= XDelaunayMesh[RandomReal[{0, 1}, {25, 2}]]
 Out[4]=

Mesh regions in 3D.

 In[5]:= XMeshRegion[{{0, 0, 0}, {2, 0, 0}, {2, 2, 0}, {0, 2, 0}, {1, 1, 2}}, {Tetrahedron[{1, 2, 3, 5}], Tetrahedron[{1, 3, 4, 5}]}, MeshCellLabel -> 0 -> "Index"]
 Out[5]=
 In[6]:= XDelaunayMesh[RandomReal[{0, 1}, {25, 3}]]
 Out[6]=

Boundary mesh region in 1D.

 In[7]:= XBoundaryMeshRegion[{{0}, {1}}, Point[{1, 2}], MeshCellLabel -> 0 -> "Index"]
 Out[7]=
 In[8]:= XConvexHullMesh[RandomReal[{0, 1}, {6, 1}]]
 Out[8]=

Boundary mesh regions in 2D.

 In[9]:= XBoundaryMeshRegion[{{0, 0}, {1, 0}, {0, 1}}, Line[{1, 2, 3, 1}], MeshCellLabel -> 0 -> "Index"]
 Out[9]=
 In[10]:= XConvexHullMesh[RandomReal[{0, 1}, {25, 2}]]
 Out[10]=

Boundary mesh regions in 3D.

 In[11]:= XBoundaryMeshRegion[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, Triangle[{{1, 2, 3}, {1, 2, 4}, {2, 3, 4}, {1, 3, 4}}], MeshCellLabel -> 0 -> "Index"]
 Out[11]=
 In[12]:= XConvexHullMesh[RandomReal[{0, 1}, {25, 3}]]
 Out[12]=

## Mathematica + Mathematica Online

Questions? Comments? Contact a Wolfram expert »