({{, (RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh])[{(Subscript[p, 1]),(Subscript[p, 2]),…}] 
gives a (RefLink[BoundaryMeshRegion, paclet:ref/BoundaryMeshRegion]) representing the convex hull from the points (Subscript[p, 1]), (Subscript[p, 2]), ….}})

OpenersNotesSection(Spacer1)Details and Options

The convex hull mesh is the smallest convex set that includes the points (Subscript[p, i]).

The convex hull boundary consists of points in 1D, line segments in 2D, and convex polygons in 3D.

(RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh]) takes the same options as (RefLink[BoundaryMeshRegion, paclet:ref/BoundaryMeshRegion]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (25)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

A 1D convex hull mesh:

pts=RandomReal[{-1,1},{5,1}];

ConvexHullMesh[pts]

The region is the smallest convex region that includes the points:

Show[%,Show[%,Graphics[Point[Append[#,0]&/@pts]]]]

A 2D convex hull mesh:

pts=RandomReal[{-1,1},{50,2}];

ConvexHullMesh[pts]

The region is the smallest convex region that includes the points:

Show[%,Graphics[Point[pts]]]

A 3D convex hull mesh:

pts=RandomReal[{-1,1},{50,3}];

ConvexHullMesh[pts]

The region is the smallest convex region that includes the points:

Show[HighlightMesh[%,Style[2,Opacity[0.5]]],Graphics3D[Point[pts]]]

OpenersExampleSection1(Spacer1)Scope  (3)

Create a 1D convex hull mesh from a set of points:

pts=RandomReal[{-1,1},{50,1}];

ℛ=ConvexHullMesh[pts]

Basic properties:

{RegionQ[ℛ],BoundaryMeshRegionQ[ℛ]}

Convex hull meshes are bounded:

{BoundedRegionQ[ℛ],RegionBounds[ℛ]}

Convex hull meshes are full dimensional:

{RegionDimension[ℛ],RegionEmbeddingDimension[ℛ]}

Find its area and centroid:

{RegionMeasure[ℛ],RegionCentroid[ℛ]}

Test for point membership:

RegionMember[ℛ,{0}]

Find the nearest point and its distance:

{RegionDistance[ℛ,{2}],RegionNearest[ℛ,{2}]}

Create a 2D convex hull mesh from a set of points:

pts=RandomReal[{-1,1},{50,2}];

ℛ=ConvexHullMesh[pts]

Basic properties:

{RegionQ[ℛ],BoundaryMeshRegionQ[ℛ]}

Convex hull meshes are bounded:

{BoundedRegionQ[ℛ],RegionBounds[ℛ]}

Convex hull meshes are full dimensional:

{RegionDimension[ℛ],RegionEmbeddingDimension[ℛ]}

Find its area and centroid:

{RegionMeasure[ℛ],RegionCentroid[ℛ]}

Test for point membership:

RegionMember[ℛ,{0,0}]

Find the nearest point and its distance:

{RegionDistance[ℛ,{2,2}],RegionNearest[ℛ,{2,2}]}

Create a 3D convex hull mesh from a set of points:

pts=RandomReal[{-1,1},{50,3}];

ℛ=ConvexHullMesh[pts]

Basic properties:

{RegionQ[ℛ],BoundaryMeshRegionQ[ℛ]}

Convex hull meshes are bounded:

{BoundedRegionQ[ℛ],RegionBounds[ℛ]}

Convex hull meshes are full dimensional:

{RegionDimension[ℛ],RegionEmbeddingDimension[ℛ]}

Find its volume and centroid:

{RegionMeasure[ℛ],RegionCentroid[ℛ]}

Find its surface area:

Area[RegionBoundary[ℛ]]

RegionMember[ℛ,{0,0,0}]

Find the nearest point and its distance:

{RegionDistance[ℛ,{2,2,2}],RegionNearest[ℛ,{2,2,2}]}

OpenersExampleSection2(Spacer1)Options  (13)

OpenersExampleSubsection0(Spacer1)MeshCellHighlight  (3)

(RefLink[MeshCellHighlight, paclet:ref/MeshCellHighlight]) allows you to specify highlighting for parts of a (RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh]):

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellHighlight->{{1,All}->Red,{0,All}->Black}]

By making faces transparent, the internal structure of a 3D (RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh]) can be seen:

ConvexHullMesh[{{0,0,0},{1,0,0},{0,1,0},{0,0,1},{1,1,0}},MeshCellHighlight->{{2,All}->Opacity[0.5,Orange]}]

Individual cells can be highlighted using their cell index:

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellHighlight->{{1,1}->{Thick,Red},{1,2}->{Dashed,Black}}]

Or by the cell itself:

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellHighlight->{Line[{1,2}]->{Thick,Red},Line[{2,4}]->{Dashed,Black}}]

OpenersExampleSubsection1(Spacer1)MeshCellLabel  (2)

(RefLink[MeshCellLabel, paclet:ref/MeshCellLabel]) can be used to label parts of a (RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh]):

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellLabel->{0->"Index"}]

Individual cells can be labeled using their cell index:

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellLabel->{{1,1}->"x",{1,2}->"y"}]

Or by the cell itself:

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellLabel->{Line[{1,2}]->"x",Line[{2,4}]->"y"}]

OpenersExampleSubsection2(Spacer1)MeshCellMarker  (1)

(RefLink[MeshCellMarker, paclet:ref/MeshCellMarker]) can be used to assign values to parts of a (RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh]):

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellMarker->{{0,1}->1,{0,2}->2,{0,3}->3,{0,4}->4}]

Use (RefLink[MeshCellLabel, paclet:ref/MeshCellLabel]) to show the markers:

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellMarker->{{0,1}->1,{0,2}->2,{0,3}->3,{0,4}->4},MeshCellLabel->{0->"Marker"}]

OpenersExampleSubsection3(Spacer1)MeshCellShapeFunction  (2)

(RefLink[MeshCellShapeFunction, paclet:ref/MeshCellShapeFunction]) allows you to specify functions for parts of a (RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh]):

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellShapeFunction->{0->(Disk[#,.1]&)}]

Individual cells can be drawn using their cell index:

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellShapeFunction->{{0,1}->(Disk[#,.1]&),{0,2}->(Disk[#,{.1,.2}]&)}]

Or by the cell itself:

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellShapeFunction->{Point[1]->(Disk[#,.1]&),Point[2]->(Disk[#,{.1,.2}]&)}]

OpenersExampleSubsection4(Spacer1)MeshCellStyle  (3)

(RefLink[MeshCellStyle, paclet:ref/MeshCellStyle]) allows you to specify styling for parts of a (RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh]):

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellStyle->{{1,All}->Red,{0,All}->Black}]

By making faces transparent, the internal structure of a 3D (RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh]) can be seen:

ConvexHullMesh[{{0,0,0},{1,0,0},{0,1,0},{0,0,1},{1,1,0}},MeshCellStyle->{{2,All}->Opacity[0.5,Orange]}]

Individual cells can be highlighted using their cell index:

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellStyle->{{1,1}->{Thick,Red},{1,2}->{Dashed,Black}}]

Or by the cell itself:

ConvexHullMesh[{{0,0},{1,0},{0,1},{1,1}},MeshCellStyle->{Line[{1,2}]->{Thick,Red},Line[{2,4}]->{Dashed,Black}}]

OpenersExampleSubsection5(Spacer1)PlotTheme  (2)

Use a theme with grid lines and a legend:

ConvexHullMesh[ExampleData[{"Geometry3D","UtahTeapot"},"VertexData"],PlotTheme->"Detailed"]

Use a theme to draw a wireframe:

ConvexHullMesh[ExampleData[{"Geometry3D","UtahTeapot"},"VertexData"],PlotTheme->"Lines"]

OpenersExampleSection3(Spacer1)Applications  (3)

The convex hull of a compound of five tetrahedra is a dodecahedron:

ℛ=DiscretizeGraphics[PolyhedronData["TetrahedronFiveCompound"]]

ConvexHullMesh[MeshCoordinates[ℛ]]

Compute the convex hull of a cow:

cowPoints=ExampleData[{"Geometry3D","Cow"},"VertexData"];

cowvexHull=ConvexHullMesh[cowPoints];

Visualize convex hull and cow:

cow=ExampleData[{"Geometry3D","Cow"},"Graphics3D"];

Show[HighlightMesh[cowvexHull,{Style[1,{Brown}],Style[2,Opacity[0.3,Brown]]}],cow]

Find candidate orientations for placing a model on a flat surface:

model=;

Each face of the convex hull represents a candidate orientation:

convexHull=ConvexHullMesh[MeshCoordinates[model]];
orientations=MeshPrimitives[convexHull,2];

Show[HighlightMesh[convexHull,{Style[1,{Brown}],Style[2,Opacity[0.3,Brown]]}],model]

Use the orthogonal projection of the center of mass to further restrict candidate orientations:

masscenter=RegionCentroid[model];
projection[polygon_,p_]:=RegionNearest[AffineSpace@@polygon,p];
candidates=Select[orientations,RegionMember[#,projection[#,masscenter]]&];

A candidate orientation:

transform[{Polygon[points_]}]:=Module[{proj=points},proj[[All,3]]=0;
Last[FindGeometricTransform[proj,points]]];

TransformedRegion[model,transform[MaximalBy[candidates,Area]]]

OpenersExampleSection4(Spacer1)Properties & Relations  (3)

(RefLink[ConvexHullMesh, paclet:ref/ConvexHullMesh]) is effectively the (RefLink[BoundaryMesh, paclet:ref/BoundaryMesh]) of a (RefLink[DelaunayMesh, paclet:ref/DelaunayMesh]):

pts=RandomReal[1,{5,2}];

{BoundaryMesh[DelaunayMesh[pts]],ConvexHullMesh[pts]}

In 3D:

pts=RandomReal[{-1,1},{50,3}];

{BoundaryMesh[DelaunayMesh[pts]],ConvexHullMesh[pts]}

Use (RefLink[DelaunayMesh, paclet:ref/DelaunayMesh]) to get a Delaunay triangulation of the interior of the convex hull:

DelaunayMesh[RandomReal[1,{25,2}]]

Use (RefLink[TriangulateMesh, paclet:ref/TriangulateMesh]) to control the triangulation of the interior:

ℛ=ConvexHullMesh[RandomReal[1,{25,2}]];

{TriangulateMesh[ℛ],TriangulateMesh[ℛ,MaxCellMeasure->∞]}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[DelaunayMesh, paclet:ref/DelaunayMesh])  ▪  (RefLink[VoronoiMesh, paclet:ref/VoronoiMesh])  ▪  (RefLink[BoundaryMeshRegion, paclet:ref/BoundaryMeshRegion])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Mesh-Based Geometric Regions, paclet:guide/MeshRegions])}, {▪(RefLinkPlain[3D Printing, paclet:guide/3DPrinting])}, {▪(RefLinkPlain[Geometric Computation, paclet:guide/GeometricComputation])}})}})