GLTF export with IFC data

This forum section is only for IFC-related issues
Post Reply
patrickk
Posts: 1
Joined: Fri Dec 17, 2021 12:53 pm

GLTF export with IFC data

Post by patrickk »

Hi,

I'm quite new to FreeCAD so I don't know/ fully understand all of the features in it yet. So far I have quite a positive experience with it and was quite surprised by the many file formats it supports.

What I would like to achieve is to get the IFC data, in particularly IFC GUID / IFC Global id, within the GLTF (metadata).
Importing the .ifc file and viewing the data is not a problem. The data is visible in FreeCAD; IFC Type, Global Id, etc.
I can also succesfully export the model to gltf, but the IFC Attributes are, as far as I'm aware, not being exported with the gltf.
IFCData.png
IFCData.png (53.09 KiB) Viewed 3744 times
So my question is: Is it possible to include IFC Attribute data in a gltf export in FreeCAD?

Other things I have tried are loading the IFC Attributes in a spreadsheet to export it as a json or xml. This did not work for me either. Not all the data seems to get included. I mainly need the Global id and could not find it in any of the generated spreadsheets that gets generated on importing an .ifc file.
Spreadsheet.png
Spreadsheet.png (60.3 KiB) Viewed 3744 times
For now i got the IFC data readable in .ifcjson through Python with ifcJSON-4 from BuildingSMART. I got that up and running in my terminal, but also get errors on trying to convert a selection of the ifc model to .ifcjson in FreeCAD.
IFCJSON_Error.png
IFCJSON_Error.png (133.09 KiB) Viewed 3744 times
I hope that anyone can help me with this or has some thoughts for alternative solutions if it's not possible to directly get the ifc GUID / global id in the gltf itself.

I'm using the following version of FreeCAD:
OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +99 (Git)
Build type: Release
Branch: Branch_0.19.3
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/Netherlands (en_NL)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: GLTF export with IFC data

Post by Kunda1 »

Mod edit: moved to IFC subforum
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: GLTF export with IFC data

Post by thomas-neemann »

patrickk wrote: Fri Dec 17, 2021 1:39 pm

What I would like to achieve is to get the IFC data, in particularly IFC GUID / IFC Global id, within the GLTF (metadata).
what do you want this for?
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: GLTF export with IFC data

Post by Moult »

I would not use FreeCAD for this. Export to IFC, then use IfcConvert from IfcOpenShell (what FreeCAD uses under the hood) to convert to glTF / glb.
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
Post Reply