DirectObjLoader

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

MIT License

Stars
16

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.

Sample fire hydrant OBJ file:

Resulting DirectShape element in Revit model:

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

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

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

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

Release 2015.0.0.17 improved error handling on degenerate faces:

TessellatedShapeBuilder Creates a Mesh with Slits

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

Wish List

  • Progress bar
  • Support for materials, minimally colour, preferably textures
  • Support for the options provided by the StlImport StlImportProperties class

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.

Related Projects