points = {{0, 0, 1}, {5, 0, 0}, {1, 3, 0}, {0, 0, 2}, {4, 3, 0}, {5,
0, 2}, {1, 3, 2}, {4, 3, 2}};
reg = ConvexHullMesh @ points

RegionDimension @ reg
3
Volume @ reg
(* or *)
RegionMeasure @ reg
21.5
p1 = {2.6161, 2.60692, 0.880247};
RegionMember[reg, p1]
True
p2 = {0.915295, 0.507214, 0.367796};
RegionMember[reg, p2]
False
RegionCentroid @ reg
{2.61628, 1.44767, 1.08721}
Integrate[x y z, {x, y, z} ∈ reg]
82.0625
RegionIntersection
, RegionUnion
etc. all have in their documentation (under Possible Issues) that they are "not implemented for MeshRegion
objects embedded in 3D" and "nor for BoundaryMeshRegion
objects embdedded in 3D". My idea is to triangulate the MeshRegion
into Tetrahedron
s and RegionUnion
them into the desired Region
:
tri = TriangulateMesh[reg, MaxCellMeasure -> Infinity];
pts = MeshCoordinates @ tri;
ord = Cases[Show[tri][[1]], Tetrahedron[x_] :> x, Infinity] // First;
tetra = Tetrahedron /@ (pts[[##]] & /@ ord);
Volume /@ tetra // Total
21.5
The volume agrees.
r = RegionUnion[tetra];
RegionPlot3D @ r

Volume @ r
21.4583
The volume slightly diverges from the correct value. Nevertheless:
ball = Ball[{0, 0, 1}];
RegionPlot3D @ (int = RegionIntersection[r, ball])

Volume @ DiscretizeRegion @ int
0.530894
I want to check how accurate is the volume measurement of int
.
I start with altered points:
points1 = {{0, 0, 0}, {5, 0, 0}, {1, 3, 0}, {0, 0, 2}, {4, 3, 0}, {5,
0, 2}, {1, 3, 2}, {4, 3, 2}};
where I changed the first point - {0, 0, 1}
- to {0, 0, 0}
. Next I played with it forcefully
{b1, t1} = GatherBy[points1, Last];
ord = Drop[#, -1] & /@ (Flatten[#, 1] & /@
FindCurvePath /@ {b1, t1}) // First;
to create the correct ordering for making
hex = Hexahedron @ Join[b1[[ord]], t1[[ord]]];
which has
Volume @ hex
24
I then take manually
b2 = {{1, 3, 0}, {5, 0, 0}, {0, 0, 0}, {0, 0, 1}};
for creating the chunk additially added to the above hex
:
tetra = Tetrahedron @ b2;
These two can be handled with
Volume @ (region = RegionDifference[hex, tetra]) // N
21.5
to create the initial region of interest. Because this is a Region
, one can
ball = Ball[{0, 0, 1}];
RegionPlot3D[#, PlotPoints -> 100]& @ (inter = RegionIntersection[region, ball])

(and do other Region*
functions on it).
Volume @ N @ inter
0.534992
So the two measurements of the volume agree with each other.
DelaunayMesh
and/orMeshRegion
. Unfortunately,RegionIntersection
does not work with 3DMeshRegion
objects. (This is mentioned in the section "Possible Issues" forRegionIntersection
.) This command finds the volume of the 3D region over the points in the question:RegionMeasure[DelaunayMesh[points]]
. $\endgroup$DelaunayMesh@points
? TheFullForm[DelaunayMesh@points]
shows a lot of information but I can't extract any thing like I do withGraphics3D
. Thank you $\endgroup$MeshCells
andMeshCoordinates
. For example, look into the output ofMeshCells[DelaunayMesh[points], 2]
. $\endgroup$MeshCells
and thank you for that but what I meant is when you look atFullForm[DelaunayMesh@points]
I want for example to get the first list insideMeshRegion
(Cases[DelaunayMesh@points,MeshRegion[x_,__]:>x])
or what is insdeTetrahedron
(Cases[DelaunayMesh@points,MeshRegion[_,x_,__]:>x])
and so on. I can't use these methods becauseMeshRegion
is Atomic expression and I cannot find a way to do that. $\endgroup$DelaunayMesh
are guaranteed to be a set of Mathematica regions? For example, I was able to doRegionUnion @ MeshPrimitives[DelaunayMesh[points], 3]
for this example, but I didn't know if this would be a solution in every case. Can you think of a case where this would not work? $\endgroup$