I have a Teapot likes:
region = RepairMesh[ExampleData[{"Geometry3D", "UtahTeapot"}, "MeshRegion"]]
I want to calculate the volume of it, but it just 2
dimension as this code:
RegionDimension[region]
2
So I have to fill it into 3D.
com = ConnectedMeshComponents[region];
boundmesh = BoundaryMeshRegion[MeshCoordinates[#], MeshCells[#, 2]] & /@ com
RegionDimension /@ boundmesh
Note that these sections have overlapping parts:
Show[RegionPlot3D[First[boundmesh], PlotStyle -> Directive[Opacity[0.4], Red]],
RegionPlot3D[#, PlotStyle -> Directive[Blue]] & /@ Rest[boundmesh], Boxed -> False]
So let's union it, but I get an error information:
RegionUnion @@ boundmesh
It is a bug? And how to union all parts to calculate the volume of this tea-pot?