# Problem NIntegrating over 3D Polygon region with 4 points

I am trying to NIntegrate a non-planar polygonal region defined by 4 points, something like this:

p1 = {1, 1, 1};
p2 = {-1, 1, 1};
p3 = {-1, -1, 1};
p4 = {1, -1, 4};
region = Polygon[{p1, p2, p3, p4}];
Show[Graphics3D[region]]
NIntegrate[1, {x, y, z} \[Element] region]


And this is the result I get:

What is the correct way of doing this? The integral works when the polygon is planar. I could separate the polygon into two triangles, but since the points vary a lot with each iteration of my script that might be an additional issue.

• It says in the documentation for Polygon Degenerate polygons are not valid geometric regions: and if you evaluate RegionQ[region] it is False when region is degenerate. Commented Jun 18, 2020 at 22:35
• I see, thanks. Then what approach would you recommend? Commented Jun 19, 2020 at 0:03
• region = MeshRegion[{p1, p2, p3, p4}, {Triangle[{1, 2, 3}], Triangle[{1, 3, 4}]}]; Commented Jun 19, 2020 at 0:19

There six interpretation of polygon for your situation, one for each edge of the tetrahedron. For each edge of the tetrahedron, the pair of faces may have a different area sum.

p1 = {1, 1, 1};
p2 = {-1, 1, 1};
p3 = {-1, -1, 1};
p4 = {1, -1, 4};
region = Tetrahedron[{p1, p2, p3, p4}];
Show[Graphics3D[region]]
NIntegrate[1, Element[{x, y, z}, region]]
TableForm[({#1[[1]], Area[#1[[1]]], #1[[2]], Area[#1[[2]]], Area[#1[[1]]] + Area[#1[[2]]]} & ) /@
Subsets[MeshPrimitives[region, 2], {2}]]