You can use DelaunayMesh
, RegionBoundary
, and RegionMeasure
Points on a unit sphere for example data (Taken from:how to get $n$ equidistributed points on the unit spherehow to get $n$ equidistributed points on the unit sphere):
points = With[{points = 5000, samples = 40000, iterations = 20},
Nest[With[{randoms = Join[#, RandomPoint[Sphere[], samples]]},
Normalize@Mean@randoms[[#]] & /@
Values@PositionIndex@Nearest[#, randoms]] &,
RandomPoint[Sphere[], points], iterations]];
Calculating volume and surface area:
ListContourPlot3D[points, Contours -> {0}]
object = DelaunayMesh[points];
objectSurface = RegionBoundary[object];
RegionMeasure[object, 3]
RegionMeasure[objectSurface, 2]
4.18349
12.5579