# How can I calculate volume of such a MeshRegion Object

The Data is here:

meshData

=== PolygonData is here

{{{5.25,8.625,11.5},{5.25,7.375,11.5},{1.5,7.375,11.5},{1.5,8.625,11.5}},{{1.5,7.375,11.5},{1.5,7.375,6.5},{1.5,8.625,6.5},{1.5,8.625,11.5}},{{4.,9.875,7.75},{4.,8.625,7.75},{2.75,8.625,7.75},{2.75,9.875,7.75}},{{2.75,8.625,7.75},{2.75,8.625,6.5},{2.75,9.875,6.5},{2.75,9.875,7.75}},{{4.,9.875,7.75},{4.,9.875,6.5},{4.,8.625,6.5},{4.,8.625,7.75}},{{0.25,9.875,12.75},{0.25,9.875,11.5},{0.25,11.125,11.5},{0.25,11.125,12.75}},{{-1.,11.125,12.75},{-1.,11.125,11.5},{-1.,6.125,11.5},{-1.,6.125,12.75}},{{-1.,11.125,12.75},{0.25,11.125,12.75},{0.25,11.125,11.5},{-1.,11.125,11.5}},{{-1.,6.125,11.5},{0.25,6.125,11.5},{0.25,6.125,12.75},{-1.,6.125,12.75}},{{0.25,6.125,12.75},{0.25,6.125,11.5},{0.25,7.375,11.5},{0.25,7.375,12.75}},{{0.25,9.875,6.5},{0.25,9.875,5.25},{0.25,11.125,5.25},{0.25,11.125,6.5}},{{-1.,11.125,6.5},{-1.,11.125,5.25},{-1.,6.125,5.25},{-1.,6.125,6.5}},{{-1.,11.125,6.5},{0.25,11.125,6.5},{0.25,11.125,5.25},{-1.,11.125,5.25}},{{-1.,6.125,5.25},{0.25,6.125,5.25},{0.25,6.125,6.5},{-1.,6.125,6.5}},{{0.25,6.125,6.5},{0.25,6.125,5.25},{0.25,7.375,5.25},{0.25,7.375,6.5}},{{0.25,9.875,11.5},{0.25,9.875,7.75},{0.25,9.875,6.5},{0.25,7.375,6.5},{0.25,7.375,11.5}},{{0.25,11.125,11.5},{0.25,9.875,11.5},{0.25,7.375,11.5},{0.25,6.125,11.5},{-1.,6.125,11.5},{-1.,11.125,11.5}},{{-1.,11.125,6.5},{-1.,6.125,6.5},{0.25,6.125,6.5},{0.25,7.375,6.5},{0.25,9.875,6.5},{0.25,11.125,6.5}},{{0.25,9.875,12.75},{5.25,9.875,12.75},{5.25,9.875,7.75},{4.,9.875,7.75},{2.75,9.875,7.75},{0.25,9.875,7.75},{0.25,9.875,11.5}},{{1.5,8.625,6.5},{2.75,8.625,6.5},{2.75,8.625,7.75},{4.,8.625,7.75},{4.,8.625,6.5},{5.25,8.625,6.5},{5.25,8.625,11.5},{1.5,8.625,11.5}},{{0.25,11.125,5.25},{0.25,9.875,5.25},{5.25,9.875,5.25},{5.25,7.375,5.25},{0.25,7.375,5.25},{0.25,6.125,5.25},{-1.,6.125,5.25},{-1.,11.125,5.25}},{{1.5,8.625,6.5},{1.5,7.375,6.5},{5.25,7.375,6.5},{5.25,8.625,6.5},{4.,8.625,6.5},{4.,9.875,6.5},{2.75,9.875,6.5},{2.75,8.625,6.5}},{{-1.,11.125,12.75},{-1.,6.125,12.75},{0.25,6.125,12.75},{0.25,7.375,12.75},{5.25,7.375,12.75},{5.25,9.875,12.75},{0.25,9.875,12.75},{0.25,11.125,12.75}},{{5.25,7.375,12.75},{5.25,7.375,11.5},{5.25,8.625,11.5},{5.25,8.625,6.5},{5.25,7.375,6.5},{5.25,7.375,5.25},{5.25,9.875,5.25},{5.25,9.875,7.75},{5.25,9.875,12.75}},{{5.25,9.875,7.75},{5.25,9.875,5.25},{0.25,9.875,5.25},{0.25,9.875,6.5},{0.25,9.875,7.75},{2.75,9.875,7.75},{2.75,9.875,6.5},{4.,9.875,6.5},{4.,9.875,7.75}},{{0.25,7.375,11.5},{0.25,7.375,6.5},{0.25,7.375,5.25},{5.25,7.375,5.25},{5.25,7.375,6.5},{1.5,7.375,6.5},{1.5,7.375,11.5},{5.25,7.375,11.5},{5.25,7.375,12.75},{0.25,7.375,12.75}}}

• Why not use MeshCoordinates[] and MeshCells[] to extract necessary information, and then try to make a BoundaryMeshRegion[] out of that data? (Actually, you might want to just try importing data as a BoundaryMeshRegion[] instead of as a MeshRegion[] if you're doing computations like this.) – J. M.'s ennui Apr 17 '20 at 11:54
• @J.M. Thanks for your opinion. It works for this example, meshRaw = BoundaryDiscretizeGraphics@Graphics3D[Polygon /@ data]. – HyperGroups Apr 17 '20 at 12:18
• @andre314 Yes, it works, thanks – HyperGroups Apr 17 '20 at 12:23
• @J.M. hi, see my new question, not all such polygons model can be converted into a BoundaryMeshRegion, do you have any ideas? mathematica.stackexchange.com/questions/221482/… – HyperGroups May 9 '20 at 7:44

Make it a BoundaryMeshRegion, tell Mathematica explicitly that this mesh is supposed too bound a volume and its RegionDimension dimensions becomes 3.

R = Import["mesh.wdx"];
RegionDimension[R]
M = BoundaryMeshRegion[MeshCoordinates[R], MeshCells[R, 2]];
RegionDimension[M]
Volume[M]

2

3

83.9844