13
$\begingroup$

I have noted several instances here and here where ConvexHullMesh, introduced in v10 has been used to greatly simplify some geometry problems. Determining the volume of a region encompassing a set of 3D points, pts is now simply:

Volume@ConvexHullMesh@pts

Is there an equally simplified method for determining the surface area of this convex hull?

Note, the documentation for ConvexHullMesh suggests that the area can be obtained, using RegionMeasure, however I suspect this is a typo, since RegionMeasure gives an area only if the points have a dimension of 2.

$\endgroup$

3 Answers 3

12
$\begingroup$
Area@RegionBoundary@ConvexHullMesh@pts

For example, consider a cube, which has volume 1 and surface area 6:

pts = Tuples[{0, 1}, 3];
convexHull = ConvexHullMesh[pts];
convexHullSurface = RegionBoundary[convexHull];
RegionMeasure[convexHull, #] & /@ {0, 1, 2, 3}
(* {∞, ∞, ∞, 1.} *)
RegionMeasure[convexHullSurface, #] & /@ {0, 1, 2, 3}
(* {∞, ∞, 6., 0} *)
$\endgroup$
1
  • $\begingroup$ Nice - I was heading down that road, but took a wrong turn at some point. $\endgroup$ Sep 23, 2014 at 19:31
11
$\begingroup$

Here is another way to compute the surface area of a 3D convex hull:

SeedRandom[0]
pts = RandomReal[5, {50, 3}];
chull = ConvexHullMesh @ pts;

Then:

Tr @ PropertyValue[{chull, 2}, MeshCellMeasure]

86.8845076

Update

This approach is good because you have access to individual face areas and with PropertyValue you can do cool things like display the values of the areas on the mesh:

PropertyValue[{chull, {2, All}}, MeshCellLabel] = 
        Style[NumberForm[#, 3], Bold, Darker@Red, 15] & /@ 
                    PropertyValue[{chull, {2, All}}, MeshCellMeasure];

Then:

chull

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ Nice, I should have added benchmarking requirements to my original question just to make it challenging. $\endgroup$ Sep 23, 2014 at 19:58
9
$\begingroup$

For fun, here is an approach that uses the graphics generated from the mesh. Lets generate some points:

SeedRandom[0]
pts = RandomReal[5, {50, 3}];
chull = ConvexHullMesh @ pts;

Create a graphics object from it and discretize it:

gr = Graphics3D[GraphicsComplex[MeshCoordinates[chull], {MeshCells[chull, 2]}]];

And here is the area:

Area @ DiscretizeGraphics @ gr

86.8845076

For comparison:

Area @ RegionBoundary @ chull

86.8845076

$\endgroup$
2
  • $\begingroup$ Always enjoy a "just for fun" approach. $\endgroup$ Sep 23, 2014 at 19:32
  • $\begingroup$ @bobthechemist. yeah, me too. $\endgroup$
    – RunnyKine
    Sep 23, 2014 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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