# How do I convert a mesh region back into a Graphics3D primitive?

The Graphics3D format has more styling options than mesh based graphics, so I was wondering if there was a way to convert mesh based objects such as region intersections and unions back into the Graphics3D format.

• Could you give us an example of such a mesh? Commented Jun 11, 2018 at 22:00
• Show[meshregion]? Commented Jun 12, 2018 at 0:01
• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. Commented Jun 12, 2018 at 1:29

Michaels comment is completely correct. By using Show, the region gets transformed back into a graphics, although it doesn't look like that. There is one major difference to my answer: While I'm extracting the polygons and the final Graphics3D will only contain these primitives, using Show wraps the polygons into an Annotation[poly, "Geometry"].

This is just for your information. Here is how you can extract the polygons and create a new Graphics3D:

{cube, cone} = DiscretizeRegion /@ {Cuboid[], Cone[]};
reg = RegionIntersection[cube, cone]


MeshPrimitives[reg, 2] // Graphics3D


• thank you, now I no longer need to worry about using my own functions for rotation and intersection Commented Jun 12, 2018 at 1:27

In Mathematica 12, MeshRegion and BoundaryMeshRegion objects act as graphics primitives in Graphics3D. So:

{cube, cone} = DiscretizeRegion /@ {Cuboid[], Cone[]};
reg = RegionIntersection[cube, cone];

Graphics3D[{LightGreen, EdgeForm[None], reg}]


It might be more efficient to use a GraphicsComplex for regions with many polygons

Graphics3D[{
GraphicsComplex[MeshCoordinates[reg],MeshCells[reg, 2, "Multicells" -> True]]
}]


Whenever reg is a MeshRegion, it is also a good idea to first convert it to a BoundaryMeshRegion with BoundaryMesh[reg]. Otherwise, also all interior (and thus invisible) polygons will be written into the GraphicsComplex (and have to be processed by the z-buffer of the GPU during rendering).