# How to show wireframes on imported Object / Mesh (.obj file)

I've managed to import a Wavefront (.obj) file and store it in a variable like so:

model = Import[
"/path_to_object/my.obj",
"Graphics3D",
Lighting -> {
{"Ambient", RGBColor[{0.212, 0.168, 0.2}]},
{"Directional", RGBColor[{0.8, 0., 0.}], ImageScaled[{2, 0, 2}]},
{"Directional", RGBColor[{0., 0.8, 0.}], ImageScaled[{2, 2, 2}]},
{"Directional", RGBColor[{0., 0., 0.8}], ImageScaled[{0, 2, 2}]}
}
]


The output shows no black edges that you would normally see with Graphics3D objects, sort of like a "wireframe overlay". I've tried to call the Graphics3D function on model in this way:

Graphics3D[{AbsoluteThickness[2], AbsoluteDashing[{5, 5}], model}]


But I get the error:

Graphics is not a Graphics3D primitive or directive.


I've also tried adding more arguments to the Import function but I get the error:

Import::argt: Import called with 3 arguments; 1 or 2 arguments are expected.


Any ideas on how this can be accomplished? I saw that there is the command Mesh->All, but because I'm not that well versed with Mathematica yet, I don't know exactly how to apply a Mesh command to an imported Graphics3D object.

-
Did you want something like DeleteCases[Import["ExampleData/wrench.obj.gz"], _EdgeForm, Infinity]? – J. M. May 16 '13 at 14:21
@j-m That was fast. How can I mark your comment as the answer? =) – flacle May 16 '13 at 14:26
Another hack for the way my .obj file is imported is: model /. EdgeForm[] -> EdgeForm[{Thick}] – SEngstrom May 16 '13 at 14:30
Thanks for the helpful answers so far. – flacle May 16 '13 at 16:38

At OP's behest:

The easiest approach to see the mesh lines is to remove the EdgeForm[] instruction that causes them not to appear. For instance,

DeleteCases[Import["ExampleData/wrench.obj.gz"], _EdgeForm, ∞]


As SEngstrom suggests, you can also use a replacement rule. If, for instance, you want a thick gray mesh, here's what you can do:

Import["ExampleData/wrench.obj.gz"] /. EdgeForm[] -> EdgeForm[Directive[Thick, Gray]]


Finally, if you want a true wire frame (no polygons):

Import["ExampleData/wrench.obj.gz"] /. EdgeForm[] -> FaceForm[None]


-

Import["ExampleData/wrench.obj.gz", "PolygonObjects"] // Graphics3D

You can use the FaceForm[None] trick as shown by @J.M. here just as well if you only want the wireframe looks.
Cool! I forgot you can specify properties in Import[]... – J. M. May 16 '13 at 15:18
@J.M. s rather well covered in the docs, too :-) – Yves Klett May 16 '13 at 15:19
Hah, yes. I've gotten too used to Import["file.ext", filetype, opts]` that I haven't been using the new features that much. – J. M. May 16 '13 at 15:21