Hi everyone.
First, thank you for your work here.
I need to convert ifc file to unity readable files, but retrieving the full hierarchy of the building (ground floor, .. ), and the type of the objects (window, door, wall, ..).
Is it possible to achieve this with IfcConvert in its current state, or is it in progress ?
Thank you for reading.
Yes, but one needs to write importer code for Unity which brings the geometry information (OBJ or DAE) and IFC data (XML) together.
Ok thanks, but is it possible to directly get a DAE file with the right hierarchy ? I would like to avoid storing and parsing the xml file.
Should be possible, although I can image the code getting quite complex (the DAE serialization is already quite complex to begin with due to the overengineered DAE design and the OpenCOLLADA library). For now the different serializers are written so that they simply "stream" arbitrary number of individual objects from the IFC file into the chosen output format.
The Blender importer has an option to reconstruct the hierarchy [1]. It would be nice to have this exposed to more output formats, but not something I have the time for at the moment. Pull requests welcome!
Alternatively, it should be fairly trivial also to merge the DAE and XML files by means of some post processing script.
Ok thank you, I'll see if I have the time to add this feature.
Not sure if it helps:
We are using Archicad and Cinema4D and fbx to get our models into Unity,
following this blog post mostly:
http://cad-3d.blogspot.de/2014/10/getting-bim-data-into-unity-part-1.html
But, that also does not preserve the hierarchy.
Would you recommend DAE or OBJ over FBX?
@thorade this is implemented now by @Skyndia see https://github.com/IfcOpenShell/IfcOpenShell/pull/211
FWIW, as the writer of the (old) blogpost cited above... I have been able to reconstruct the full IFC hierarchy from the OBJ and XML files as generated from IfcConvert inside Unity.
I used an OBJreader as it was able to load geometry at runtime. And then parsed the XML file with a custom C# script.
I'm planning to share the results in a later blog post.
I used an OBJreader
Using DAE has the added advantage that typically geometry for reoccurring instances can be reused. Depending on the file this may potentially be quite advantageous.
I'm planning to share the results in a later blog post.
Looking forward :)
Yeah, from experience I can recommend DAE over OBJ for Unity. However, I did ran into problems couple of times with large/complex DAEs and I used OBJ as a workaround in the past.
I did ran into problems couple of times with large/complex DAEs
Not every XML parser seems to be equipped for the crazily long textnode values for detailed mesh positions/normals. I occasionally had to switch do single precision to cut down on the text node size. No experience with Unity though.
Yeah, and in the case of Unity, the actual underlying importer/parser is the Autodesk FBX SDK (I could reproduce the errors with a standalone importer that is available). Especially, I suspect that Unity used (and still uses?) a 32-bit build of the importer even with the 64-bit Editor which doesn't help with very large files.
I'm planning to share the results in a later blog post.
Hi @stefkeB, did you share your result yet?
Most helpful comment
The Blender importer has an option to reconstruct the hierarchy [1]. It would be nice to have this exposed to more output formats, but not something I have the time for at the moment. Pull requests welcome!
Alternatively, it should be fairly trivial also to merge the DAE and XML files by means of some post processing script.
[1] https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcblender/io_import_scene_ifc/__init__.py#L175