xBimTeam / XbimGeometry

XbimGeometry contains the CLR interop libraries and the c++ engine used to compute the 3D geometry of models.
https://xbimteam.github.io/
Other
250 stars 127 forks source link

Big size of result IFC file #470

Open GVladislavG opened 4 months ago

GVladislavG commented 4 months ago

Hello, team! There is am IFC file from Civil 3D that has size of 11 MB. After import and export the only one object of this file using xBim I get IFC file of 20 MB. If I do this to whole model, I get 160 MB IFC file. MyIFC.zip

Please help to understand the reason of such difference in file sizes. Thank you!

andyward commented 4 months ago

It looks like

  1. You've lost the Maps (IfcMappedItems). That means all the shared geometry is lost, and now replicated per item
  2. You're defining a StyledByItem (and a graph of duplicated data such as IFCCOLOURRGB) for every RepresentationItem. Some of the items are represented by 80 meshs, and you're styling each one. See how many references to IfcColourRGB there are in the MyIFC.ifc containing one element (83) vs the original file containing the whole scene (20).

The combination of these two things will increase the size, especially here where you have complex tesselations.

I suspect Issue 2 accounts for 11MB =>20MB, while Issue 1 means the whole model => 160MB

image
GVladislavG commented 3 months ago

Thanks for your answer!

Is there any way to attach one color element to whole group of IfcShellBasedSurfaceModel? Maybe it's possible to attach color to IfcShapeRepresentation or IfcProductDefinitionShape?

andyward commented 3 months ago

If you reintroduce the IfcMappedItem you can just style that single element. https://standards.buildingsmart.org/IFC/DEV/IFC4_2/FINAL/HTML/link/ifcshaperepresentation.htm