jeremytammik / DirectObjLoader

Revit add-in to load a WaveFront OBJ model and generate a DirectShape element from it.
MIT License
17 stars 9 forks source link

DirectObjLoader

Revit add-in to load a WaveFront OBJ model and generate a DirectShape element from it.

The Building Coder provides a dedicated topic group where you can read all there is to know about the DirectShape Element.

The initial implementation and development history is documented in the article From Hack to App - OBJ Mesh Import to DirectShape.

Image

Sample fire hydrant OBJ file:

Image

Resulting DirectShape element in Revit model:

Image

Input scaling factor 1 versus 0.5 happily produces a gargoyle and a half:

Image

OBJ files defining groups generate a separate DirectShape element for each one:

Image

After adding support for faces with more than four vertices, the sandal.obj test file is loaded successfully, albeit with some missing faces:

Image

Switched from TessellatedShapeBuilder target Mesh to AnyGeometry generated more internal model structure from the sandal.obj test file, still with some missing faces:

Image

Release 2015.0.0.17 improved error handling on degenerate faces:

Image

TessellatedShapeBuilder Creates a Mesh with Slits

In case of slits between faces with more than 3 vertices, please refer to this solution:

Wish List

Author

Jeremy Tammik, The Building Coder and The 3D Web Coder, ADN Open, Autodesk Inc.

Dependencies

DirectObjLoader uses the FileFormatWavefront NuGet package based on Dave Kerr's file-format-wavefront GitHub library.

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.