奇怪的IFC“膨胀”
最近测试了一些IFC IFCXML,发现了一个有趣的现象。
有一个小别墅模型,RVT格式10MB左右,导出了一个140MB的IFC文件。而其他10MB左右的RVT模型,导出的IFC都是2-5 MB。
另外有一个15MB的RVT文件,通过RVT导出了8MB的IFC和35MB的IFCXML。然后这个8MB的IFC文件,再被Revit读取,这样导出的IFCXML文件竟然达到了167MB,是原来IFCXML文件的5倍左右。
Autodesk官方论坛回答:
为此我和buildingSMART认证的几位国外工程师/开发者取得了联系,在与他们交流后得到了答案。
这是我咨询一位澳大利亚的开发者,他给我的回复。同时他也是IFCWIKI官方认证的Blender BIM插件的主要开发者:
Revit is notorious for inefficient mesh descriptions in IFC. The primary cause of this is due to inefficient swept / blend curve handling. Internally, Revit stores the curve, but converts it to a mesh when exporting. This can result in two Revit files that look extremely similar, but one may have a huge size in IFC whereas the other will not.
When Revit re-imports the IFCXML, it is forced to meshify everything, since Revit’s parametric geometry round-tripping isn’t very good (but then again, most software’s geometry round-tripping is pretty poor). This results in a further explosion of filesize.
简单说就是Revit的几何转换“臭名昭著”。它会把内部存储的曲线,在导出时转换为网格。因此,IFC文件被Revit读取后,Revit会网格化所有内容,然后再输出的IFCXML或者其他类型文件都是网格化的,因此文件的size急剧上升。
这也就解释了为什么revit导出的IFC源文件是8MB,再导入Revit,再导出的ifcxml就变成了100多MB。因为“曲线被迫网格化”,所以“内存一下就爆炸”。
同时这位开发者对Revit也颇有微词,他和我们的看法不同,我们的认知是Revit或者说Autodesk很强,而IFC很一般。而这位开发者对Revit进行了一些点评,如下:
If any CG modeler ever modeled meshes the same way that Revit does it under the hood, they would be fired. Simple things like egress exit signs which should be 6 polygons in any sane software ends up being over 500 polygons in Revit due to how Revit decides to show it in IFC - if the user has inadvertently triggered one of the problems listed in that wiki article. For this reason, IFCs produced from the BlenderBIM Add-on actually can contain much more complex buildings at a fraction of the size of the IFCs coming out of Revit.
之后我又参考了一些网站,博客,这些通常是业内工程师所创作,因此没有以论文的形式发表。关于膨胀还有一些解释:
When Revit exports geometry to IFC, it may process it in a way that may lead to loss of information or inefficient data storage. Optimising geometry is highly advised to maintain quick workflows between OpenBIM and Revit.
Within Revit, the currently exported Element ID will be shown in the status bar on the bottom left during the export process. Watching this at export time and making a note of any Element IDs that take a particularly long time to export will help identify those with geometric issues that Revit is struggling with.
此外还有IFC版本上的建议:
IFC4 contains much more efficient ways of storing both mesh and non mesh geometry. Whenever possible, it is advised to export IFC files in the IFC4 format. This can result in significant filesize reductions. As an example, an IFC produced from Revit of a single object resulted in a filesize of 16,098kB. The same object re-exported to IFC4 using the BlenderBIM Add-on reduced the object to 4,487kb with no loss in geometric detail.
This filesize reduction occurs due to two improvements in the IFC4 data format. The first is the new tesselated shape supports, which allow a much more efficient description of meshes compared to the IFC2X3 faceted BREPs. The second is due to the improved support in Revit of exporting parametric geometry in IFC.
然而在之前的研究中,我已经发现了如果用IFC4进行压缩,会出现模型的不完整显示,如地下车库中的梁不见了,梁板柱结构的柱子没了。这同样被视为Revit“臭名昭著”的几何显示——曲线转换网格失败,导致模型显示不全。
总之,确实是Revit的问题,不仅仅是我做了测试,很多业内人士也发现了这个问题并且有相关记录。
发表评论: