# Manipulate MeshRegion as normal Mathematica expression

A MeshRegion seems to function quite differently from any other Mathematica expression. One cannot take a Part of it. Nor can I simply exchange its head to something else using Apply. What is going on here and how do I extract the argument in some manipulable form?

• MeshRegion is an atomic expression. See also AtomQ – Pinti Jan 27 at 13:22
• @Pinti, thanks! That is really annoying though and there does not seem to be a good reason why it would need to be. If you look at the FullForm you see that it would be perfectly possible to select its arguments. – Kvothe Jan 27 at 13:31
• That's what you use MeshCoordinates[] and MeshCells[] for. – J. M.'s technical difficulties Jan 27 at 13:35
• As for why MeshRegion is like this it is probably for similar reasons as for Graph which are discussed here mathematica.stackexchange.com/questions/127522/…. – Kvothe Jan 27 at 13:44

MeshRegion is an atomic expression. This may be to allow an optimized internal form. See an explanation for why Graph is atomic in Why is Graph an atomic expression in Mathematica?. Parts can be taken using MeshCoordinates[], MeshCells[] and Options[]. (I do not know whether these three functions can obtain all data contained in a MeshRegion but for now it seems like it.)
Another workaround would be to convert to a String and act on that:
takeArgumentMeshRegion[meshreg_]:=ToExpression@StringCases[ToString[FullForm@meshreg],"MeshRegion["~~x__~~"]":>"{"<>x<>"}"];