# How do I get a MeshRegion from an obj file, or from Geometry3D

How do I read in an obj file as a MeshRegion so I can e.g. compute its area?

If I just import the object and try Area[O] it tells me it is not a correctly specified region, even for e.g. the StanfordBunny.

Also, how do I turn Geometry3D into a MeshRegion? For example

Area[ExampleData[{"Geometry3D", "SpaceShuttle"}]]


does not work either.

It seems that geometry has more than one representation in different parts of Mathematica - bad.

-

Well, you have to first convert it to a MeshRegion. Let's take the space shuttle for example:

shuttle = ExampleData[{"Geometry3D", "SpaceShuttle"}]


Now, we discretize it, since it's a Graphics3D object, we use DiscretizeGraphics:

ds = DiscretizeGraphics[shuttle]


Now, we can find the Area easily:

Area[ds]


177.301907

Similarly for the horse:

horse = ExampleData[{"Geometry3D", "Horse"}]


dh = DiscretizeGraphics[horse]


We compute the surface area:

Area[dh]


0.0358690432

-
Does not always work. Area[DiscretizeGraphics[Import["somefile.obj"]]] still give a not correctly specified region error. –  Ralph Aug 18 '14 at 10:51
Retried it and it did work. Apologies. I must have typed something wrong. –  Ralph Aug 19 '14 at 7:44